mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-22 10:15:35 +01:00
Merge pull request #14117 from ninjadq/fix_quota_metric_name
Chagne quota usage metric name
This commit is contained in:
commit
6d78189dff
@ -41,7 +41,7 @@ var (
|
||||
valueType: prometheus.GaugeValue,
|
||||
}
|
||||
projectUsage = typedDesc{
|
||||
desc: newDescWithLables("", "project_usage_byte", "The used resource of a project", "project_name"),
|
||||
desc: newDescWithLables("", "project_quota_usage_byte", "The used resource of a project", "project_name"),
|
||||
valueType: prometheus.GaugeValue,
|
||||
}
|
||||
projectQuote = typedDesc{
|
||||
|
@ -9,14 +9,13 @@ import testutils
|
||||
class TestMetricsExist(unittest.TestCase):
|
||||
golang_basic_metrics = ["go_gc_duration_seconds", "go_goroutines", "go_info", "go_memstats_alloc_bytes"]
|
||||
|
||||
eigen_metrics = {
|
||||
metrics = {
|
||||
'core': golang_basic_metrics + ["harbor_core_http_request_total", "harbor_core_http_request_duration_seconds",
|
||||
"harbor_core_http_inflight_requests"],
|
||||
'registry': golang_basic_metrics + ["registry_http_in_flight_requests"],
|
||||
'exporter': golang_basic_metrics + ["artifact_pulled",
|
||||
"harbor_project_artifact_total", "harbor_project_member_total", "harbor_project_quota_byte",
|
||||
"harbor_project_repo_total", "harbor_project_total"
|
||||
]
|
||||
"harbor_project_repo_total", "harbor_project_total", "project_quota_usage_byte"]
|
||||
}
|
||||
|
||||
def get_metrics(self):
|
||||
@ -28,7 +27,7 @@ class TestMetricsExist(unittest.TestCase):
|
||||
|
||||
def testMetricsExist(self):
|
||||
for k, metric_text in self.get_metrics():
|
||||
for metric_name in self.eigen_metrics[k]:
|
||||
for metric_name in self.metrics[k]:
|
||||
print("Metric {} should exist in {} ".format(metric_name, k))
|
||||
self.assertTrue(metric_name in metric_text)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user