fix(database/influxdb*): add type to link
This commit is contained in:
parent
2015fdd668
commit
da87a8e2de
|
@ -14,6 +14,7 @@ func (conn *Connection) InsertLink(link *runtime.Link, t time.Time) {
|
||||||
tags.SetString("source.addr", link.SourceAddress)
|
tags.SetString("source.addr", link.SourceAddress)
|
||||||
tags.SetString("target.id", link.TargetID)
|
tags.SetString("target.id", link.TargetID)
|
||||||
tags.SetString("target.addr", link.TargetAddress)
|
tags.SetString("target.addr", link.TargetAddress)
|
||||||
|
tags.SetString("type", link.Type.String())
|
||||||
if link.SourceHostname != "" {
|
if link.SourceHostname != "" {
|
||||||
tags.SetString("source.hostname", link.SourceHostname)
|
tags.SetString("source.hostname", link.SourceHostname)
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,6 +187,7 @@ func TestToInflux(t *testing.T) {
|
||||||
"source.addr": "a-interface-mac",
|
"source.addr": "a-interface-mac",
|
||||||
"target.id": "foobar",
|
"target.id": "foobar",
|
||||||
"target.addr": "BAFF1E5",
|
"target.addr": "BAFF1E5",
|
||||||
|
"type": "vpn",
|
||||||
}, tags)
|
}, tags)
|
||||||
assert.EqualValues(80, fields["tq"])
|
assert.EqualValues(80, fields["tq"])
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,8 @@ func (conn *Connection) InsertLink(link *runtime.Link, t time.Time) {
|
||||||
AddTag("source.id", link.SourceID).
|
AddTag("source.id", link.SourceID).
|
||||||
AddTag("source.addr", link.SourceAddress).
|
AddTag("source.addr", link.SourceAddress).
|
||||||
AddTag("target.id", link.TargetID).
|
AddTag("target.id", link.TargetID).
|
||||||
AddTag("target.addr", link.TargetAddress)
|
AddTag("target.addr", link.TargetAddress).
|
||||||
|
AddTag("type", link.Type.String())
|
||||||
if link.SourceHostname != "" {
|
if link.SourceHostname != "" {
|
||||||
p.AddTag("source.hostname", link.SourceHostname)
|
p.AddTag("source.hostname", link.SourceHostname)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue