Add support for using globs in devices list of diskio input plugin (#3687)

This commit is contained in:
Daniel Nelson
2018-01-17 15:12:05 -08:00
committed by GitHub
parent fa5f1bf6d9
commit 822cfbc8e8
10 changed files with 497 additions and 359 deletions

View File

@@ -537,6 +537,24 @@ func (a *Accumulator) Int64Field(measurement string, field string) (int64, bool)
return 0, false
}
// Uint64Field returns the int64 value of the given measurement and field or false.
func (a *Accumulator) Uint64Field(measurement string, field string) (uint64, bool) {
a.Lock()
defer a.Unlock()
for _, p := range a.Metrics {
if p.Measurement == measurement {
for fieldname, value := range p.Fields {
if fieldname == field {
v, ok := value.(uint64)
return v, ok
}
}
}
}
return 0, false
}
// Int32Field returns the int32 value of the given measurement and field or false.
func (a *Accumulator) Int32Field(measurement string, field string) (int32, bool) {
a.Lock()