Kapacitor input plugin (#2031)

This commit is contained in:
Ross McDonald
2017-04-27 13:47:22 -05:00
committed by Daniel Nelson
parent e1a734c525
commit a3feacbd2f
7 changed files with 537 additions and 1 deletions

View File

@@ -299,6 +299,22 @@ func (a *Accumulator) HasTimestamp(measurement string, timestamp time.Time) bool
return false
}
// HasField returns true if the given measurement has a field with the given
// name
func (a *Accumulator) HasField(measurement string, field string) bool {
a.Lock()
defer a.Unlock()
for _, p := range a.Metrics {
if p.Measurement == measurement {
if _, ok := p.Fields[field]; ok {
return true
}
}
}
return false
}
// HasIntField returns true if the measurement has an Int value
func (a *Accumulator) HasIntField(measurement string, field string) bool {
a.Lock()