fix postgresql 'name', and 'oid' data types by switching to a driver
that handles them properly
This commit is contained in:
committed by
James Lawrence
parent
1989a5855d
commit
bccef14fbf
@@ -188,7 +188,7 @@ func (a *Accumulator) AssertContainsFields(
|
||||
assert.Fail(t, msg)
|
||||
}
|
||||
|
||||
// HasIntValue returns true if the measurement has an Int value
|
||||
// HasIntField returns true if the measurement has an Int value
|
||||
func (a *Accumulator) HasIntField(measurement string, field string) bool {
|
||||
a.Lock()
|
||||
defer a.Unlock()
|
||||
@@ -206,6 +206,42 @@ func (a *Accumulator) HasIntField(measurement string, field string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// HasInt32Field returns true if the measurement has an Int value
|
||||
func (a *Accumulator) HasInt32Field(measurement string, field string) bool {
|
||||
a.Lock()
|
||||
defer a.Unlock()
|
||||
for _, p := range a.Metrics {
|
||||
if p.Measurement == measurement {
|
||||
for fieldname, value := range p.Fields {
|
||||
if fieldname == field {
|
||||
_, ok := value.(int32)
|
||||
return ok
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// HasStringField returns true if the measurement has an Int value
|
||||
func (a *Accumulator) HasStringField(measurement string, field string) bool {
|
||||
a.Lock()
|
||||
defer a.Unlock()
|
||||
for _, p := range a.Metrics {
|
||||
if p.Measurement == measurement {
|
||||
for fieldname, value := range p.Fields {
|
||||
if fieldname == field {
|
||||
_, ok := value.(string)
|
||||
return ok
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
// HasUIntValue returns true if the measurement has a UInt value
|
||||
func (a *Accumulator) HasUIntField(measurement string, field string) bool {
|
||||
a.Lock()
|
||||
|
||||
Reference in New Issue
Block a user