File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import pytest
8
8
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
+
9
14
10
15
@contextmanager
11
16
def timing () -> Generator :
@@ -42,8 +47,8 @@ def test_import_times_ceiling():
42
47
core_utilities ()
43
48
44
49
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 } " )
47
52
48
53
49
54
@pytest .mark .perf
@@ -58,8 +63,8 @@ def test_tracer_init():
58
63
tracing .Tracer (disabled = True ) # boto3 takes ~200ms, and remaining is X-Ray SDK init
59
64
60
65
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 } " )
63
68
64
69
65
70
@pytest .mark .perf
@@ -72,7 +77,7 @@ def test_metrics_init():
72
77
metrics .Metrics ()
73
78
74
79
elapsed = t ()
75
- if elapsed > 0.005 :
80
+ if elapsed > METRICS_INIT_SLA :
76
81
pytest .fail (f"High level imports should be below 40ms: { elapsed } " )
77
82
78
83
@@ -86,5 +91,5 @@ def test_logger_init():
86
91
logging .Logger ()
87
92
88
93
elapsed = t ()
89
- if elapsed > 0.001 :
94
+ if elapsed > LOGGER_INIT_SLA :
90
95
pytest .fail (f"High level imports should be below 40ms: { elapsed } " )
You can’t perform that action at this time.
0 commit comments