Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
Merge pull request #28 from miracum/chgl-patch-1
Browse files Browse the repository at this point in the history
fix(metrics): added sub-second buckets
  • Loading branch information
chgl authored Jul 28, 2021
2 parents 3280b33 + 1175a85 commit 8634941
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions ahd2fhir/utils/resource_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from fhir.resources.reference import Reference
from fhir.resources.resource import Resource
from prometheus_client import Counter, Histogram, Summary
from tenacity import stop, wait
from tenacity.after import after_log

from ahd2fhir.mappers import ahd_to_condition, ahd_to_medication_statement
Expand All @@ -31,18 +30,18 @@
"map_duration_seconds",
"Time spent mapping",
buckets=(
0.05,
0.1,
0.5,
1.0,
2.0,
3.0,
5.0,
8.0,
13.0,
21.0,
34.0,
55.0,
89.0,
144.0,
233.0,
377.0,
"inf",
),
)
Expand Down Expand Up @@ -315,8 +314,9 @@ def _extract_text_from_resource(
)

@tenacity.retry(
stop=stop.stop_after_attempt(10),
wait=wait.wait_fixed(5) + wait.wait_random_exponential(multiplier=1, max=30),
stop=tenacity.stop.stop_after_attempt(10),
wait=tenacity.wait.wait_fixed(5)
+ tenacity.wait.wait_random_exponential(multiplier=1, max=30),
after=after_log(logging.getLogger(), logging.WARNING),
reraise=True,
)
Expand Down

0 comments on commit 8634941

Please sign in to comment.