diff --git a/perfkitbenchmarker/data/relational_db_configs/sqlserver_ha_configs/uninstall_sql_server.ps1 b/perfkitbenchmarker/data/relational_db_configs/sqlserver_ha_configs/uninstall_sql_server.ps1 index fee72388ae..6f7566f12f 100644 --- a/perfkitbenchmarker/data/relational_db_configs/sqlserver_ha_configs/uninstall_sql_server.ps1 +++ b/perfkitbenchmarker/data/relational_db_configs/sqlserver_ha_configs/uninstall_sql_server.ps1 @@ -22,3 +22,10 @@ $sql_install_file = (Get-SqlInstallSourceDirectory) + 'Setup.exe' Write-Host $sql_install_file & $sql_install_file $parameters + +# Uninstall OLE drivers +Get-Package -Name 'Microsoft OLE*' | Uninstall-Package -Force + +# Uninstall ODBC drivers +Get-Package -Name 'Microsoft ODBC*' | Uninstall-Package -Force + diff --git a/perfkitbenchmarker/linux_packages/ycsb.py b/perfkitbenchmarker/linux_packages/ycsb.py index 86975baeb6..916a5a25a2 100644 --- a/perfkitbenchmarker/linux_packages/ycsb.py +++ b/perfkitbenchmarker/linux_packages/ycsb.py @@ -37,7 +37,6 @@ from collections.abc import Mapping, Sequence import copy -import dataclasses import datetime import io import logging @@ -1341,25 +1340,6 @@ def _RunLowestLatencyMode( Returns: A list of samples of benchmark results. """ - - @dataclasses.dataclass - class _ThroughputLatencyResult: - throughput: int = 0 - read_latency: float = float('inf') - update_latency: float = float('inf') - samples: list[sample.Sample] = dataclasses.field(default_factory=list) - - def _PrintDebugLog(result: _ThroughputLatencyResult) -> None: - logging.info( - 'Run had throughput %s ops/s, read %s latency %s ms, update %s' - ' latency %s ms', - result.throughput, - _LOWEST_LATENCY_PERCENTILE, - result.read_latency, - _LOWEST_LATENCY_PERCENTILE, - result.update_latency, - ) - def _RunWorkload(target_qps: int) -> list[sample.Sample]: """Runs the workload at the target throughput.""" run_params = _GetRunParameters() @@ -1370,23 +1350,6 @@ def _RunWorkload(target_qps: int) -> list[sample.Sample]: self._SetRunParameters(run_params) return self.RunStaircaseLoads([vms[0]], workloads, **run_kwargs) - def _ExtractStats(samples: list[sample.Sample]) -> _ThroughputLatencyResult: - """Returns the throughput and latency recorded in the samples.""" - throughput, read_latency, update_latency = 0, 0, 0 - for result in samples: - if result.metric == 'overall Throughput': - throughput = result.value - elif result.metric == f'read {_LOWEST_LATENCY_PERCENTILE} latency': - read_latency = result.value - elif result.metric == f'update {_LOWEST_LATENCY_PERCENTILE} latency': - update_latency = result.value - return _ThroughputLatencyResult( - throughput=int(throughput), - read_latency=read_latency, - update_latency=update_latency, - samples=samples, - ) - def _ProcessSamples( samples: list[sample.Sample], database: resource.BaseResource ) -> list[sample.Sample]: @@ -1431,11 +1394,11 @@ def _ProcessSamples( target = _LOWEST_LATENCY_STARTING_QPS min_read_latency = float('inf') min_update_latency = float('inf') - prev_result = _ThroughputLatencyResult() + prev_result = ycsb_stats.ThroughputLatencyResult() while True: samples = _RunWorkload(target) - result = _ExtractStats(samples) - _PrintDebugLog(result) + result = ycsb_stats.ExtractStats(samples, _LOWEST_LATENCY_PERCENTILE) + logging.info('Run stats: %s', result) if ( result.read_latency > min_read_latency + _LOWEST_LATENCY_BUFFER or result.update_latency > min_update_latency + _LOWEST_LATENCY_BUFFER diff --git a/perfkitbenchmarker/linux_packages/ycsb_stats.py b/perfkitbenchmarker/linux_packages/ycsb_stats.py index 96ade648d2..24d9b5b5bb 100644 --- a/perfkitbenchmarker/linux_packages/ycsb_stats.py +++ b/perfkitbenchmarker/linux_packages/ycsb_stats.py @@ -1102,3 +1102,42 @@ def CreateSamples( '', {'latency_time_series': group.data}, ) + + +@dataclasses.dataclass +class ThroughputLatencyResult: + """Post-processing helper class for YCSB datapoints.""" + + throughput: int = 0 + percentile: str = '' + read_latency: float = float('inf') + update_latency: float = float('inf') + samples: list[sample.Sample] = dataclasses.field(default_factory=list) + + def __str__(self) -> str: + return ( + f'({self.throughput} ops/s, ' + f'{self.percentile} read latency: {self.read_latency}, ' + f'{self.percentile} update latency: {self.update_latency})' + ) + + +def ExtractStats( + samples: list[sample.Sample], percentile: str +) -> ThroughputLatencyResult: + """Returns the throughput and latency recorded in the samples.""" + throughput, read_latency, update_latency = 0, 0, 0 + for result in samples: + if result.metric == 'overall Throughput': + throughput = result.value + elif result.metric == f'read {percentile} latency': + read_latency = result.value + elif result.metric == f'update {percentile} latency': + update_latency = result.value + return ThroughputLatencyResult( + throughput=int(throughput), + percentile=percentile, + read_latency=read_latency, + update_latency=update_latency, + samples=samples, + ) diff --git a/tests/linux_packages/ycsb_test.py b/tests/linux_packages/ycsb_test.py index e7b4b4dd0b..41afd9fb09 100644 --- a/tests/linux_packages/ycsb_test.py +++ b/tests/linux_packages/ycsb_test.py @@ -260,16 +260,18 @@ def _GetMockThroughputSamples(throughputs): return result -def _GetMockThroughputLatencySamples(throughput, read_latency, update_latency): +def _GetMockThroughputLatencySamples( + throughput, read_latency, update_latency, percentile='p95' +): return [ sample.Sample('overall Throughput', value=throughput, unit='ops/sec'), sample.Sample( - f'read {ycsb._LOWEST_LATENCY_PERCENTILE} latency', + f'read {percentile} latency', value=read_latency, unit='ms', ), sample.Sample( - f'update {ycsb._LOWEST_LATENCY_PERCENTILE} latency', + f'update {percentile} latency', value=update_latency, unit='ms', ),