<commit_before># Tools

Metrictank comes with a bunch of helper tools.

Here is an overview of them all.

This file is generated by [tools-to-doc](https://github.com/grafana/metrictank/blob/master/scripts/dev/tools-to-doc.sh)

---


## mt-aggs-explain

```
mt-aggs-explain

Usage:

	mt-aggs-explain [flags] [config-file]
           (config file defaults to /etc/metrictank/storage-aggregation.conf)

Flags:
  -metric string
    	specify a metric name to see which aggregation rule it matches
  -version
    	print version string
```


## mt-explain

```
mt-explain
Explains the execution plan for a given query / set of targets

Usage:

  mt-explain
  -from string
    	get data from (inclusive) (default "-24h")
  -mdp int
    	max data points to return (default 800)
  -mdp-optimization
    	enable MaxDataPoints optimization (experimental)
  -pre-normalization
    	enable pre-normalization optimization (default true)
  -stable
    	whether to use only functionality marked as stable (default true)
  -time-zone string
    	time-zone to use for interpreting from/to when needed. (check your config) (default "local")
  -to string
    	get data until (exclusive) (default "now")

Example:

  mt-explain -from -24h -to now -mdp 1000 "movingAverage(sumSeries(foo.bar), '2min')" "alias(averageSeries(foo.*), 'foo-avg')"

```


## mt-fakemetrics

```
Generates fake metrics workload

Usage:
  mt-fakemetrics [command]

Available Commands:
  agents           Mimic independent agents
  agginput         A particular workload good to test performance of carbon-relay-ng aggregators
  backfill         backfills old data and stops when 'now' is reached
  bad              Sends out invalid/out-of-order/duplicate metric data
  containers       Mimic a set of containers - with churn - whose stats get reported at the same time
  feed             Publishes a realtime feed of data
  help             Help about any command
  resolutionchange Sends out metric with changing intervals, time range 24hours
  schemasbackfill  backfills a sends a set of metrics for each encountered storage-schemas.conf rule. Note: patterns must be a static string + wildcard at the end (e.g. foo.bar.*)!
  storageconf      Sends out one or more set of 10 metrics which you can test aggregation and retention rules on
  version          Print the version number

Flags:
  -t, --add-tags                     add the built-in tags to generated metrics (default false)
      --carbon-addr string           carbon TCP address. e.g. localhost:2003
      --config string                config file (default is $HOME/.mt-fakemetrics.yaml)
      --custom-tags strings          A list of comma separated tags (i.e. "tag1=value1,tag2=value2")(default empty) conflicts with add-tags
      --filter strings               A list of comma separated filters to apply. E.g. 'offset:-1h,offset:12h'
      --gnet-addr string             gnet address. e.g. http://localhost:8081
      --gnet-key string              gnet api key
  -h, --help                         help for mt-fakemetrics
      --kafka-comp string            compression: none|gzip|snappy (default "snappy")
      --kafka-mdm-addr string        kafka TCP address for MetricData-Msgp messages. e.g. localhost:9092
      --kafka-mdm-topic string       kafka topic for MetricData-Msgp messages (default "mdm")
      --kafka-mdm-v2                 enable MetricPoint optimization (send MetricData first, then optimized MetricPoint payloads) (default true)
      --listen string                http listener address for pprof. (default ":6764")
      --log-level int                log level. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL (default 2)
      --num-unique-custom-tags int   a number between 0 and the length of custom-tags. when using custom-tags this will make the tags unique (default 0)
      --num-unique-tags int          a number between 0 and 10. when using add-tags this will add a unique number to some built-in tags (default 1)
      --partition-scheme string      method used for partitioning metrics (kafka-mdm-only). (byOrg|bySeries|bySeriesWithTags|bySeriesWithTagsFnv|lastNum) (default "bySeries")
      --statsd-addr string           statsd TCP address. e.g. 'localhost:8125'
      --statsd-type string           statsd type: standard or datadog (default "standard")
      --stdout                       enable emitting metrics to stdout
<commit_msg>docs update<commit_after># Tools

Metrictank comes with a bunch of helper tools.

Here is an overview of them all.

This file is generated by [tools-to-doc](https://github.com/grafana/metrictank/blob/master/scripts/dev/tools-to-doc.sh)

---


## mt-aggs-explain

```
mt-aggs-explain

Usage:

	mt-aggs-explain [flags] [config-file]
           (config file defaults to /etc/metrictank/storage-aggregation.conf)

Flags:
  -metric string
    	specify a metric name to see which aggregation rule it matches
  -version
    	print version string
```


## mt-explain

```
mt-explain
Explains the execution plan for a given query / set of targets

Usage:

  mt-explain
  -from string
    	get data from (inclusive) (default "-24h")
  -mdp int
    	max data points to return (default 800)
  -mdp-optimization
    	enable MaxDataPoints optimization (experimental)
  -pre-normalization
    	enable pre-normalization optimization (default true)
  -stable
    	whether to use only functionality marked as stable (default true)
  -time-zone string
    	time-zone to use for interpreting from/to when needed. (check your config) (default "local")
  -to string
    	get data until (exclusive) (default "now")

Example:

  mt-explain -from -24h -to now -mdp 1000 "movingAverage(sumSeries(foo.bar), '2min')" "alias(averageSeries(foo.*), 'foo-avg')"

```


## mt-fakemetrics

```
Generates fake metrics workload

Usage:
  mt-fakemetrics [command]

Available Commands:
  agents           Mimic independent agents
  agginput         A particular workload good to test performance of carbon-relay-ng aggregators
  backfill         backfills old data and stops when 'now' is reached
  bad              Sends out invalid/out-of-order/duplicate metric data
  containers       Mimic a set of containers - with churn - whose stats get reported at the same time
  feed             Publishes a realtime feed of data
  help             Help about any command
  resolutionchange Sends out metric with changing intervals, time range 24hours
  schemasbackfill  backfills a sends a set of metrics for each encountered storage-schemas.conf rule. Note: patterns must be a static string + wildcard at the end (e.g. foo.bar.*)!
  storageconf      Sends out one or more set of 10 metrics which you can test aggregation and retention rules on
  version          Print the version number

Flags:
  -t, --add-tags                     add the built-in tags to generated metrics (default false)
      --carbon-addr string           carbon TCP address. e.g. localhost:2003
      --config string                config file (default is $HOME/.mt-fakemetrics.yaml)
      --custom-tags strings          A list of comma separated tags (i.e. "tag1=value1,tag2=value2")(default empty) conflicts with add-tags
      --filter strings               A list of comma separated filters to apply. E.g. 'offset:-1h,period:patt1=10:patt2=5'
      --gnet-addr string             gnet address. e.g. http://localhost:8081
      --gnet-key string              gnet api key
  -h, --help                         help for mt-fakemetrics
      --kafka-comp string            compression: none|gzip|snappy (default "snappy")
      --kafka-mdm-addr string        kafka TCP address for MetricData-Msgp messages. e.g. localhost:9092
      --kafka-mdm-topic string       kafka topic for MetricData-Msgp messages (default "mdm")
      --kafka-mdm-v2                 enable MetricPoint optimization (send MetricData first, then optimized MetricPoint payloads) (default true)
      --listen string                http listener address for pprof. (default ":6764")
      --log-level int                log level. 0=TRACE|1=DEBUG|2=INFO|3=WARN|4=ERROR|5=CRITICAL|6=FATAL (default 2)
      --num-unique-custom-tags int   a number between 0 and the length of custom-tags. when using custom-tags this will make the tags unique (default 0)
      --num-unique-tags int          a number between 0 and 10. when using add-tags this will add a unique number to some built-in tags (default 1)
      --partition-scheme string      method used for partitioning metrics (kafka-mdm-only). (byOrg|bySeries|bySeriesWithTags|bySeriesWithTagsFnv|lastNum) (default "bySeries")
      --statsd-addr string           statsd TCP address. e.g. 'localhost:8125'
      --statsd-type string           statsd type: standard or datadog (default "standard")
      --stdout                       enable emitting metrics to stdout

{'fraction_non_alphanumeric': 0.08302185978026956, 'fraction_numerical': 0.013478310114395741, 'mean_word_length': 2.580697485806975, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1592220', 'n_tokens_mistral': 2639, 'n_tokens_neox': 2490, 'n_words': 941}