mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-29 05:35:43 +01:00
Chagne quota usage metric name
from `harbor_project_usage_byte` to `harbor_project_quota_usage_byte` Signed-off-by: DQ <dengq@vmware.com>
This commit is contained in:
parent
3ba0d5a590
commit
eb5e31a442
@ -41,7 +41,7 @@ var (
|
|||||||
valueType: prometheus.GaugeValue,
|
valueType: prometheus.GaugeValue,
|
||||||
}
|
}
|
||||||
projectUsage = typedDesc{
|
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,
|
valueType: prometheus.GaugeValue,
|
||||||
}
|
}
|
||||||
projectQuote = typedDesc{
|
projectQuote = typedDesc{
|
||||||
|
@ -9,14 +9,13 @@ import testutils
|
|||||||
class TestMetricsExist(unittest.TestCase):
|
class TestMetricsExist(unittest.TestCase):
|
||||||
golang_basic_metrics = ["go_gc_duration_seconds", "go_goroutines", "go_info", "go_memstats_alloc_bytes"]
|
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",
|
'core': golang_basic_metrics + ["harbor_core_http_request_total", "harbor_core_http_request_duration_seconds",
|
||||||
"harbor_core_http_inflight_requests"],
|
"harbor_core_http_inflight_requests"],
|
||||||
'registry': golang_basic_metrics + ["registry_http_in_flight_requests"],
|
'registry': golang_basic_metrics + ["registry_http_in_flight_requests"],
|
||||||
'exporter': golang_basic_metrics + ["artifact_pulled",
|
'exporter': golang_basic_metrics + ["artifact_pulled",
|
||||||
"harbor_project_artifact_total", "harbor_project_member_total", "harbor_project_quota_byte",
|
"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):
|
def get_metrics(self):
|
||||||
@ -28,7 +27,7 @@ class TestMetricsExist(unittest.TestCase):
|
|||||||
|
|
||||||
def testMetricsExist(self):
|
def testMetricsExist(self):
|
||||||
for k, metric_text in self.get_metrics():
|
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))
|
print("Metric {} should exist in {} ".format(metric_name, k))
|
||||||
self.assertTrue(metric_name in metric_text)
|
self.assertTrue(metric_name in metric_text)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user