Skip to content

Commit 538af2a

Browse files
committed
chore: address PR's review
1 parent 33518ba commit 538af2a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

tests/performance/test_high_level_imports.py

+11-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66

77
import pytest
88

9+
LOGGER_INIT_SLA: float = 0.001
10+
METRICS_INIT_SLA: float = 0.005
11+
TRACER_INIT_SLA: float = 0.5
12+
IMPORT_INIT_SLA: float = 0.035
13+
914

1015
@contextmanager
1116
def timing() -> Generator:
@@ -42,8 +47,8 @@ def test_import_times_ceiling():
4247
core_utilities()
4348

4449
elapsed = t()
45-
if elapsed > 0.035:
46-
pytest.fail(f"High level imports should be below 40ms: {elapsed}")
50+
if elapsed > IMPORT_INIT_SLA:
51+
pytest.fail(f"High level imports should be below 35ms: {elapsed}")
4752

4853

4954
@pytest.mark.perf
@@ -58,8 +63,8 @@ def test_tracer_init():
5863
tracing.Tracer(disabled=True) # boto3 takes ~200ms, and remaining is X-Ray SDK init
5964

6065
elapsed = t()
61-
if elapsed > 0.5:
62-
pytest.fail(f"High level imports should be below 40ms: {elapsed}")
66+
if elapsed > TRACER_INIT_SLA:
67+
pytest.fail(f"High level imports should be below 50ms: {elapsed}")
6368

6469

6570
@pytest.mark.perf
@@ -72,7 +77,7 @@ def test_metrics_init():
7277
metrics.Metrics()
7378

7479
elapsed = t()
75-
if elapsed > 0.005:
80+
if elapsed > METRICS_INIT_SLA:
7681
pytest.fail(f"High level imports should be below 40ms: {elapsed}")
7782

7883

@@ -86,5 +91,5 @@ def test_logger_init():
8691
logging.Logger()
8792

8893
elapsed = t()
89-
if elapsed > 0.001:
94+
if elapsed > LOGGER_INIT_SLA:
9095
pytest.fail(f"High level imports should be below 40ms: {elapsed}")

0 commit comments

Comments
 (0)