Skip to content

Commit f382031

Browse files
author
Meshwa Savalia
committed
Minor fix
1 parent 68eb153 commit f382031

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

aws_embedded_metrics/validator.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,9 @@ def validate_metric(name: str, value: float, unit: Optional[str], storageResolut
8787
if storageResolution is None or storageResolution not in StorageResolution:
8888
raise InvalidMetricError(f"Metric storage Resolution is not valid: {storageResolution}")
8989

90-
if metricNameAndResolutionMap and name in metricNameAndResolutionMap:
91-
if if metricNameAndResolutionMap and name in metricNameAndResolutionMap and metricNameAndResolutionMap.get(name) is not storageResolution :
92-
raise InvalidMetricError(
93-
"Resolution for metrics ${name} is already set. A single log event cannot have a metric with two different resolutions.")
90+
if metricNameAndResolutionMap and name in metricNameAndResolutionMap and metricNameAndResolutionMap.get(name) is not storageResolution:
91+
raise InvalidMetricError(
92+
"Resolution for metrics ${name} is already set. A single log event cannot have a metric with two different resolutions.")
9493

9594

9695
def validate_namespace(namespace: str) -> None:

tests/integ/agent/test_end_to_end.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def test_end_to_end_tcp_multiple_flushes():
4141
@metric_scope
4242
async def do_work(metrics):
4343
metrics.put_dimensions({"Operation": "Agent"})
44-
metrics.put_metric(metric_name, 100, "Milliseconds", StorageResolution.HIGH)
44+
metrics.put_metric(metric_name, 100, "Milliseconds")
4545
metrics.set_property("RequestId", "422b1569-16f6-4a03-b8f0-fe3fd9b100f8")
4646

4747
# act
@@ -71,7 +71,7 @@ async def test_end_to_end_udp():
7171
@metric_scope
7272
async def do_work(metrics):
7373
metrics.put_dimensions({"Operation": "Agent"})
74-
metrics.put_metric(metric_name, 100, "Milliseconds", StorageResolution.HIGH)
74+
metrics.put_metric(metric_name, 100, "Milliseconds")
7575
metrics.set_property("RequestId", "422b1569-16f6-4a03-b8f0-fe3fd9b100f8")
7676

7777
# act

0 commit comments

Comments
 (0)