Skip to content

Commit

Permalink
Added information about statistics colletion
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartin82 committed Mar 15, 2019
1 parent 0df601f commit f9c3570
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,19 @@ All endpoints have the same output format:
]
```

### Statistics

Mmock is collecting anonymous statistics about the usage of the following actions:

Source code: [/statistics/statistics.go](https://github.com/jmartin82/mmock/blob/master/statistics/statistics.go#L30)

- `requests.mock`: Mocks served (number)
- `requests.console`: Web console usage (number)
- `requests.verify`: Verify requests (number)
- `feature.scenario`: Mocks with scenario feature served (number)
- `feature.proxy`: Mocks with proxy feature served (number)

You can always disable this behavior adding the following flag `-server-statistics=false`


### Contributors
Expand Down
9 changes: 7 additions & 2 deletions mmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,15 @@ func main() {
router := getRouter(mapping, tester)
varsProcessor := getVarsProcessor()

if !(*sStatistics) {
if *sStatistics {
fmt.Printf("\n************************************************************************************\n")
fmt.Printf("* Mmock is collecting anonymous statistics about the usage of the features. *\n")
fmt.Printf("* You can disable this behavior adding the following flag -server-statistics=false *\n")
fmt.Printf("************************************************************************************\n\n")
} else {
statistics.SetMonitor(statistics.NewNullableMonitor())
log.Printf("Not sending statistics\n")
}

defer statistics.Stop()

go startServer(*sIP, *sPort, *sPortTLS, *cTLS, done, router, mLog, scenario, varsProcessor, spy)
Expand Down

0 comments on commit f9c3570

Please sign in to comment.