diff --git a/cmd/mt-store-cat/main.go b/cmd/mt-store-cat/main.go index 99ba853891..807fcf7d5c 100644 --- a/cmd/mt-store-cat/main.go +++ b/cmd/mt-store-cat/main.go @@ -31,11 +31,11 @@ var ( confFile = flag.String("config", "/etc/metrictank/metrictank.ini", "configuration file path") // our own flags - from = flag.String("from", "-24h", "get data from (inclusive). only for points and points-summary format") - to = flag.String("to", "now", "get data until (exclusive). only for points and points-summary format") - fix = flag.Int("fix", 0, "fix data to this interval like metrictank does quantization. only for points and points-summary format") - printTs = flag.Bool("print-ts", false, "print time stamps instead of formatted dates. only for points and poins-summary format") - groupTTL = flag.String("groupTTL", "d", "group chunks in TTL buckets based on s (second. means unbucketed), m (minute), h (hour) or d (day). only for chunk-summary format") + from = flag.String("from", "-24h", "get data from (inclusive). only for points and point-summary format") + to = flag.String("to", "now", "get data until (exclusive). only for points and point-summary format") + fix = flag.Int("fix", 0, "fix data to this interval like metrictank does quantization. only for points and point-summary format") + printTs = flag.Bool("print-ts", false, "print time stamps instead of formatted dates. only for points and point-summary format") + groupTTL = flag.String("groupTTL", "d", "group chunks in TTL buckets: s (second. means unbucketed), m (minute), h (hour) or d (day). only for chunk-summary format") timeZoneStr = flag.String("time-zone", "local", "time-zone to use for interpreting from/to when needed. (check your config)") ) diff --git a/cmd/mt-store-cat/metrics.go b/cmd/mt-store-cat/metrics.go index 4daa4be474..fbd19d7151 100644 --- a/cmd/mt-store-cat/metrics.go +++ b/cmd/mt-store-cat/metrics.go @@ -28,7 +28,7 @@ func (m MetricsByName) Less(i, j int) bool { return m[i].name < m[j].name } // prefix is optional func getMetrics(store *cassandra.CassandraStore, prefix string) ([]Metric, error) { var metrics []Metric - iter := store.Session.Query("select id, metric from metric_idx").Iter() + iter := store.Session.Query("select id, name from metric_idx").Iter() var m Metric var idString string for iter.Scan(&idString, &m.name) { @@ -54,10 +54,10 @@ func getMetrics(store *cassandra.CassandraStore, prefix string) ([]Metric, error func getMetric(store *cassandra.CassandraStore, amkey schema.AMKey) ([]Metric, error) { var metrics []Metric // index only stores MKey's, not AMKey's. - iter := store.Session.Query("select id, metric from metric_idx where id=? ALLOW FILTERING", amkey.MKey).Iter() + iter := store.Session.Query("select id, name from metric_idx where id=? ALLOW FILTERING", amkey.MKey.String()).Iter() var m Metric var idString string - for iter.Scan(idString, &m.name) { + for iter.Scan(&idString, &m.name) { mkey, err := schema.MKeyFromString(idString) if err != nil { panic(err) diff --git a/docs/tools.md b/docs/tools.md index 7cfcc55f97..66b314e3a6 100644 --- a/docs/tools.md +++ b/docs/tools.md @@ -387,17 +387,17 @@ Flags: -cql-protocol-version int cql protocol version to use (default 4) -fix int - fix data to this interval like metrictank does quantization. only for points and points-summary format + fix data to this interval like metrictank does quantization. only for points and point-summary format -from string - get data from (inclusive). only for points and points-summary format (default "-24h") + get data from (inclusive). only for points and point-summary format (default "-24h") -groupTTL string - group chunks in TTL buckets based on s (second. means unbucketed), m (minute), h (hour) or d (day). only for chunk-summary format (default "d") + group chunks in TTL buckets: s (second. means unbucketed), m (minute), h (hour) or d (day). only for chunk-summary format (default "d") -print-ts - print time stamps instead of formatted dates. only for points and poins-summary format + print time stamps instead of formatted dates. only for points and point-summary format -time-zone string time-zone to use for interpreting from/to when needed. (check your config) (default "local") -to string - get data until (exclusive). only for points and points-summary format (default "now") + get data until (exclusive). only for points and point-summary format (default "now") -version print version string -window-factor int diff --git a/scripts/config/schema-idx-cassandra.toml b/scripts/config/schema-idx-cassandra.toml index e63b7b32c1..1ea97c6d43 100644 --- a/scripts/config/schema-idx-cassandra.toml +++ b/scripts/config/schema-idx-cassandra.toml @@ -8,7 +8,6 @@ CREATE TABLE IF NOT EXISTS %s.metric_idx ( orgid int, partition int, name text, - metric text, interval int, unit text, mtype text,