Skip to content

Commit d42bb0e

Browse files
authored
Fix legacy envoy benchmark test and add openmetrics benchmark (#24080)
* Fix envoy bench test and add openmetrics benchmark * setup check with dd_run_check * fix license
1 parent dd81b1c commit d42bb0e

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

envoy/tests/legacy/test_bench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def test_fixture(benchmark, fixture_path, mock_http_response):
2424
instance = INSTANCES['main']
2525
c = Envoy('envoy', {}, [instance])
2626

27-
mock_http_response(file_path=fixture_path('multiple_services'))
27+
mock_http_response(file_path=fixture_path('legacy/multiple_services'))
2828

2929
# Run once to get logging of unknown metrics out of the way.
3030
c.check(instance)

envoy/tests/test_bench.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# (C) Datadog, Inc. 2026-present
2+
# All rights reserved
3+
# Licensed under a 3-clause BSD style license (see LICENSE)
4+
5+
from datadog_checks.envoy import Envoy
6+
7+
from .common import DEFAULT_INSTANCE, get_fixture_path
8+
9+
OPENMETRICS_FIXTURE = get_fixture_path('./openmetrics/openmetrics.txt')
10+
11+
12+
def test_openmetrics_check(benchmark, dd_run_check, mock_http_response):
13+
mock_http_response(file_path=OPENMETRICS_FIXTURE)
14+
15+
c = Envoy('envoy', {}, [DEFAULT_INSTANCE])
16+
dd_run_check(c)
17+
18+
benchmark(c.check, DEFAULT_INSTANCE)

0 commit comments

Comments
 (0)