diff --git a/tests/core/sinks/test_validation.py b/tests/core/sinks/test_validation.py index 5a0776a0b..c0d0553cc 100644 --- a/tests/core/sinks/test_validation.py +++ b/tests/core/sinks/test_validation.py @@ -99,3 +99,16 @@ def run_validate_and_parse(): _ = sink._validate_and_parse(record.copy()) benchmark(run_validate_and_parse) + + +def test_bench_validate_record_with_schema(benchmark, bench_sink, bench_record): + """Run benchmark for Sink._validator method validate.""" + number_of_runs = 1000 + + sink: BatchSinkMock = bench_sink + + def run_validate_record_with_schema(): + for record in itertools.repeat(bench_record, number_of_runs): + sink._validator.validate(record) + + benchmark(run_validate_record_with_schema)