Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Add pci id column #104

Merged
merged 1 commit into from
Jul 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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