Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ func (k *VMwareProjectCommitmentsKPI) Init(dbConn *db.DB, c client.Client, opts
}

k.unusedGeneralPurposeCommitmentsPerProject = prometheus.NewDesc(
"cortex_vmware_commitments_general_purpose",
"cortex_vmware_unused_commitments_general_purpose",
"Committed general purpose resources that are currently unused. CPU (resource=cpu) in vCPUs, memory (resource=ram) in bytes.",
[]string{"availability_zone", "resource", "project_id", "project_name", "domain_id", "domain_name"}, nil,
)
k.unusedHanaCommittedResourcesPerProject = prometheus.NewDesc(
"cortex_vmware_commitments_hana_resources",
"cortex_vmware_unused_commitments_hana_resources",
"Total committed HANA instances capacity that is currently unused, translated to resources. CPU in vCPUs, memory and disk in bytes.",
[]string{"availability_zone", "cpu_architecture", "resource", "project_id", "project_name", "domain_id", "domain_name"}, nil,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ func collectProjectCommitmentsMetrics(t *testing.T, testDB *db.DB) map[string]fl
// gpKey builds the expected map key for a general-purpose metric.
// cpu_architecture is always empty because the GP metric descriptor omits that label.
func gpKey(az, resource string, p projectWithDomain) string {
return "cortex_vmware_commitments_general_purpose|" + az + "||" + resource + "|" + p.ProjectID + "|" + p.ProjectName + "|" + p.DomainID + "|" + p.DomainName
return "cortex_vmware_unused_commitments_general_purpose|" + az + "||" + resource + "|" + p.ProjectID + "|" + p.ProjectName + "|" + p.DomainID + "|" + p.DomainName
}

// hKey builds the expected map key for a HANA metric.
func hKey(az, cpuArch, resource string, p projectWithDomain) string {
return "cortex_vmware_commitments_hana_resources|" + az + "|" + cpuArch + "|" + resource + "|" + p.ProjectID + "|" + p.ProjectName + "|" + p.DomainID + "|" + p.DomainName
return "cortex_vmware_unused_commitments_hana_resources|" + az + "|" + cpuArch + "|" + resource + "|" + p.ProjectID + "|" + p.ProjectName + "|" + p.DomainID + "|" + p.DomainName
}

func TestVMwareProjectCommitmentsKPI_Init(t *testing.T) {
Expand Down
Loading