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

Fixes #1124

Merged
merged 4 commits into from
Oct 31, 2018
Merged

Fixes #1124

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cmd/mt-store-cat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/mt-store-cat/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions docs/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion scripts/config/schema-idx-cassandra.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down