mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-12-23 14:00:30 +00:00
add test case for timer types
This commit is contained in:
parent
c9510f7f23
commit
93243f61a1
1 changed files with 26 additions and 0 deletions
|
@ -312,6 +312,32 @@ mappings:
|
|||
config: ``,
|
||||
mappings: map[string]map[string]string{},
|
||||
},
|
||||
// Config with good timer type.
|
||||
{
|
||||
config: `---
|
||||
mappings:
|
||||
- match: test.*.*
|
||||
timer_type: summary
|
||||
labels:
|
||||
name: "foo"
|
||||
`,
|
||||
mappings: map[string]map[string]string{
|
||||
"test.*.*": map[string]string{
|
||||
"name": "foo",
|
||||
},
|
||||
},
|
||||
},
|
||||
// Config with bad timer type.
|
||||
{
|
||||
config: `---
|
||||
mappings:
|
||||
- match: test.*.*
|
||||
timer_type: wrong
|
||||
labels:
|
||||
name: "foo"
|
||||
`,
|
||||
configBad: true,
|
||||
},
|
||||
}
|
||||
|
||||
mapper := metricMapper{}
|
||||
|
|
Loading…
Reference in a new issue