From a2c5e49ac1c3160224186d02f15459540e29b6e7 Mon Sep 17 00:00:00 2001 From: Andrew Hodges Date: Tue, 9 Jun 2015 11:23:03 -0400 Subject: [PATCH] Stop sorting keys. --- testdata/rsyncd.json | 12 ++++++------ vm/parser.y | 2 -- vm/vm.go | 2 -- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/testdata/rsyncd.json b/testdata/rsyncd.json index 26a71e354..93f5a87e5 100644 --- a/testdata/rsyncd.json +++ b/testdata/rsyncd.json @@ -58,14 +58,14 @@ "Program": "rsyncd.mtail", "Kind": 0, "Keys": [ - "module", - "operation" + "operation", + "module" ], "LabelValues": [ { "Labels": [ - "module", - "send" + "send", + "module" ], "Value": { "Value": 2, @@ -74,8 +74,8 @@ }, { "Labels": [ - "repo", - "send" + "send", + "repo" ], "Value": { "Value": 25, diff --git a/vm/parser.y b/vm/parser.y index 06439a6a9..6afa4afcf 100644 --- a/vm/parser.y +++ b/vm/parser.y @@ -8,7 +8,6 @@ import ( "io" "fmt" "regexp" - "sort" "strconv" "github.com/google/mtail/metrics" @@ -334,7 +333,6 @@ decl } else { n = d.name } - sort.Sort(sort.StringSlice(d.keys)) d.m = metrics.NewMetric(n, mtaillex.(*parser).name, d.kind, d.keys...) d.sym = mtaillex.(*parser).s.addSym(d.name, IDSymbol, d.m, mtaillex.(*parser).t.pos) diff --git a/vm/vm.go b/vm/vm.go index 1fded51df..59bd655ad 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -10,7 +10,6 @@ import ( "os" "regexp" "runtime/debug" - "sort" "strconv" "strings" "text/tabwriter" @@ -348,7 +347,6 @@ func (v *VM) execute(t *thread, i instr) { //fmt.Printf("Keys: %v\n", keys) } //fmt.Printf("Keys: %v\n", keys) - sort.Sort(sort.StringSlice(keys)) d, err := m.GetDatum(keys...) if err != nil { v.errorf("GetDatum failed: %s", err)