Skip to content

Commit b82b36e

Browse files
committed
fix benchmarks
1 parent edb6353 commit b82b36e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

benchmarks/benchmark_plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,6 @@ def init_host_provider(
8787

8888

8989
class BenchmarkPluginFactory(PluginFactory):
90-
def get_instance(self, plugin_service: PluginService, props: Properties) -> Plugin:
90+
@staticmethod
91+
def get_instance(plugin_service: PluginService, props: Properties) -> Plugin:
9192
return BenchmarkPlugin()

benchmarks/plugin_manager_benchmarks.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@
2525
from aws_advanced_python_wrapper.driver_configuration_profiles import \
2626
DriverConfigurationProfiles
2727
from aws_advanced_python_wrapper.hostinfo import HostInfo
28+
from aws_advanced_python_wrapper.pep249_methods import DbApiMethod
2829
from aws_advanced_python_wrapper.plugin_service import (
2930
PluginManager, PluginServiceManagerContainer)
3031
from aws_advanced_python_wrapper.utils.properties import Properties
32+
from aws_advanced_python_wrapper.utils.telemetry.null_telemetry import \
33+
NullTelemetryFactory
3134
from benchmarks.benchmark_plugin import BenchmarkPluginFactory
3235

3336
host_info = HostInfo(host="host", port=1234)
@@ -76,18 +79,18 @@ def plugin_service_manager_container_mock(mocker, plugin_service_mock):
7679

7780
@pytest.fixture
7881
def plugin_manager_with_no_plugins(plugin_service_manager_container_mock, props_without_plugins):
79-
manager = PluginManager(plugin_service_manager_container_mock, props_without_plugins)
82+
manager = PluginManager(plugin_service_manager_container_mock, props_without_plugins, NullTelemetryFactory())
8083
return manager
8184

8285

8386
@pytest.fixture
8487
def plugin_manager_with_plugins(plugin_service_manager_container_mock, props_with_plugins):
85-
manager = PluginManager(plugin_service_manager_container_mock, props_with_plugins)
88+
manager = PluginManager(plugin_service_manager_container_mock, props_with_plugins, NullTelemetryFactory())
8689
return manager
8790

8891

8992
def init_plugin_manager(plugin_service_manager_container, props):
90-
manager = PluginManager(plugin_service_manager_container, props)
93+
manager = PluginManager(plugin_service_manager_container, props, NullTelemetryFactory())
9194
return manager
9295

9396

@@ -121,7 +124,7 @@ def test_connect_with_plugins(benchmark, mocker, plugin_manager_with_plugins, pr
121124

122125

123126
def execute(mocker, plugin_manager, statement):
124-
result = plugin_manager.execute(mocker.MagicMock(), "Statement.execute", statement)
127+
result = plugin_manager.execute(mocker.MagicMock(), DbApiMethod.CURSOR_EXECUTE, statement)
125128
return result
126129

127130

0 commit comments

Comments
 (0)