You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/avalanche.go
+53-21
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,7 @@ import (
18
18
"fmt"
19
19
"log"
20
20
"math/rand"
21
+
"os"
21
22
"strconv"
22
23
"sync"
23
24
"time"
@@ -30,36 +31,67 @@ import (
30
31
)
31
32
32
33
var (
33
-
metricCount=kingpin.Flag("metric-count", "Number of metrics to serve.").Default("500").Int()
34
-
labelCount=kingpin.Flag("label-count", "Number of labels per-metric.").Default("10").Int()
35
-
seriesCount=kingpin.Flag("series-count", "Number of series per-metric.").Default("10").Int()
36
-
metricLength=kingpin.Flag("metricname-length", "Modify length of metric names.").Default("5").Int()
37
-
labelLength=kingpin.Flag("labelname-length", "Modify length of label names.").Default("5").Int()
38
-
constLabels=kingpin.Flag("const-label", "Constant label to add to every metric. Format is labelName=labelValue. Flag can be specified multiple times.").Strings()
39
-
valueInterval=kingpin.Flag("value-interval", "Change series values every {interval} seconds.").Default("30").Int()
40
-
labelInterval=kingpin.Flag("series-interval", "Change series_id label values every {interval} seconds.").Default("60").Int()
41
-
metricInterval=kingpin.Flag("metric-interval", "Change __name__ label values every {interval} seconds.").Default("120").Int()
42
-
port=kingpin.Flag("port", "Port to serve at").Default("9001").Int()
43
-
remoteURL=kingpin.Flag("remote-url", "URL to send samples via remote_write API.").URL()
44
-
remotePprofURLs=kingpin.Flag("remote-pprof-urls", "a list of urls to download pprofs during the remote write: --remote-pprof-urls=http://127.0.0.1:10902/debug/pprof/heap --remote-pprof-urls=http://127.0.0.1:10902/debug/pprof/profile").URLList()
45
-
remotePprofInterval=kingpin.Flag("remote-pprof-interval", "how often to download pprof profiles.When not provided it will download a profile once before the end of the test.").Duration()
46
-
remoteBatchSize=kingpin.Flag("remote-batch-size", "how many samples to send with each remote_write API request.").Default("2000").Int()
47
-
remoteRequestCount=kingpin.Flag("remote-requests-count", "how many requests to send in total to the remote_write API.").Default("100").Int()
48
-
remoteReqsInterval=kingpin.Flag("remote-write-interval", "delay between each remote write request.").Default("100ms").Duration()
49
-
remoteTenant=kingpin.Flag("remote-tenant", "Tenant ID to include in remote_write send").Default("0").String()
50
-
tlsClientInsecure=kingpin.Flag("tls-client-insecure", "Skip certificate check on tls connection").Default("false").Bool()
51
-
remoteTenantHeader=kingpin.Flag("remote-tenant-header", "Tenant ID to include in remote_write send. The default, is the default tenant header expected by Cortex.").Default("X-Scope-OrgID").String()
34
+
metricCount=kingpin.Flag("metric-count", "Number of metrics to serve.").Default("500").Int()
35
+
labelCount=kingpin.Flag("label-count", "Number of labels per-metric.").Default("10").Int()
36
+
seriesCount=kingpin.Flag("series-count", "Number of series per-metric.").Default("100").Int()
37
+
seriesChangeRate=kingpin.Flag("series-change-rate", "The rate at which the number of active series changes over time. Applies to 'gradual-change' mode.").Default("100").Int()
38
+
maxSeriesCount=kingpin.Flag("max-series-count", "Maximum number of series to serve. Applies to 'gradual-change' mode.").Default("1000").Int()
39
+
minSeriesCount=kingpin.Flag("min-series-count", "Minimum number of series to serve. Applies to 'gradual-change' mode.").Default("100").Int()
40
+
metricLength=kingpin.Flag("metricname-length", "Modify length of metric names.").Default("5").Int()
41
+
labelLength=kingpin.Flag("labelname-length", "Modify length of label names.").Default("5").Int()
42
+
constLabels=kingpin.Flag("const-label", "Constant label to add to every metric. Format is labelName=labelValue. Flag can be specified multiple times.").Strings()
43
+
valueInterval=kingpin.Flag("value-interval", "Change series values every {interval} seconds.").Default("30").Int()
44
+
labelInterval=kingpin.Flag("series-interval", "Change series_id label values every {interval} seconds.").Default("60").Int()
45
+
metricInterval=kingpin.Flag("metric-interval", "Change __name__ label values every {interval} seconds.").Default("120").Int()
46
+
seriesChangeInterval=kingpin.Flag("series-change-interval", "Change the number of series every {interval} seconds. Applies to 'gradual-change' and 'double-halve' modes.").Default("10").Int()
47
+
seriesOperationMode=kingpin.Flag("series-operation-mode", "Mode of operation: 'gradual-change', 'double-halve'").Default("default").String()
48
+
port=kingpin.Flag("port", "Port to serve at").Default("9001").Int()
49
+
remoteURL=kingpin.Flag("remote-url", "URL to send samples via remote_write API.").URL()
50
+
remotePprofURLs=kingpin.Flag("remote-pprof-urls", "a list of urls to download pprofs during the remote write: --remote-pprof-urls=http://127.0.0.1:10902/debug/pprof/heap --remote-pprof-urls=http://127.0.0.1:10902/debug/pprof/profile").URLList()
51
+
remotePprofInterval=kingpin.Flag("remote-pprof-interval", "how often to download pprof profiles.When not provided it will download a profile once before the end of the test.").Duration()
52
+
remoteBatchSize=kingpin.Flag("remote-batch-size", "how many samples to send with each remote_write API request.").Default("2000").Int()
53
+
remoteRequestCount=kingpin.Flag("remote-requests-count", "how many requests to send in total to the remote_write API.").Default("100").Int()
54
+
remoteReqsInterval=kingpin.Flag("remote-write-interval", "delay between each remote write request.").Default("100ms").Duration()
55
+
remoteTenant=kingpin.Flag("remote-tenant", "Tenant ID to include in remote_write send").Default("0").String()
56
+
tlsClientInsecure=kingpin.Flag("tls-client-insecure", "Skip certificate check on tls connection").Default("false").Bool()
57
+
remoteTenantHeader=kingpin.Flag("remote-tenant-header", "Tenant ID to include in remote_write send. The default, is the default tenant header expected by Cortex.").Default("X-Scope-OrgID").String()
52
58
)
53
59
54
60
funcmain() {
55
61
kingpin.Version(version.Print("avalanche"))
56
62
log.SetFlags(log.Ltime|log.Lshortfile) // Show file name and line in logs.
57
-
kingpin.CommandLine.Help="avalanche - metrics test server"
63
+
kingpin.CommandLine.Help="avalanche - metrics test server\n"+
64
+
"\nSeries Operation Modes:\n"+
65
+
" double-halve:\n"+
66
+
" Alternately doubles and halves the series count at regular intervals.\n"+
0 commit comments