Skip to content

Commit

Permalink
Merge pull request #104 from linkernetworks/phstsai/pciID
Browse files Browse the repository at this point in the history
DEV: Add pci id column
  • Loading branch information
Hung-Wei Chiu authored Jul 16, 2018
2 parents 816c364 + afc940e commit 1b9319b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/entity/metrics_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ type NICMetrics struct {
Default string `json:"default"`
Type string `json:"type"`
IP string `json:"ip"`
PCIID string `json:"pciID"`
NICNetworkTraffic NICNetworkTrafficMetrics `json:"nicNetworkTraffic"`
}

type NICOverviewMetrics struct {
Name string `json:"name"`
Default string `json:"default"`
Type string `json:"type"`
PCIID string `json:"pciID"`
}

type NodeResourceMetrics struct {
Expand Down
2 changes: 2 additions & 0 deletions src/prometheuscontroller/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func ListNodeNICs(sp *serviceprovider.Container, id string) (entity.NodeNICsMetr
nic.Name = string(result.Metric["device"])
nic.Default = string(result.Metric["default"])
nic.Type = string(result.Metric["type"])
nic.PCIID = string(result.Metric["pci_id"])
nicList.NICs = append(nicList.NICs, nic)
}

Expand Down Expand Up @@ -358,6 +359,7 @@ func GetNode(sp *serviceprovider.Container, id string) (entity.NodeMetrics, erro
nic.Default = string(result.Metric["default"])
nic.Type = string(result.Metric["type"])
nic.IP = string(result.Metric["ip_address"])
nic.PCIID = string(result.Metric["pci_id"])
nic.NICNetworkTraffic = entity.NICNetworkTrafficMetrics{}
node.NICs[string(result.Metric["device"])] = nic

Expand Down

0 comments on commit 1b9319b

Please sign in to comment.