code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
def RunClientServerVMs(client_vm, server_vm):
"""Runs a netperf process between client_vm and server_vm.
Args:
client_vm: The VM that runs the netperf binary.
server_vm: The VM that runs the netserver binary.
Returns:
A list of sample.Sample objects.
"""
logging.info('netperf running on %s', cli... | Runs a netperf process between client_vm and server_vm.
Args:
client_vm: The VM that runs the netperf binary.
server_vm: The VM that runs the netserver binary.
Returns:
A list of sample.Sample objects.
| RunClientServerVMs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | Apache-2.0 |
def CleanupClientServerVMs(client_vm, server_vm):
"""Cleanup netperf on the target vm (by uninstalling).
Args:
client_vm: The VM that runs the netperf binary.
server_vm: The VM that runs the netserver binary.
"""
server_vm.RemoteCommand('sudo killall netserver')
client_vm.RemoteCommand(f'sudo rm -rf ... | Cleanup netperf on the target vm (by uninstalling).
Args:
client_vm: The VM that runs the netperf binary.
server_vm: The VM that runs the netserver binary.
| CleanupClientServerVMs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/netperf_benchmark.py | Apache-2.0 |
def _ValidateLoadConfigs(load_configs):
"""Validate that each load config has all required values."""
if not load_configs:
return False
for config in load_configs:
config_values = config.split(':')
if len(config_values) != 4:
return False
for value in config_values:
if not (value.isdig... | Validate that each load config has all required values. | _ValidateLoadConfigs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | Apache-2.0 |
def _ConfigureNginxForSsl(server):
"""Configures an nginx server for SSL/TLS."""
server.RemoteCommand('sudo mkdir -p /etc/nginx/ssl')
# Enable TLS/SSL with:
# - ECDHE for key exchange
# - ECDSA for authentication
# - AES256-GCM for bulk encryption
# - SHA384 for message authentication
server.RemoteComma... | Configures an nginx server for SSL/TLS. | _ConfigureNginxForSsl | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | Apache-2.0 |
def _ConfigureNginxListeners(vm):
"""Configures the ports from which nginx listens."""
isipv6 = isinstance(
ipaddress.ip_address(vm.internal_ip), ipaddress.IPv6Address
)
if not isipv6:
vm.RemoteCommand(
r"sudo sed -i 's|\(listen \[::\]:80 .*;\)|#\1|g' "
r'/etc/nginx/sites-enabled/defau... | Configures the ports from which nginx listens. | _ConfigureNginxListeners | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | Apache-2.0 |
def _TuneNetworkStack(vm):
"""Tune the network stack to improve throughput.
These settings are based on the recommendations in
https://armkeil.blob.core.windows.net/developer/Files/pdf/white-paper/guidelines-for-deploying-nginx-plus-on-aws.pdf.
Args:
vm: The VM to tune.
"""
if vm.PLATFORM == provider_... | Tune the network stack to improve throughput.
These settings are based on the recommendations in
https://armkeil.blob.core.windows.net/developer/Files/pdf/white-paper/guidelines-for-deploying-nginx-plus-on-aws.pdf.
Args:
vm: The VM to tune.
| _TuneNetworkStack | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install Nginx on the server and a load generator on the clients.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
clients = benchmark_spec.vm_groups['clients']
server = benchmark_spec.vm_groups['server'][... | Install Nginx on the server and a load generator on the clients.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | Apache-2.0 |
def _RunMultiClient(clients, target, rate, connections, duration, threads):
"""Run multiple instances of wrk2 against a single target."""
results = []
num_clients = len(clients)
def _RunSingleClient(client, client_number):
"""Run wrk2 from a single client."""
client_results = list(
wrk2.Run(
... | Run multiple instances of wrk2 against a single target. | _RunMultiClient | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run a benchmark against the Nginx server.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
clients = benchmark_spec.vm_groups['clients']
results = []
scheme ... | Run a benchmark against the Nginx server.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nginx_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install and setup Nvidia HPL benchmark.
Args:
benchmark_spec: The benchmark specification.
"""
vms = benchmark_spec.vms
background_tasks.RunThreaded(_PrepareNvidiaHPL, vms)
slurm.ConfigureSlurm(vms) | Install and setup Nvidia HPL benchmark.
Args:
benchmark_spec: The benchmark specification.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nvidia_hpc_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nvidia_hpc_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs Nvidia HPL benchmark.
Args:
benchmark_spec: The benchmark specification.
Returns:
A list of sample.Sample objects.
"""
samples = []
controller = benchmark_spec.vms[0]
gpus_per_node = FLAGS.hpcg_gpus_per_node or nvidia_driver.QueryNumberOfGpus(
benchmark_spe... | Runs Nvidia HPL benchmark.
Args:
benchmark_spec: The benchmark specification.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nvidia_hpc_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nvidia_hpc_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs Nvidia HPL benchmark.
Sample output:
==============================================================================
T/V N NB P Q Time Gflops ( per GPU)
------------------------------------------------------------------------------
... | Runs Nvidia HPL benchmark.
Sample output:
==============================================================================
T/V N NB P Q Time Gflops ( per GPU)
------------------------------------------------------------------------------
WC0 376832 1024 4... | Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nvidia_hpl_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nvidia_hpl_benchmark.py | Apache-2.0 |
def _UpdateRunScript(vm):
"""Update run.sub script and build the container."""
# TODO(yuyanting) Write a patch file instead and apply here.
# remove last 5 lines related to hang_monitor
vm.RemoteCommand(
f'cd {_GetDir()}; '
'head -n -5 run.sub > run.sub.temp; mv run.sub.temp run.sub'
)
# Use con... | Update run.sub script and build the container. | _UpdateRunScript | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nvidia_mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nvidia_mlperf_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install and setup Nvidia Mlperf benchmark.
Args:
benchmark_spec: The benchmark spec.
"""
# The flags are also used in previous mlperf benchmark
if FLAGS.mlperf_benchmark not in SUPPORTED_BENCHMARKS:
raise ValueError('Unsupported mlperf benchmark')
# Update when 4.0 r... | Install and setup Nvidia Mlperf benchmark.
Args:
benchmark_spec: The benchmark spec.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nvidia_mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nvidia_mlperf_benchmark.py | Apache-2.0 |
def _Run(benchmark_spec, additional_params=''):
"""Run mlperf training with additional parameters to override defaults."""
controller = slurm.GetController(benchmark_spec.vms)
gpus_per_node = nvidia_driver.QueryNumberOfGpus(controller)
num_vms = len(benchmark_spec.vms)
stdout, _ = controller.RemoteCommand(
... | Run mlperf training with additional parameters to override defaults. | _Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/nvidia_mlperf_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/nvidia_mlperf_benchmark.py | Apache-2.0 |
def _GetService() -> object_storage_service.ObjectStorageService: # pytype: disable=not-instantiable
"""Get a ready to use instance of ObjectStorageService."""
# TODO(pclay): consider using FLAGS.storage to allow cross cloud testing?
cloud = FLAGS.cloud
providers.LoadProvider(cloud)
service = object_storage_... | Get a ready to use instance of ObjectStorageService. | _GetService | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_curl_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_curl_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Create and ACL bucket and install curl."""
# We would like to always cleanup server side states when exception happens.
benchmark_spec.always_call_cleanup = True
service = _GetService()
bucket_name = _GetBucketName()
service.MakeBucket(bucket_name)
service.MakeBucketPubli... | Create and ACL bucket and install curl. | Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_curl_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_curl_benchmark.py | Apache-2.0 |
def Run(benchmark_spec) -> List[sample.Sample]:
"""Run storage benchmark and publish results.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
The same samples as object_storage_multistream.
"""
service = _GetService()
bucke... | Run storage benchmark and publish results.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
The same samples as object_storage_multistream.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_curl_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_curl_benchmark.py | Apache-2.0 |
def _JsonStringToPercentileResults(
results, json_input, metric_name, metric_unit, metadata
):
"""This function parses a percentile result string in Json format.
Args:
results: The final result set to put result in.
json_input: The input in Json format about percentiles.
metric_name: Name of the me... | This function parses a percentile result string in Json format.
Args:
results: The final result set to put result in.
json_input: The input in Json format about percentiles.
metric_name: Name of the metric.
metric_unit: Unit of the metric.
metadata: The metadata to be included.
| _JsonStringToPercentileResults | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def _GetClientLibVersion(vm, library_name):
"""This function returns the version of client lib installed on a vm.
Args:
vm: the VM to get the client lib version from.
library_name: the name of the client lib.
Returns:
The version string of the client.
"""
version, _ = vm.RemoteCommand('pip3 show... | This function returns the version of client lib installed on a vm.
Args:
vm: the VM to get the client lib version from.
library_name: the name of the client lib.
Returns:
The version string of the client.
| _GetClientLibVersion | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def MultiThreadStartDelay(num_vms, threads_per_vm):
"""Find how long in the future we can simultaneously start threads on VMs.
Args:
num_vms: number of VMs to start threads on.
threads_per_vm: number of threads to start on each VM.
Returns:
A units.Quantity of time such that if we want to start
... | Find how long in the future we can simultaneously start threads on VMs.
Args:
num_vms: number of VMs to start threads on.
threads_per_vm: number of threads to start on each VM.
Returns:
A units.Quantity of time such that if we want to start
threads_per_vm threads on num_vms VMs, we can start the t... | MultiThreadStartDelay | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def ProcessMultiStreamResults(
start_times, latencies, sizes, operation, all_sizes, results, metadata=None
):
"""Read and process results from the api_multistream worker process.
Results will be reported per-object size and combined for all
objects.
Args:
start_times: a list of numpy arrays. Operation... | Read and process results from the api_multistream worker process.
Results will be reported per-object size and combined for all
objects.
Args:
start_times: a list of numpy arrays. Operation start times, as POSIX
timestamps.
latencies: a list of numpy arrays. Operation durations, in seconds.
si... | ProcessMultiStreamResults | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def _DistributionToBackendFormat(dist):
"""Convert an object size distribution to the format needed by the backend.
Args:
dist: a distribution, given as a dictionary mapping size to frequency. Size
will be a string with a quantity and a unit. Frequency will be a
percentage, including a '%' characte... | Convert an object size distribution to the format needed by the backend.
Args:
dist: a distribution, given as a dictionary mapping size to frequency. Size
will be a string with a quantity and a unit. Frequency will be a
percentage, including a '%' character. dist may also be a string, in which
... | _DistributionToBackendFormat | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def BuildCommand(self, args):
"""Build a command string for the API test script.
Args:
args: a list of strings. These will become space-separated arguments to
the test script.
Returns:
A string that can be passed to vm.RemoteCommand.
"""
cmd_parts = (
[self.test_script... | Build a command string for the API test script.
Args:
args: a list of strings. These will become space-separated arguments to
the test script.
Returns:
A string that can be passed to vm.RemoteCommand.
| BuildCommand | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def OneByteRWBenchmark(
results, metadata, vm, command_builder, service, bucket_name
):
"""A benchmark for small object latency.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vm: the VM to run the benchmark on.
command_builder: an APIScript... | A benchmark for small object latency.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vm: the VM to run the benchmark on.
command_builder: an APIScriptCommandBuilder.
service: an ObjectStorageService.
bucket_name: the primary bucket to benc... | OneByteRWBenchmark | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def SingleStreamThroughputBenchmark(
results, metadata, vm, command_builder, service, bucket_name
):
"""A benchmark for large object throughput.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vm: the VM to run the benchmark on.
command_build... | A benchmark for large object throughput.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vm: the VM to run the benchmark on.
command_builder: an APIScriptCommandBuilder.
service: an ObjectStorageService.
bucket_name: the primary bucket to b... | SingleStreamThroughputBenchmark | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def ListConsistencyBenchmark(
results, metadata, vm, command_builder, service, bucket_name
):
"""A benchmark for bucket list consistency.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vm: the VM to run the benchmark on.
command_builder: an ... | A benchmark for bucket list consistency.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vm: the VM to run the benchmark on.
command_builder: an APIScriptCommandBuilder.
service: an ObjectStorageService.
bucket_name: the primary bucket to b... | ListConsistencyBenchmark | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def _RunMultiStreamProcesses(vms, command_builder, cmd_args, streams_per_vm):
"""Runs all of the multistream read or write processes and doesn't return
until they complete.
Args:
vms: the VMs to run the benchmark on.
command_builder: an APIScriptCommandBuilder.
cmd_args: arguments for the command... | Runs all of the multistream read or write processes and doesn't return
until they complete.
Args:
vms: the VMs to run the benchmark on.
command_builder: an APIScriptCommandBuilder.
cmd_args: arguments for the command_builder.
streams_per_vm: number of threads per vm.
| _RunMultiStreamProcesses | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def _ColdObjectsWrittenFilename():
"""Generates a name for the objects_written_file.
Returns:
The name of the objects_written_file if it should be created, or None.
"""
if FLAGS.object_storage_objects_written_file_prefix:
# Note this format is required by _ColdObjectsWrittenFileAgeHours.
datetime_s... | Generates a name for the objects_written_file.
Returns:
The name of the objects_written_file if it should be created, or None.
| _ColdObjectsWrittenFilename | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def _ColdObjectsWrittenFileAgeHours(filename):
"""Determines the age in hours of an objects_written_file.
Args:
filename: The name of the file.
Returns:
The age of the file in hours (based on the name), or None.
"""
# Parse the year, month, day, hour, and minute from the filename based on the
# wa... | Determines the age in hours of an objects_written_file.
Args:
filename: The name of the file.
Returns:
The age of the file in hours (based on the name), or None.
| _ColdObjectsWrittenFileAgeHours | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def _MultiStreamOneWay(
results, metadata, vms, command_builder, service, bucket_name, operation
):
"""Measures multi-stream latency and throughput in one direction.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vms: the VMs to run the benchmar... | Measures multi-stream latency and throughput in one direction.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vms: the VMs to run the benchmark on.
command_builder: an APIScriptCommandBuilder.
service: The provider's ObjectStorageService
b... | _MultiStreamOneWay | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def MultiStreamRWBenchmark(
results, metadata, vms, command_builder, service, bucket_name
):
"""A benchmark for multi-stream read/write latency and throughput.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vms: the VMs to run the benchmark on.
... | A benchmark for multi-stream read/write latency and throughput.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vms: the VMs to run the benchmark on.
command_builder: an APIScriptCommandBuilder.
service: The provider's ObjectStorageService
... | MultiStreamRWBenchmark | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def MultiStreamWriteBenchmark(
results, metadata, vms, command_builder, service, bucket_name
):
"""A benchmark for multi-stream write latency and throughput.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vms: the VMs to run the benchmark on.
... | A benchmark for multi-stream write latency and throughput.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vms: the VMs to run the benchmark on.
command_builder: an APIScriptCommandBuilder.
service: The provider's ObjectStorageService
bucke... | MultiStreamWriteBenchmark | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def MultiStreamReadBenchmark(
results, metadata, vms, command_builder, service, bucket_name, read_objects
):
"""A benchmark for multi-stream read latency and throughput.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vms: the VMs to run the benc... | A benchmark for multi-stream read latency and throughput.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vms: the VMs to run the benchmark on.
command_builder: an APIScriptCommandBuilder.
service: The provider's ObjectStorageService
bucket... | MultiStreamReadBenchmark | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def MultiStreamDelete(
results, metadata, vms, command_builder, service, bucket_name
):
"""A benchmark for multi-stream delete.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vms: the VMs to run the benchmark on.
command_builder: an APIScrip... | A benchmark for multi-stream delete.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vms: the VMs to run the benchmark on.
command_builder: an APIScriptCommandBuilder.
service: The provider's ObjectStorageService
bucket_name: the primary bu... | MultiStreamDelete | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def CheckPrerequisites(benchmark_config):
"""Verifies that the required resources are present.
Args:
benchmark_config: Benchmark config to verify.
Raises:
perfkitbenchmarker.data.ResourceNotFound: On missing resource.
perfkitbenchmarker.errors.Setup.InvalidFlagConfigurationError: On invalid
... | Verifies that the required resources are present.
Args:
benchmark_config: Benchmark config to verify.
Raises:
perfkitbenchmarker.data.ResourceNotFound: On missing resource.
perfkitbenchmarker.errors.Setup.InvalidFlagConfigurationError: On invalid
flags.
| CheckPrerequisites | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def CLIThroughputBenchmark(
output_results, metadata, vm, command_builder, service, bucket
):
"""A benchmark for CLI tool throughput.
We will upload and download a set of files from/to a local directory
via cli tools and observe the throughput.
Args:
results: the results array to append to.
metada... | A benchmark for CLI tool throughput.
We will upload and download a set of files from/to a local directory
via cli tools and observe the throughput.
Args:
results: the results array to append to.
metadata: a dictionary of metadata to add to samples.
vm: the VM to run the benchmark on.
command_bui... | CLIThroughputBenchmark | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Prepare vm with cloud provider tool and prepare vm with data file.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Raises:
ColdDataError: If this benchmark is reading cold data, but the data isn't
c... | Prepare vm with cloud provider tool and prepare vm with data file.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Raises:
ColdDataError: If this benchmark is reading cold data, but the data isn't
cold enough (as configured by objec... | Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run storage benchmark and publish results.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
Total throughput in the form of tuple. The tuple contains
the sample metric (string), value (float), u... | Run storage benchmark and publish results.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
Total throughput in the form of tuple. The tuple contains
the sample metric (string), value (float), unit (string).
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec):
"""Clean up storage bucket/container and clean up vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
if not hasattr(benchmark_spec, 'service'):
logging.info('Skipping cleanup as prepare method failed')
... | Clean up storage bucket/container and clean up vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/object_storage_service_benchmark.py | Apache-2.0 |
def GetConfig(user_config):
"""Decide number of vms needed to run oldisim."""
config = configs.LoadConfig(BENCHMARK_CONFIG, user_config, BENCHMARK_NAME)
config['vm_groups']['default']['vm_count'] = (
FLAGS.oldisim_num_leaves + NUM_DRIVERS + NUM_ROOTS
)
return config | Decide number of vms needed to run oldisim. | GetConfig | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install and build oldisim on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
vms = benchmark_spec.vms
leaf_vms = [
vm for vm_idx, vm in enumerate(vms) if vm_idx >= (NUM_DRIVERS + NU... | Install and build oldisim on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | Apache-2.0 |
def SetupRoot(root_vm, leaf_vms):
"""Connect a root node to a list of leaf nodes.
Args:
root_vm: A root vm instance.
leaf_vms: A list of leaf vm instances.
"""
fanout_args = ' '.join(['--leaf=%s' % i.internal_ip for i in leaf_vms])
root_server_bin = oldisim_dependencies.BinaryPath('ParentNode')
roo... | Connect a root node to a list of leaf nodes.
Args:
root_vm: A root vm instance.
leaf_vms: A list of leaf vm instances.
| SetupRoot | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | Apache-2.0 |
def ParseOutput(oldisim_output):
"""Parses the output from oldisim.
Args:
oldisim_output: A string containing the text of oldisim output.
Returns:
A tuple of (peak_qps, peak_lat, target_qps, target_lat).
"""
re_peak = re.compile(r'peak qps = (?P<qps>\S+), latency = (?P<lat>\S+)')
re_target = re.c... | Parses the output from oldisim.
Args:
oldisim_output: A string containing the text of oldisim output.
Returns:
A tuple of (peak_qps, peak_lat, target_qps, target_lat).
| ParseOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | Apache-2.0 |
def RunLoadTest(benchmark_spec, fanout):
"""Run Loadtest for a given topology.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
fanout: Request is first processed by a root node, which then fans out to a
subset of leaf nodes.
Returns... | Run Loadtest for a given topology.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
fanout: Request is first processed by a root node, which then fans out to a
subset of leaf nodes.
Returns:
A tuple of (peak_qps, peak_lat, target_q... | RunLoadTest | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run oldisim on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
results = []
qps_dict = dict()
fanout_list = {1, FLAGS.oldisim_num_leaves}
... | Run oldisim on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec): # pylint: disable=unused-argument
"""Cleanup oldisim on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
vms = benchmark_spec.vms
for vm_index, vm in enumerate(vms):
if vm_index >= NUM_DR... | Cleanup oldisim on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/oldisim_benchmark.py | Apache-2.0 |
def Run(bm_spec: benchmark_spec.BenchmarkSpec) -> List[sample.Sample]:
"""Run omb.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Returns:
A list of sample.Sample objects.
"""
vms = bm_spec.vms
samples = []
for benchmark in _GetBenchmar... | Run omb.
Args:
bm_spec: The benchmark specification. Contains all data that is required to
run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/omb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/omb_benchmark.py | Apache-2.0 |
def _GetBenchmarks() -> List[str]:
"""Returns the list of OSU benchmarks to run."""
if _BENCHMARKS_ARG.value:
return _BENCHMARKS_ARG.value
if _RUN_LONG_LATENCY.value:
return sorted(omb.BENCHMARKS)
return sorted(
name
for name, run_type in sorted(omb.BENCHMARKS.items())
if not run_type.... | Returns the list of OSU benchmarks to run. | _GetBenchmarks | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/omb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/omb_benchmark.py | Apache-2.0 |
def _ParseDimensions(dimensions):
"""Parse and validate an individual dimensions entry.
Args:
dimensions: String formatted as "_" separated integers like: '80_20_20'.
Returns:
Parsed dimensions like: '80 20 20'.
Raises:
errors.Config.InvalidValue: If input dimensions are incorrectly formatted.
... | Parse and validate an individual dimensions entry.
Args:
dimensions: String formatted as "_" separated integers like: '80_20_20'.
Returns:
Parsed dimensions like: '80 20 20'.
Raises:
errors.Config.InvalidValue: If input dimensions are incorrectly formatted.
| _ParseDimensions | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def _GetSample(line):
"""Parse a single output line into a performance sample.
Input format:
real 100.00
Args:
line: A single line from the OpenFOAM timing output.
Returns:
A single performance sample, with times in ms.
"""
runtime_category, runtime_output = line.split()
try:
runtime_se... | Parse a single output line into a performance sample.
Input format:
real 100.00
Args:
line: A single line from the OpenFOAM timing output.
Returns:
A single performance sample, with times in ms.
| _GetSample | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def _GetWorkingDirPath():
"""Get the base directory name of the case being run."""
case_dir_name = posixpath.basename(_CASE_PATHS[_CASE.value])
return posixpath.join(_BENCHMARK_ROOT, case_dir_name) | Get the base directory name of the case being run. | _GetWorkingDirPath | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def _SetDictEntry(vm, key, value, dict_file_name):
"""Sets an entry in an OpenFOAM dictionary file.
Args:
vm: The VM to set the entry on.
key: String; name of the key to set (like hierarchicalCoeffs.n).
value: String; the value to set.
dict_file_name: String; name of the file to set the specified e... | Sets an entry in an OpenFOAM dictionary file.
Args:
vm: The VM to set the entry on.
key: String; name of the key to set (like hierarchicalCoeffs.n).
value: String; the value to set.
dict_file_name: String; name of the file to set the specified entry. This
file should be in the working directory... | _SetDictEntry | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def _UseMpi(vm, num_processes, mapping):
"""Configure OpenFOAM to use MPI if running with more than 1 VM.
This function looks for the word "runParallel" in the run script and replaces
it with an mpirun command.
Args:
vm: The worker VM to use MPI on.
num_processes: An integer representing the total num... | Configure OpenFOAM to use MPI if running with more than 1 VM.
This function looks for the word "runParallel" in the run script and replaces
it with an mpirun command.
Args:
vm: The worker VM to use MPI on.
num_processes: An integer representing the total number of processes for the
MPI job.
ma... | _UseMpi | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def _GetBaseCommand(command):
"""Returns a base OpenFOAM command.
Example:
command "mpirun -hostfile /home/perfkit/OpenFOAM/run/MACHINEFILE -mca btl
^openib --map-by core:SPAN -np 16 potentialFoam -parallel"
returns "potentialFoam"
Args:
command: String, the command to parse.
Returns:
T... | Returns a base OpenFOAM command.
Example:
command "mpirun -hostfile /home/perfkit/OpenFOAM/run/MACHINEFILE -mca btl
^openib --map-by core:SPAN -np 16 potentialFoam -parallel"
returns "potentialFoam"
Args:
command: String, the command to parse.
Returns:
The base OpenFOAM command from _RUN_... | _GetBaseCommand | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def _RunCommand(vm, command):
"""Runs a valid OpenFOAM command, returning samples."""
_, output = vm.RemoteCommand(
f'cd {_GetWorkingDirPath()} && time -p {command}'
)
results = _GetSamples(output)
for result in results:
result.metadata['full_command'] = command
result.metadata['command'] = _Ge... | Runs a valid OpenFOAM command, returning samples. | _RunCommand | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def _ParseRunCommands(vm, remote_run_file):
"""Parses OpenFOAM run commands from a case's Allrun file."""
local_destination = vm_util.PrependTempDir(_RUN_SCRIPT)
vm.PullFile(local_destination, remote_run_file)
commands = []
for command in open(local_destination):
command = command.strip('\n')
if _IsVa... | Parses OpenFOAM run commands from a case's Allrun file. | _ParseRunCommands | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def _GenerateFullRuntimeSamples(samples):
"""Append the full runtime results to samples."""
assert samples, f'{samples} should not be an empty list'
counts = collections.Counter()
for s in samples:
counts[s.metric] += s.value
for metric in ('time_real', 'time_user', 'time_sys'):
samples.append(sample.... | Append the full runtime results to samples. | _GenerateFullRuntimeSamples | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def _RunCase(master_vm, dimensions):
"""Runs the case with the given dimensions.
This function automatically looks for the "Allrun" script in the working
directory.
Args:
master_vm: The vm to run the case commands on. If using the default NFS
server, it doesn't actually matter which vm this is.
... | Runs the case with the given dimensions.
This function automatically looks for the "Allrun" script in the working
directory.
Args:
master_vm: The vm to run the case commands on. If using the default NFS
server, it doesn't actually matter which vm this is.
dimensions: A string of the dimensions to ... | _RunCase | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs the benchmark and returns a dict of performance data.
It must be possible to run the benchmark multiple times after the Prepare
stage. This method runs a single case with multiple dimensions.
Args:
benchmark_spec: The benchmark spec for the OpenFOAM benchmark.
Returns:
... | Runs the benchmark and returns a dict of performance data.
It must be possible to run the benchmark multiple times after the Prepare
stage. This method runs a single case with multiple dimensions.
Args:
benchmark_spec: The benchmark spec for the OpenFOAM benchmark.
Returns:
A list of performance samp... | Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openfoam_benchmark.py | Apache-2.0 |
def ParseOpenSSLOutput(raw_result: str, version: str, parallelism: int):
"""Parse output from openssl speed and return as samples."""
matches = regex_util.ExtractExactlyOneMatch(r'evp\s+(.*)', raw_result).split()
results = []
for idx, blocksize in enumerate(BLOCKSIZES_IN_BYTES):
value_unit_tuple = regex_uti... | Parse output from openssl speed and return as samples. | ParseOpenSSLOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openssl_speed_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openssl_speed_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run openssl-speed on the target vm.
Sample output:
OpenSSL 1.1.1k 25 Mar 2021
built on: Thu Mar 25 20:49:34 2021 UTC
options:bn(64,64) rc4(16x,int) des(int) aes(partial) blowfish(ptr)
compiler: gcc -fPIC -pthread -m64 -Wa ...
evp 730303.56k 2506149.08k 4473725.34k 5640335.56k... | Run openssl-speed on the target vm.
Sample output:
OpenSSL 1.1.1k 25 Mar 2021
built on: Thu Mar 25 20:49:34 2021 UTC
options:bn(64,64) rc4(16x,int) des(int) aes(partial) blowfish(ptr)
compiler: gcc -fPIC -pthread -m64 -Wa ...
evp 730303.56k 2506149.08k 4473725.34k 5640335.56k 6048576.31k 6107063.91k
Ar... | Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/openssl_speed_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/openssl_speed_benchmark.py | Apache-2.0 |
def UpdateBenchmarkSpecWithRunStageFlags(benchmark_spec):
"""Updates benchmark_spec with flags that are used in the run stage."""
benchmark_spec.seconds_per_test = FLAGS.pgbench_seconds_per_test
benchmark_spec.seconds_to_pause = FLAGS.pgbench_seconds_to_pause_before_steps
benchmark_spec.client_counts = FLAGS.pg... | Updates benchmark_spec with flags that are used in the run stage. | UpdateBenchmarkSpecWithRunStageFlags | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | Apache-2.0 |
def GetDbSize(relational_db, db_name):
"""Get the size of the database."""
if relational_db.engine_type == sql_engine_utils.SPANNER_POSTGRES:
return
stdout, _ = relational_db.client_vm_query_tools.IssueSqlCommand(
f"SELECT pg_size_pretty(pg_database_size('{db_name}'))",
database_name=TEST_DB_NAME,... | Get the size of the database. | GetDbSize | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Prepares the client and server VM for the pgbench test.
This function installs pgbench on the client and creates and populates
the test database on the server.
If DEFAULT_DB_NAME exists, it will be dropped and recreated,
else it will be created. pgbench will populate the data... | Prepares the client and server VM for the pgbench test.
This function installs pgbench on the client and creates and populates
the test database on the server.
If DEFAULT_DB_NAME exists, it will be dropped and recreated,
else it will be created. pgbench will populate the database
with sample data using FLAG... | Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | Apache-2.0 |
def ParseSizeFromTable(stdout):
"""Parse stdout of a table representing size of the database.
Example stdoutput is:
pg_size_pretty
----------------
22 MB
(1 row)
Args:
stdout: stdout from psql query obtaining the table size.
Returns:
size in MB that was parsed from the table
Raises:
... | Parse stdout of a table representing size of the database.
Example stdoutput is:
pg_size_pretty
----------------
22 MB
(1 row)
Args:
stdout: stdout from psql query obtaining the table size.
Returns:
size in MB that was parsed from the table
Raises:
Exception: if unknown how to parse ... | ParseSizeFromTable | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | Apache-2.0 |
def DoesDatabaseExist(client_vm, connection_string, database_name):
"""Returns whether or not the specifid database exists on the server.
Args:
client_vm: client vm which will run the query
connection_string: database server connection string understood by psql
database_name: name of database to check ... | Returns whether or not the specifid database exists on the server.
Args:
client_vm: client vm which will run the query
connection_string: database server connection string understood by psql
database_name: name of database to check for existense
Returns:
True if database_name exists, else False
| DoesDatabaseExist | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | Apache-2.0 |
def CreateDatabase(benchmark_spec, default_database_name, new_database_name):
"""Creates a new database on the database server.
If new_database_name already exists on the server, it will be dropped and
recreated.
Args:
benchmark_spec: benchmark_spec object which contains the database server and
clie... | Creates a new database on the database server.
If new_database_name already exists on the server, it will be dropped and
recreated.
Args:
benchmark_spec: benchmark_spec object which contains the database server and
client_vm
default_database_name: name of the default database guaranteed to exist o... | CreateDatabase | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs the pgbench benchark on the client vm, against the db server.
Args:
benchmark_spec: benchmark_spec object which contains the database server and
client_vm
Returns:
a list of sample objects
"""
UpdateBenchmarkSpecWithRunStageFlags(benchmark_spec)
relational_d... | Runs the pgbench benchark on the client vm, against the db server.
Args:
benchmark_spec: benchmark_spec object which contains the database server and
client_vm
Returns:
a list of sample objects
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | Apache-2.0 |
def GetMetaData(db_size, benchmark_spec):
"""Gets the metadata related to pgbench."""
metadata = {
'scale_factor': benchmark_spec.scale_factor,
'postgres_db_size_MB': db_size,
'seconds_per_test': benchmark_spec.seconds_per_test,
'seconds_to_pause_before_steps': benchmark_spec.seconds_to_paus... | Gets the metadata related to pgbench. | GetMetaData | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec):
"""Uninstalls pgbench from the client vm."""
client_vms = benchmark_spec.vm_groups['clients']
assert len(client_vms) == 1
client_vm = client_vms[0]
client_vm.Uninstall('pgbench') | Uninstalls pgbench from the client vm. | Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/pgbench_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec): # pylint: disable=unused-argument
"""Install ping on the target vm.
Checks that there are exactly two vms specified.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
if len(benchmark_spec.vms) != 2:
rai... | Install ping on the target vm.
Checks that there are exactly two vms specified.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/ping_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ping_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run ping on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
vms = benchmark_spec.vms
results = []
for sending_vm, receiving_vm in vms, revers... | Run ping on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/ping_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ping_benchmark.py | Apache-2.0 |
def _RunPing(sending_vm, receiving_vm, receiving_ip, ip_type):
"""Run ping using 'sending_vm' to connect to 'receiving_ip'.
Args:
sending_vm: The VM issuing the ping request.
receiving_vm: The VM receiving the ping. Needed for metadata.
receiving_ip: The IP address to be pinged.
ip_type: The type ... | Run ping using 'sending_vm' to connect to 'receiving_ip'.
Args:
sending_vm: The VM issuing the ping request.
receiving_vm: The VM receiving the ping. Needed for metadata.
receiving_ip: The IP address to be pinged.
ip_type: The type of 'receiving_ip', (either
'vm_util.IpAddressSubset.INTERNAL o... | _RunPing | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/ping_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ping_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install Redis on one VM and memtier_benchmark on another.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
client_vms = benchmark_spec.vm_groups['clients']
server_vms = benchmark_spec.vm_groups['servers']... | Install Redis on one VM and memtier_benchmark on another.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/redis_enterprise_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/redis_enterprise_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run memtier against enterprise redis and measure latency and throughput.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
load_vms = benchmark_spec.vm_groups['cl... | Run memtier against enterprise redis and measure latency and throughput.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/redis_enterprise_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/redis_enterprise_benchmark.py | Apache-2.0 |
def CheckPrerequisites(_):
"""Verifies that benchmark setup is correct."""
if FLAGS.redis_server_cluster_mode and not FLAGS.memtier_cluster_mode:
raise errors.Setup.InvalidFlagConfigurationError(
'--redis_server_cluster_mode must be used with --memtier_cluster_mode'
)
if len(redis_server.GetRedisP... | Verifies that benchmark setup is correct. | CheckPrerequisites | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/redis_memtier_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/redis_memtier_benchmark.py | Apache-2.0 |
def Prepare(bm_spec: _BenchmarkSpec) -> None:
"""Install Redis on one VM and memtier_benchmark on another."""
server_count = len(bm_spec.vm_groups['servers'])
if server_count != 1 and not redis_server.CLUSTER_MODE.value:
raise errors.Benchmarks.PrepareException(
f'Expected servers vm count to be 1, go... | Install Redis on one VM and memtier_benchmark on another. | Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/redis_memtier_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/redis_memtier_benchmark.py | Apache-2.0 |
def _GetTopResults(server_vm) -> List[sample.Sample]:
"""Gat and parse CPU output from top command."""
if not REDIS_MEMTIER_MEASURE_CPU.value:
return []
cpu_usage, _ = server_vm.RemoteCommand(f'grep Cpu {_TOP_OUTPUT}')
samples = []
row_index = 0
for row in cpu_usage.splitlines():
line = row.strip()... | Gat and parse CPU output from top command. | _GetTopResults | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/redis_memtier_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/redis_memtier_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run YCSB against Redis.
This method can run with multiple number of redis processes (server) on a
single vm. Since redis is single threaded, there is no need to run on
multiple server instances. When running with multiple redis processes, key
space is sharded.
This method can a... | Run YCSB against Redis.
This method can run with multiple number of redis processes (server) on a
single vm. Since redis is single threaded, there is no need to run on
multiple server instances. When running with multiple redis processes, key
space is sharded.
This method can also run with muliple number of... | Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/redis_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/redis_ycsb_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install and set up ResNet on the target vm.
Args:
benchmark_spec: The benchmark specification
Raises:
errors.Config.InvalidValue upon both GPUs and TPUs appear in the config
"""
vm = benchmark_spec.vms[0]
if bool(benchmark_spec.tpus) and nvidia_driver.CheckNvidiaGp... | Install and set up ResNet on the target vm.
Args:
benchmark_spec: The benchmark specification
Raises:
errors.Config.InvalidValue upon both GPUs and TPUs appear in the config
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/resnet_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/resnet_benchmark.py | Apache-2.0 |
def _ParseDateTime(wall_time):
"""Parse date and time from output log.
Args:
wall_time: date and time from output log
Example: 0626 15:10:23.018357
Returns:
datetime
"""
if wall_time:
current_date = datetime.datetime.now()
current_month = current_date.month
run_month = wall_time[0:2]
... | Parse date and time from output log.
Args:
wall_time: date and time from output log
Example: 0626 15:10:23.018357
Returns:
datetime
| _ParseDateTime | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/resnet_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/resnet_benchmark.py | Apache-2.0 |
def MakeSamplesFromEvalOutput(metadata, output, elapsed_seconds, use_tpu=True):
"""Create a sample containing evaluation metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
elapsed_seconds: float, elapsed seconds from saved checkpoint.
use_tpu: bool,... | Create a sample containing evaluation metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
elapsed_seconds: float, elapsed seconds from saved checkpoint.
use_tpu: bool, whether tpu is used
Example output:
perfkitbenchmarker/tests/linux_benchmarks... | MakeSamplesFromEvalOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/resnet_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/resnet_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run ResNet on the cluster.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
_UpdateBenchmarkSpecWithFlags(benchmark_spec)
vm = benchmark_spec.vms[0]
if bench... | Run ResNet on the cluster.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/resnet_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/resnet_benchmark.py | Apache-2.0 |
def _DownloadData(benchmark_spec, rank):
"""Downloads train valid and test on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
rank: integer, the node rank in distributed training.
"""
vm = benchmark_spec.vms[rank]
vm.Ins... | Downloads train valid and test on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
rank: integer, the node rank in distributed training.
| _DownloadData | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/roberta_mmlm_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/roberta_mmlm_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install and set up RoBERTa mmlm on the target vm..
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
_UpdateBenchmarkSpecWithFlags(benchmark_spec)
vms = benchmark_spec.vms
benchmark_spec.always_call_clea... | Install and set up RoBERTa mmlm on the target vm..
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/roberta_mmlm_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/roberta_mmlm_benchmark.py | Apache-2.0 |
def MakeSamplesFromOutput(metadata, output):
"""Create samples containing metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
Returns:
Samples containing training metrics.
"""
results = regex_util.ExtractAllMatches(
r'^\| epoch (\d+):\s+'
... | Create samples containing metrics.
Args:
metadata: dict contains all the metadata that reports.
output: string, command output
Returns:
Samples containing training metrics.
| MakeSamplesFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/roberta_mmlm_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/roberta_mmlm_benchmark.py | Apache-2.0 |
def _Run(benchmark_spec, rank):
"""Run the benchmark on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
rank: integer, the node rank in distributed training.
Returns:
A list of sample.Sample objects.
"""
vm = benchm... | Run the benchmark on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
rank: integer, the node rank in distributed training.
Returns:
A list of sample.Sample objects.
| _Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/roberta_mmlm_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/roberta_mmlm_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec: bm_spec.BenchmarkSpec) -> None:
"""Prepares the client and server VM for the pgbench test.
This function installs pgbench on the client and creates and populates
the test database on the server.
If DEFAULT_DB_NAME exists, it will be dropped and recreated,
else it will be created.... | Prepares the client and server VM for the pgbench test.
This function installs pgbench on the client and creates and populates
the test database on the server.
If DEFAULT_DB_NAME exists, it will be dropped and recreated,
else it will be created. pgbench will populate the database
with sample data using FLAG... | Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/s64da_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/s64da_benchmark.py | Apache-2.0 |
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> List[sample.Sample]:
"""Run the s64da benchmark.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample instances.
"""
vm = benchmark_spec.vms[0]
db = bench... | Run the s64da benchmark.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample instances.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/s64da_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/s64da_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install SciMark2 on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
vms = benchmark_spec.vms
vm = vms[0]
logging.info('Preparing SciMark2 on %s', vm)
vm.Install('scimark2') | Install SciMark2 on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/scimark2_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/scimark2_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run SciMark2 on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
vms = benchmark_spec.vms
vm = vms[0]
logging.info('Running SciMark2 on %s', v... | Run SciMark2 on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/scimark2_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/scimark2_benchmark.py | Apache-2.0 |
def ExtractPlatform(result, benchmark_language):
"""Retrieves platform data from the result string."""
metadata = {}
meta_start = None
if benchmark_language == 'C':
pass
elif benchmark_language == 'Java':
for m in platform_regex.finditer(result):
if meta_start is None:
... | Retrieves platform data from the result string. | ExtractPlatform | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/scimark2_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/scimark2_benchmark.py | Apache-2.0 |
def ExtractResults(result, benchmark_language):
"""Retrieves data points from the result string."""
datapoints = []
if benchmark_language == 'C':
for groups in regex_util.ExtractAllMatches(result_regex_c, result):
metric = '{} {}'.format(groups[0].strip(), groups[2].strip())
metric = m... | Retrieves data points from the result string. | ExtractResults | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/scimark2_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/scimark2_benchmark.py | Apache-2.0 |
def GenerateSSHKey(vm):
"""Generates a new SSH key pair on the VM."""
vm.RemoteCommand('ssh-keygen -t rsa -N "" -f ~/.ssh/scp_benchmark_key')
public_key, _ = vm.RemoteCommand('cat ~/.ssh/scp_benchmark_key.pub')
return public_key.strip() | Generates a new SSH key pair on the VM. | GenerateSSHKey | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | Apache-2.0 |
def GenerateAndExchangeSSHKeys(vm1, vm2):
"""Exchanges SSH keys between two VMs."""
public_key1 = GenerateSSHKey(vm1)
public_key2 = GenerateSSHKey(vm2)
vm1.RemoteCommand(f'echo "{public_key2}" >> ~/.ssh/authorized_keys')
vm2.RemoteCommand(f'echo "{public_key1}" >> ~/.ssh/authorized_keys') | Exchanges SSH keys between two VMs. | GenerateAndExchangeSSHKeys | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec: bm_spec.BenchmarkSpec):
"""Prepares the VMs and files to be transferred."""
logging.info('Preparing SCP benchmark')
vms = benchmark_spec.vms
if len(vms) != 2:
raise ValueError(
f'scp benchmark requires exactly two machines, found {len(vms)}'
)
# Backup current sta... | Prepares the VMs and files to be transferred. | Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | Apache-2.0 |
def PrepareFileForTransfer(vm):
"""Creates a test file of specified size on the VM."""
logging.info('Preparing the test file')
# Create a random file of specified size
file_size_gb = FLAGS.scp_file_size_gb
block_size = '50M' # 50MiB per block
count = file_size_gb * 20 # 1GB = 1000MiB = 20 blocks
# Usin... | Creates a test file of specified size on the VM. | PrepareFileForTransfer | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | Apache-2.0 |
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> list[sample.Sample]:
"""Runs the benchmark and returns a dict of performance data."""
logging.info('Running SCP benchmark')
vms = benchmark_spec.vms
vm1, vm2 = vms[0], vms[1]
results = []
def TransferFile(vm_pair):
source_vm, dest_vm = vm_pair
# cl... | Runs the benchmark and returns a dict of performance data. | Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec: bm_spec.BenchmarkSpec):
"""Cleans up after SCP benchmark completes."""
vms = benchmark_spec.vms
for vm in vms:
vm.RemoteCommand('rm -rf /scratch')
vm.RemoteCommand(
'rm -f ~/.ssh/scp_benchmark_key ~/.ssh/scp_benchmark_key.pub'
)
vm.RemoteCommand("sed -i '/scp_b... | Cleans up after SCP benchmark completes. | Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/scp_benchmark.py | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.