Skip to content

Commit

Permalink
Merge pull request #245 from metno/fix_string_name
Browse files Browse the repository at this point in the history
fix string name
  • Loading branch information
magnarem authored Oct 11, 2024
2 parents 0e2ec83 + 8722cb1 commit e95bbee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dmci/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])


Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions tests/test_api/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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"}
Expand All @@ -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"}
Expand Down

0 comments on commit e95bbee

Please sign in to comment.