From a283994aaac39124fce45706fb00505399281e5a Mon Sep 17 00:00:00 2001 From: charlien Date: Fri, 11 Oct 2024 10:58:10 +0200 Subject: [PATCH 1/2] fix string name --- dmci/api/app.py | 4 ++-- tests/test_api/test_app.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dmci/api/app.py b/dmci/api/app.py index 929b014..d5f800e 100644 --- a/dmci/api/app.py +++ b/dmci/api/app.py @@ -76,7 +76,7 @@ def post_insert(): if failed: if "file" in failed: FILE_DIST_FAIL.labels(path=request.path).inc() - if "csw" in failed: + if "pycsw" in failed: CSW_DIST_FAIL.labels(path=request.path).inc() if "solr" in failed: SOLR_DIST_FAIL.labels(path=request.path).inc() @@ -89,7 +89,7 @@ def post_update(): if failed: if "file" in failed: FILE_DIST_FAIL.labels(path=request.path).inc() - if "csw" in failed: + if "pycsw" in failed: CSW_DIST_FAIL.labels(path=request.path).inc() if "solr" in failed: SOLR_DIST_FAIL.labels(path=request.path).inc() diff --git a/tests/test_api/test_app.py b/tests/test_api/test_app.py index 67e1131..1ca06ab 100644 --- a/tests/test_api/test_app.py +++ b/tests/test_api/test_app.py @@ -227,7 +227,7 @@ def testApiApp_InsertUpdateRequests(client, monkeypatch): # Distribution fails, metrics are incremented with monkeypatch.context() as mp: - f = ["file", "solr", "csw"] + f = ["file", "solr", "pycsw"] s = ["C"] e = ["Reason A", "Reason B", "Reason C"] mp.setattr("dmci.api.app.Worker.validate", lambda *a: (True, "", MOCK_XML)) From 8722cb1862f6dffd7ac302e348a63850649d07c5 Mon Sep 17 00:00:00 2001 From: charlien Date: Fri, 11 Oct 2024 11:01:40 +0200 Subject: [PATCH 2/2] change metrics name for coherence --- dmci/api/app.py | 2 +- tests/test_api/test_app.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dmci/api/app.py b/dmci/api/app.py index d5f800e..2e76a0c 100644 --- a/dmci/api/app.py +++ b/dmci/api/app.py @@ -35,7 +35,7 @@ OK_RETURN = "Everything is OK" FILE_DIST_FAIL = Counter("failed_file_dist", "Number of failed file_dist", ["path"]) -CSW_DIST_FAIL = Counter("failed_csw_dist", "Number of failed csw_dist", ["path"]) +CSW_DIST_FAIL = Counter("failed_pycsw_dist", "Number of failed csw_dist", ["path"]) SOLR_DIST_FAIL = Counter("failed_solr_dist", "Number of failed solr_dist", ["path"]) diff --git a/tests/test_api/test_app.py b/tests/test_api/test_app.py index 1ca06ab..56ce727 100644 --- a/tests/test_api/test_app.py +++ b/tests/test_api/test_app.py @@ -240,7 +240,7 @@ def testApiApp_InsertUpdateRequests(client, monkeypatch): "failed_file_dist_total", {"path": "/v1/insert"} ) after_csw = REGISTRY.get_sample_value( - "failed_csw_dist_total", {"path": "/v1/insert"} + "failed_pycsw_dist_total", {"path": "/v1/insert"} ) after_solr = REGISTRY.get_sample_value( "failed_solr_dist_total", {"path": "/v1/insert"} @@ -254,7 +254,7 @@ def testApiApp_InsertUpdateRequests(client, monkeypatch): "failed_file_dist_total", {"path": "/v1/update"} ) after_csw = REGISTRY.get_sample_value( - "failed_csw_dist_total", {"path": "/v1/update"} + "failed_pycsw_dist_total", {"path": "/v1/update"} ) after_solr = REGISTRY.get_sample_value( "failed_solr_dist_total", {"path": "/v1/update"}