Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix string name #245

Merged
merged 2 commits into from
Oct 11, 2024
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
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
Loading