1 QA output created by 299
2 === No instance and no error cases ===
4 pmParseMetricSpec("sample", 1, "default_arch", ...)
9 pmParseMetricSpec("sample", 0, "default_host", ...)
11 source: "default_host"
14 pmParseMetricSpec("my_arch/sample", 1, "default_arch", ...)
19 pmParseMetricSpec("my_host:sample", 0, "default_host", ...)
24 pmParseMetricSpec("other_host:sample", 1, "default_arch", ...)
29 pmParseMetricSpec("/other/arch/sample", 0, "default_host", ...)
34 pmParseMetricSpec("@:sample", 0, "default_host", ...)
39 === One instance and no error cases ===
41 pmParseMetricSpec("sample[singular]", 1, "default_arch", ...)
43 source: "default_arch"
47 pmParseMetricSpec("sample[singular]", 0, "default_host", ...)
49 source: "default_host"
53 pmParseMetricSpec("my_arch/sample[singular]", 1, "default_arch", ...)
59 pmParseMetricSpec("my_host:sample[singular]", 0, "default_host", ...)
65 pmParseMetricSpec("other_host:sample[singular]", 1, "default_arch", ...)
71 pmParseMetricSpec("/other/arch/sample[singular]", 0, "default_host", ...)
77 pmParseMetricSpec("@:sample[singular]", 0, "default_host", ...)
83 === Multiple instances and no error cases ===
85 pmParseMetricSpec("sample[one,two,three]", 1, "default_arch", ...)
87 source: "default_arch"
93 pmParseMetricSpec("sample[one,two,three]", 0, "default_host", ...)
95 source: "default_host"
101 pmParseMetricSpec("my_arch/sample[one,two,three]", 1, "default_arch", ...)
109 pmParseMetricSpec("my_host:sample[one,two,three]", 0, "default_host", ...)
117 pmParseMetricSpec("other_host:sample[one,two,three]", 1, "default_arch", ...)
125 pmParseMetricSpec("/other/arch/sample[one,two,three]", 0, "default_host", ...)
127 source: "/other/arch"
133 pmParseMetricSpec("@:sample[one,two,three]", 0, "default_host", ...)
141 === Some whitespace cases ===
143 pmParseMetricSpec(" my_host : sample [ one , two , three ] ", 0, "default_host", ...)
151 pmParseMetricSpec("my_arch / sample [singular]", 1, "default_arch", ...)
157 === Miscellaneous cases ===
159 pmParseMetricSpec("../../relative/pathname/myarch/metric", 0, "default_host", ...)
161 source: "../../relative/pathname/myarch"
164 pmParseMetricSpec("metric.a.b.c.d[]", 0, "default_host", ...)
166 source: "default_host"
167 metric: "metric.a.b.c.d"
169 pmParseMetricSpec("/full/pathname/myarch/metric[fumble mumble]", 0, "default_host", ...)
171 source: "/full/pathname/myarch"
176 pmParseMetricSpec("./myarch/metric[fumble,,mumble]", 0, "default_host", ...)
183 pmParseMetricSpec("foo["instance with strange chars :/,[]\""]", 0, "default_host", ...)
185 source: "default_host"
187 inst[0]: "instance with strange chars :/,[]""
189 pmParseMetricSpec("20080424:12:05/disk.dev.total["sda1"]", 0, "default_host", ...)
191 source: "20080424:12:05"
192 metric: "disk.dev.total"
195 pmParseMetricSpec("20080424:12:05/disk.all.total", 0, "default_host", ...)
197 source: "20080424:12:05"
198 metric: "disk.all.total"
200 === Some odd cases (incorrectly used to be classified as errors) ===
202 pmParseMetricSpec("one/two:three", 0, "default_host", ...)
207 pmParseMetricSpec("foo:bar/fumble[mumble]", 0, "default_host", ...)
213 === Some error cases ===
215 pmParseMetricSpec("foo/bar[fumble]mumble", 0, "default_host", ...)
216 pmParseMetricSpec Error:
217 foo/bar[fumble]mumble
218 ^ -- unexpected extra characters
221 pmParseMetricSpec("foo:", 0, "default_host", ...)
222 pmParseMetricSpec Error:
224 ^ -- performance metric name expected
227 pmParseMetricSpec(":badhost", 0, "default_host", ...)
228 pmParseMetricSpec Error:
230 ^ -- host name expected
233 pmParseMetricSpec("bad/arch/", 0, "default_host", ...)
234 pmParseMetricSpec Error:
236 ^ -- performance metric name expected
239 pmParseMetricSpec("/bad/arch/[", 0, "default_host", ...)
240 pmParseMetricSpec Error:
242 ^ -- performance metric name expected
245 pmParseMetricSpec("norsqb[", 0, "default_host", ...)
246 pmParseMetricSpec Error:
248 ^ -- closing ] expected
251 pmParseMetricSpec("nolsqb-instance]", 0, "default_host", ...)
252 pmParseMetricSpec Error:
254 ^ -- unexpected character in metric name
257 pmParseMetricSpec("metric["noclosingquote", 0, "default_host", ...)
258 pmParseMetricSpec Error:
259 metric["noclosingquote
260 ^ -- closing " and ] expected
263 pmParseMetricSpec("metric["noclosingquote]", 0, "default_host", ...)
264 pmParseMetricSpec Error:
265 metric["noclosingquote]
266 ^ -- closing " and ] expected
269 pmParseMetricSpec("metric["noclosing]"", 0, "default_host", ...)
270 pmParseMetricSpec Error:
272 ^ -- closing ] expected
275 pmParseMetricSpec("metric["ends in backslash\", 0, "default_host", ...)
276 pmParseMetricSpec Error:
277 metric["ends in backslash\
278 ^ -- closing " and ] expected