No results for

Powered byAlgolia
  • Misc
  • Usage collection

Usage collection

By default, k6 sends a usage report each time it is run, so that we can track how often people use it. This report can be turned off by setting the environment variable K6_NO_USAGE_REPORT or by adding the option --no-usage-report when executing k6.

The usage report does not contain any information about what you are testing. The contents are the following:

  • The k6 version (string, e.g. "0.17.2")
  • Max VUs configured (number)
  • Test duration (number)
  • Total stages duration (number)
  • VU iterations configured (number)
  • The running program's operating system target (darwin, freebsd, linux...)
  • The running program's architecture target (386, amd64, arm, s390x...)

This info is sent to an HTTP server that collects statistics on k6 usage.

For those interested, here is the actual Go code that generates and sends the usage report:

snippet from run.go
1 // If the user hasn't opted out: report usage.
2
3 if !conf.NoUsageReport.Bool {
4 go func() {
5 u := "http://k6reports.k6.io/"
6 mime := "application/json"
7 var endTSeconds float64
8
9 if endT := engine.Executor.GetEndTime(); endT.Valid {
10 endTSeconds = time.Duration(endT.Duration).Seconds()
11 }
12
13 var stagesEndTSeconds float64
14 if stagesEndT := lib.SumStages(engine.Executor.GetStages()); stagesEndT.Valid {
15 stagesEndTSeconds = time.Duration(stagesEndT.Duration).Seconds()
16 }
17
18 body, err := json.Marshal(map[string]interface{}{
19 "k6_version": Version,
20 "vus_max": engine.Executor.GetVUsMax(),
21 "iterations": engine.Executor.GetEndIterations(),
22 "duration": endTSeconds,
23 "st_duration": stagesEndTSeconds,
24 "goos": runtime.GOOS,
25 "goarch": runtime.GOARCH,
26 })
27
28 if err != nil {
29 panic(err) // This should never happen!!
30 }
31 if _, err := http.Post(u, mime, bytes.NewBuffer(body)); err != nil {
32 log.WithError(err).Debug("Couldn't send usage blip")
33 }
34 }()
35 }