Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 7d3a8c5

Browse files
authored
Merge pull request #1124 from grafana/fixes
Fixes
2 parents 1d8722f + 9956af9 commit 7d3a8c5

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

cmd/mt-store-cat/main.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ var (
3131
confFile = flag.String("config", "/etc/metrictank/metrictank.ini", "configuration file path")
3232

3333
// our own flags
34-
from = flag.String("from", "-24h", "get data from (inclusive). only for points and points-summary format")
35-
to = flag.String("to", "now", "get data until (exclusive). only for points and points-summary format")
36-
fix = flag.Int("fix", 0, "fix data to this interval like metrictank does quantization. only for points and points-summary format")
37-
printTs = flag.Bool("print-ts", false, "print time stamps instead of formatted dates. only for points and poins-summary format")
38-
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")
34+
from = flag.String("from", "-24h", "get data from (inclusive). only for points and point-summary format")
35+
to = flag.String("to", "now", "get data until (exclusive). only for points and point-summary format")
36+
fix = flag.Int("fix", 0, "fix data to this interval like metrictank does quantization. only for points and point-summary format")
37+
printTs = flag.Bool("print-ts", false, "print time stamps instead of formatted dates. only for points and point-summary format")
38+
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")
3939
timeZoneStr = flag.String("time-zone", "local", "time-zone to use for interpreting from/to when needed. (check your config)")
4040
)
4141

cmd/mt-store-cat/metrics.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func (m MetricsByName) Less(i, j int) bool { return m[i].name < m[j].name }
2828
// prefix is optional
2929
func getMetrics(store *cassandra.CassandraStore, prefix string) ([]Metric, error) {
3030
var metrics []Metric
31-
iter := store.Session.Query("select id, metric from metric_idx").Iter()
31+
iter := store.Session.Query("select id, name from metric_idx").Iter()
3232
var m Metric
3333
var idString string
3434
for iter.Scan(&idString, &m.name) {
@@ -54,10 +54,10 @@ func getMetrics(store *cassandra.CassandraStore, prefix string) ([]Metric, error
5454
func getMetric(store *cassandra.CassandraStore, amkey schema.AMKey) ([]Metric, error) {
5555
var metrics []Metric
5656
// index only stores MKey's, not AMKey's.
57-
iter := store.Session.Query("select id, metric from metric_idx where id=? ALLOW FILTERING", amkey.MKey).Iter()
57+
iter := store.Session.Query("select id, name from metric_idx where id=? ALLOW FILTERING", amkey.MKey.String()).Iter()
5858
var m Metric
5959
var idString string
60-
for iter.Scan(idString, &m.name) {
60+
for iter.Scan(&idString, &m.name) {
6161
mkey, err := schema.MKeyFromString(idString)
6262
if err != nil {
6363
panic(err)

docs/tools.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -387,17 +387,17 @@ Flags:
387387
-cql-protocol-version int
388388
cql protocol version to use (default 4)
389389
-fix int
390-
fix data to this interval like metrictank does quantization. only for points and points-summary format
390+
fix data to this interval like metrictank does quantization. only for points and point-summary format
391391
-from string
392-
get data from (inclusive). only for points and points-summary format (default "-24h")
392+
get data from (inclusive). only for points and point-summary format (default "-24h")
393393
-groupTTL string
394-
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")
394+
group chunks in TTL buckets: s (second. means unbucketed), m (minute), h (hour) or d (day). only for chunk-summary format (default "d")
395395
-print-ts
396-
print time stamps instead of formatted dates. only for points and poins-summary format
396+
print time stamps instead of formatted dates. only for points and point-summary format
397397
-time-zone string
398398
time-zone to use for interpreting from/to when needed. (check your config) (default "local")
399399
-to string
400-
get data until (exclusive). only for points and points-summary format (default "now")
400+
get data until (exclusive). only for points and point-summary format (default "now")
401401
-version
402402
print version string
403403
-window-factor int

scripts/config/schema-idx-cassandra.toml

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ CREATE TABLE IF NOT EXISTS %s.metric_idx (
88
orgid int,
99
partition int,
1010
name text,
11-
metric text,
1211
interval int,
1312
unit text,
1413
mtype text,

0 commit comments

Comments
 (0)