@@ -93,7 +93,7 @@ func TestQueryCmd(t *testing.T) {
9393 ))
9494 },
9595 args : []string {"run" , "../main.go" , "query" , "-o" , "org" , "-b" , "bucket" , "-T" , "token" , "--flux-file" , "../testdata/mem.flux" , "-w" , "200" , "-c" , "500" },
96- expected : "[CRITICAL] - InfluxDB Query Status | mem.active=501;200;500 mem.active=502;200;500 mem.active= 125;200;500" ,
96+ expected : "[CRITICAL] - InfluxDB Query Status | mem.active=125;200;500" ,
9797 },
9898 {
9999 name : "query-string-output" ,
@@ -110,7 +110,7 @@ func TestQueryCmd(t *testing.T) {
110110 ))
111111 },
112112 args : []string {"run" , "../main.go" , "query" , "-o" , "org" , "-b" , "bucket" , "-T" , "token" , "--flux-string" , "from(bucket:\" monitor\" )|>range(start:-1h)" , "-w" , "1" , "-c" , "2" },
113- expected : "[OK] - InfluxDB Query Status | cpu.usage_user=0.078;1;2 cpu.usage_user=0.044;1;2 cpu.usage_user=0.078;1;2 cpu.usage_user=0. 044;1;2" ,
113+ expected : "[OK] - InfluxDB Query Status | cpu.usage_user=0.044;1;2" ,
114114 },
115115 {
116116 name : "query-perfdata" ,
@@ -125,7 +125,7 @@ func TestQueryCmd(t *testing.T) {
125125 ))
126126 },
127127 args : []string {"run" , "../main.go" , "query" , "-o" , "org" , "-b" , "bucket" , "-T" , "token" , "--flux-string" , "from(bucket:\" monitor\" )|>range(start:-1h)" , "-w" , "1" , "-c" , "2" , "--perfdata-label" , "foobar" },
128- expected : "InfluxDB Query Status | foobar=0.078;1;2 foobar=0. 044;1;2" ,
128+ expected : "InfluxDB Query Status | foobar=0.044;1;2" ,
129129 },
130130 {
131131 name : "query-perfdata-by-key" ,
@@ -140,7 +140,7 @@ func TestQueryCmd(t *testing.T) {
140140 ))
141141 },
142142 args : []string {"run" , "../main.go" , "query" , "-o" , "org" , "-b" , "bucket" , "-T" , "token" , "--flux-string" , "from(bucket:\" monitor\" )|>range(start:-1h)" , "-w" , "1" , "-c" , "2" , "--perfdata-label-by-key" , "host" },
143- expected : "InfluxDB Query Status | influx=0.078;1;2 influx=0. 044;1;2" ,
143+ expected : "InfluxDB Query Status | influx=0.044;1;2" ,
144144 },
145145 {
146146 name : "query-perfdata-by-key-is-nil" ,
@@ -155,7 +155,7 @@ func TestQueryCmd(t *testing.T) {
155155 ))
156156 },
157157 args : []string {"run" , "../main.go" , "query" , "-o" , "org" , "-b" , "bucket" , "-T" , "token" , "--flux-string" , "from(bucket:\" monitor\" )|>range(start:-1h)" , "-w" , "1" , "-c" , "2" , "--perfdata-label-by-key" , "foobar" },
158- expected : "InfluxDB Query Status | " ,
158+ expected : "InfluxDB Query Status" ,
159159 },
160160 }
161161
0 commit comments