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 Prepare(benchmark_spec):
"""Install Silo 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 Silo on %s', vm)
vm.Install('silo') | Install Silo 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/silo_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/silo_benchmark.py | Apache-2.0 |
def ParseResults(results):
"""Result parser for Silo.
This is what a smaple output looks like:
--- table statistics ---
table customer_0 size 30000 (+0 records)
table customer_name_idx_0 size 30000 (+0 records)
table district_0 size 10 (+0 records)
table history_0 size 792182 (+762182 records)
table it... | Result parser for Silo.
This is what a smaple output looks like:
--- table statistics ---
table customer_0 size 30000 (+0 records)
table customer_name_idx_0 size 30000 (+0 records)
table district_0 size 10 (+0 records)
table history_0 size 792182 (+762182 records)
table item_0 size 100000 (+0 records)
... | ParseResults | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/silo_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/silo_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run Silo 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]
nthreads = vm.NumCpusForBenchmark()
loggin... | Run Silo 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/silo_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/silo_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Installs SPEC CPU2006 on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
vm = benchmark_spec.vms[0]
vm.Install('speccpu2006')
# Set attribute outside of the install function, so benchmar... | Installs SPEC CPU2006 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/speccpu2006_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/speccpu2006_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs SPEC CPU2006 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.
"""
vm = benchmark_spec.vms[0]
version_specific_parameters = []
if FLAGS.ru... | Runs SPEC CPU2006 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/speccpu2006_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/speccpu2006_benchmark.py | Apache-2.0 |
def CheckPrerequisites(benchmark_config):
"""FDO is only allow with peak measurement.
Args:
benchmark_config: benchmark_config
Raises:
errors.Config.InvalidValue: On invalid flag setting.
"""
del benchmark_config # unused
if FLAGS.spec17_fdo and FLAGS.spec_runmode == 'base':
raise errors.Conf... | FDO is only allow with peak measurement.
Args:
benchmark_config: benchmark_config
Raises:
errors.Config.InvalidValue: On invalid flag setting.
| CheckPrerequisites | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/speccpu2017_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/speccpu2017_benchmark.py | Apache-2.0 |
def CheckVmPrerequisites(vm):
"""Checks the system memory on this vm.
Rate runs require 2 GB minimum system memory.
Speed runs require 16 GB minimum system memory.
Taken from https://www.spec.org/cpu2017/Docs/system-requirements.html
Args:
vm: virtual machine to run spec on.
Raises:
errors.Config... | Checks the system memory on this vm.
Rate runs require 2 GB minimum system memory.
Speed runs require 16 GB minimum system memory.
Taken from https://www.spec.org/cpu2017/Docs/system-requirements.html
Args:
vm: virtual machine to run spec on.
Raises:
errors.Config.InvalidValue: On insufficient vm m... | CheckVmPrerequisites | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/speccpu2017_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/speccpu2017_benchmark.py | Apache-2.0 |
def _GenIncFile(vm):
"""Generates .inc files when not already included in tarballs."""
if re.search(
r'amd_(speed|rate)_aocc300_milan_(A1|B2).cfg', FLAGS.runspec_config
):
# python script requires stdin
vm.RemoteCommand("printf 'yes\nyes\nyes\n' > yes.txt")
config = FLAGS.runspec_config.split('.... | Generates .inc files when not already included in tarballs. | _GenIncFile | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/speccpu2017_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/speccpu2017_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs SPEC CPU2017 on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of lists of sample.Sample objects.
"""
vms = benchmark_spec.vms
samples = []
grouped_samples = backgro... | Runs SPEC CPU2017 on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of lists of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/speccpu2017_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/speccpu2017_benchmark.py | Apache-2.0 |
def _Run(vm):
"""See base method.
Args:
vm: The vm to run the benchmark on.
Returns:
A list of sample.Sample objects.
"""
# Make changes e.g. compiler flags to spec config file.
if 'gcc' in FLAGS.runspec_config:
_OverwriteGccO3(vm)
# swap only if necessary; free local node memory and avoid... | See base method.
Args:
vm: The vm to run the benchmark on.
Returns:
A list of sample.Sample objects.
| _Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/speccpu2017_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/speccpu2017_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install Specjbb2015 on the target vm.
Args:
benchmark_spec: The benchmark specification.
"""
vm = benchmark_spec.vms[0]
vm.Install('specjbb')
vm.Install('openjdk')
# Used on m6g (AWS Graviton 2) machines for optimal performance
if FLAGS.build_openjdk_neoverse:
... | Install Specjbb2015 on the target vm.
Args:
benchmark_spec: The benchmark specification.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | Apache-2.0 |
def _GetNumGroups(vm):
"""Returns integer number of backend groups to use for MultiJVM."""
if FLAGS.specjbb_auto_groups:
return len(numactl.GetNuma(vm))
return FLAGS.specjbb_num_groups | Returns integer number of backend groups to use for MultiJVM. | _GetNumGroups | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | Apache-2.0 |
def _MaxHeapMB(vm, mode):
"""Returns max heap size in MB as an int."""
if mode == BACKEND_MODE:
if FLAGS.specjbb_ram_mb_per_core: # overrides --specjbb_memory_ratio if set
return (
int(vm.NumCpusForBenchmark() // _GetNumGroups(vm))
* FLAGS.specjbb_ram_mb_per_core
)
else:
... | Returns max heap size in MB as an int. | _MaxHeapMB | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | Apache-2.0 |
def _JVMArgs(vm, mode):
"""Determines JVM args and returns them as a string."""
if mode in (TXINJECTOR_MODE, MULTICONTROLLER_MODE):
return _DEFAULT_JVM_CONT_TXI_ARGS
gc_size = int(vm.NumCpusForBenchmark() / _GetNumGroups(vm))
jvm_backend_gc_arg = f'-XX:ParallelGCThreads={gc_size}'
# Determine max/new he... | Determines JVM args and returns them as a string. | _JVMArgs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | Apache-2.0 |
def _SpecArgs(vm, mode):
"""Determines Spec args and returns them as a string."""
num_workers = (
vm.NumCpusForBenchmark() * FLAGS.specjbb_workers_ratio / _GetNumGroups(vm)
)
spec_num_workers_arg = f' -Dspecjbb.forkjoin.workers={int(num_workers)}'
spec_num_groups_arg = f' -Dspecjbb.group.count={_GetNum... | Determines Spec args and returns them as a string. | _SpecArgs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | Apache-2.0 |
def _CollectSLAMetrics(vm):
"""Gathers SLA metrics from specjbb output files."""
# The log file reports the location of the report.html file. Since date/time
# are part of the report filename, we must determine it at runtime. The .raw
# file is easier to parse than the .html file, so parse that instead.
grep... | Gathers SLA metrics from specjbb output files. | _CollectSLAMetrics | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | Apache-2.0 |
def ParseJbbOutput(stdout, metadata):
"""Generates samples from the RUN RESULT string."""
samples = []
regex = re.compile(
r'RUN\sRESULT:.*?max\-jOPS\s=\s(?P<maxjops>\d+),\s+'
r'critical-jOPS\s=\s(?P<crjops>\d+)'
)
jops = regex.search(stdout)
if jops:
samples.append(
sample.Sample(... | Generates samples from the RUN RESULT string. | ParseJbbOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | Apache-2.0 |
def _RunBackgroundNumaPinnedCommand(vm, cmd_list, node_id):
"""In a shell session, cd and run a numa pinned background command.
A user may opt to not NUMA pin with the specjbb_numa_aware flag.
Args:
vm: VM to run the command on
cmd_list: list of commands to be joined together
node_id: NUMA node to p... | In a shell session, cd and run a numa pinned background command.
A user may opt to not NUMA pin with the specjbb_numa_aware flag.
Args:
vm: VM to run the command on
cmd_list: list of commands to be joined together
node_id: NUMA node to pin command on.
| _RunBackgroundNumaPinnedCommand | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs Specjbb2015 on the target vm.
Args:
benchmark_spec: The benchmark specification.
Returns:
A list of sample.Sample objects with the performance results.
Raises:
Benchmarks.RunError: If no results are found.
"""
vm = benchmark_spec.vms[0]
if FLAGS.specjbb_run... | Runs Specjbb2015 on the target vm.
Args:
benchmark_spec: The benchmark specification.
Returns:
A list of sample.Sample objects with the performance results.
Raises:
Benchmarks.RunError: If no results are found.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specjbb2015_benchmark.py | Apache-2.0 |
def _PrepareSpec(vm):
"""Prepares a SPEC client by copying SPEC to the VM."""
mount_dir = 'spec_mnt'
vm.RemoteCommand('mkdir %s' % mount_dir)
vm.RemoteCommand('mkdir %s' % _SPEC_DIR)
vm.InstallPreprovisionedBenchmarkData(
'specsfs2014', [_SPEC_SFS_2014_ISO], '~/'
)
vm.PushFile(data.ResourcePath(_SPE... | Prepares a SPEC client by copying SPEC to the VM. | _PrepareSpec | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | Apache-2.0 |
def _ConfigureSpec(
prime_client, clients, benchmark, load=None, num_runs=None, incr_load=None
):
"""Configures SPEC SFS 2014 on the prime client.
This function modifies the default configuration file (sfs_rc) which
can be found either in the SPEC SFS 2014 user guide or within the iso.
It also creates a fi... | Configures SPEC SFS 2014 on the prime client.
This function modifies the default configuration file (sfs_rc) which
can be found either in the SPEC SFS 2014 user guide or within the iso.
It also creates a file containing the client mountpoints so that SPEC
can run in a distributed manner.
Args:
prime_cli... | _ConfigureSpec | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install SPEC SFS 2014.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
gluster_servers = benchmark_spec.vm_groups['gluster_servers']
clients = benchmark_spec.vm_groups['clients']
prime_client = clients... | Install SPEC SFS 2014.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | Apache-2.0 |
def _ParseSpecSfsOutput(output, extra_metadata=None):
"""Returns samples generated from the output of SPEC SFS 2014.
Args:
output: The stdout from running SPEC.
extra_metadata: Dict of metadata to include with results.
Returns:
List of sample.Sample objects.
This parses the contents of the result... | Returns samples generated from the output of SPEC SFS 2014.
Args:
output: The stdout from running SPEC.
extra_metadata: Dict of metadata to include with results.
Returns:
List of sample.Sample objects.
This parses the contents of the results xml file and creates samples
from the achieved operatio... | _ParseSpecSfsOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | Apache-2.0 |
def _RunSpecSfs(benchmark_spec):
"""Run SPEC SFS 2014 once.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
prime_client = benchmark_spec.vm_groups['clients'][0]
run_cmd = 'cd {} && pyth... | Run SPEC SFS 2014 once.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| _RunSpecSfs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run SPEC SFS 2014 for each configuration.
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']
prime_client = clients... | Run SPEC SFS 2014 for each configuration.
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/specsfs2014_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec):
"""Cleanup SPEC SFS 2014.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
clients = benchmark_spec.vm_groups['clients']
gluster_servers = benchmark_spec.vm_groups['gluster_servers']
for client in clients... | Cleanup SPEC SFS 2014.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py | Apache-2.0 |
def _InstallAndAuthenticateVm(vm):
"""Install SHOC, ensure correct GPU state, and authenticate the VM for ssh.
Args:
vm: vm to operate on.
"""
vm.Install('shoc_benchmark_suite')
vm.AuthenticateVm() # Configure ssh between vms for MPI | Install SHOC, ensure correct GPU state, and authenticate the VM for ssh.
Args:
vm: vm to operate on.
| _InstallAndAuthenticateVm | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install SHOC and push the machinefile.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
background_tasks.RunThreaded(_InstallAndAuthenticateVm, benchmark_spec.vms)
master_vm = benchmark_spec.vms[0]
ben... | Install SHOC and push the machinefile.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | Apache-2.0 |
def _CreateMedianStencilOutputSample(
stencil2d_output, sample_name, pretty_name, metadata
):
"""Extract the specified sample from the stencil2d output.
Args:
stencil2d_output: output from a Stencil2D run
sample_name: the name of the sample, as it appears in stencil2d_output
pretty_name: the name t... | Extract the specified sample from the stencil2d output.
Args:
stencil2d_output: output from a Stencil2D run
sample_name: the name of the sample, as it appears in stencil2d_output
pretty_name: the name to use for the created sample
metadata: metadata to add the sample
Returns:
A sample.Sample w... | _CreateMedianStencilOutputSample | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | Apache-2.0 |
def _MakeSamplesFromStencilOutput(stdout, metadata):
"""Make and return a list of samples, parsed from the Stencil2D output.
Args:
stdout: Stencil2D output
metadata: metadata to append to the returned samples
Returns:
A list of sample.Samples
"""
results = [
_CreateMedianStencilOutputSampl... | Make and return a list of samples, parsed from the Stencil2D output.
Args:
stdout: Stencil2D output
metadata: metadata to append to the returned samples
Returns:
A list of sample.Samples
| _MakeSamplesFromStencilOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | Apache-2.0 |
def _RunSingleIteration(
master_vm, problem_size, num_processes, num_iterations, metadata
):
"""Run a single iteration of Stencil2D and return a list of samples.
Args:
master_vm: master VM which will start the MPI job
problem_size: a single dimension of the Stencil2D problem_size
num_processes: tot... | Run a single iteration of Stencil2D and return a list of samples.
Args:
master_vm: master VM which will start the MPI job
problem_size: a single dimension of the Stencil2D problem_size
num_processes: total number of MPI processes to launch (number of GPUs)
num_iterations: number of Stencil2D iteratio... | _RunSingleIteration | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs the Stencil2D benchmark. GPU clock speeds must be set already.
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
num_gpus = benchm... | Runs the Stencil2D benchmark. GPU clock speeds must be set already.
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/stencil2d_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stencil2d_benchmark.py | Apache-2.0 |
def _GeoMeanOverflow(iterable):
"""Returns the geometric mean.
See https://en.wikipedia.org/wiki/Geometric_mean#Relationship_with_logarithms
Args:
iterable: a list of positive floats to take the geometric mean of.
Returns: The geometric mean of the list.
"""
if not iterable:
return 0.0
a = nump... | Returns the geometric mean.
See https://en.wikipedia.org/wiki/Geometric_mean#Relationship_with_logarithms
Args:
iterable: a list of positive floats to take the geometric mean of.
Returns: The geometric mean of the list.
| _GeoMeanOverflow | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Installs stress-ng on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
vms = benchmark_spec.vms
def _Install(vm):
vm.InstallPackages('stress-ng')
background_tasks.RunThreaded(_Install... | Installs stress-ng 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/stress_ng_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | Apache-2.0 |
def _ParseStressngResult(
metadata, output, cpu_method=None
) -> sample.Sample | None:
"""Returns stress-ng data as a sample.
Sample output eg:
stress-ng: info: [2566] dispatching hogs: 2 context
stress-ng: info: [2566] successful run completed in 5.00s
stress-ng: info: [2566] stressor bogo... | Returns stress-ng data as a sample.
Sample output eg:
stress-ng: info: [2566] dispatching hogs: 2 context
stress-ng: info: [2566] successful run completed in 5.00s
stress-ng: info: [2566] stressor bogo ops real time usr time sys
time bogo ops/s bogo ops/s
stress-ng: info: [2566] ... | _ParseStressngResult | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | Apache-2.0 |
def _RunWorkload(vm, num_threads):
"""Runs stress-ng on the target vm.
Args:
vm: The target vm to run on.
num_threads: Number of instances of stressors to launch.
Returns:
A list of sample.Sample objects.
"""
stressors = FLAGS.stress_ng_custom_stressors
logging.info('Running stressors: %s', s... | Runs stress-ng on the target vm.
Args:
vm: The target vm to run on.
num_threads: Number of instances of stressors to launch.
Returns:
A list of sample.Sample objects.
| _RunWorkload | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | Apache-2.0 |
def _RunStressNgOnVm(vm):
"""Runs stress-ng on a single VM for all workloads and adds machine_instance metadata.
Args:
vm: The target vm to run on.
Returns:
A list of sample.Sample objects from this VM.
"""
vm_samples = []
num_cpus = vm.NumCpusForBenchmark()
for workload_type in FLAGS.stress_ng... | Runs stress-ng on a single VM for all workloads and adds machine_instance metadata.
Args:
vm: The target vm to run on.
Returns:
A list of sample.Sample objects from this VM.
| _RunStressNgOnVm | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs stress-ng 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 = background_tasks.RunThreaded(_RunStressNgO... | Runs stress-ng 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/stress_ng_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec):
"""Cleans up stress-ng from the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
vms = benchmark_spec.vms
def _Uninstall(vm):
vm.Uninstall('stress-ng')
background_tasks.RunThreaded(_Uninstal... | Cleans up stress-ng from 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/stress_ng_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py | Apache-2.0 |
def GetTimeToSuspend(
vms: List[virtual_machine.BaseVirtualMachine],
) -> List[sample.Sample]:
"""Creates Samples for the suspend time of a list of vms.
The suspend time is the duration form when the VM is suspended to when the VM
is no longer responsive to SSH commands.
Args:
vms: A list of Virtual M... | Creates Samples for the suspend time of a list of vms.
The suspend time is the duration form when the VM is suspended to when the VM
is no longer responsive to SSH commands.
Args:
vms: A list of Virtual Machines(GCE) (already booted/running)
Returns:
List of samples containing the suspend times and c... | GetTimeToSuspend | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/suspend_resume_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/suspend_resume_benchmark.py | Apache-2.0 |
def GetTimeToResume(
vms: List[virtual_machine.BaseVirtualMachine],
) -> List[sample.Sample]:
"""Measures the time it takes to resume a cluster of vms that were suspended.
Args:
vms: List of BaseVirtualMachine subclasses.
Returns:
List of samples containing the resume times of the vms, the cluster
... | Measures the time it takes to resume a cluster of vms that were suspended.
Args:
vms: List of BaseVirtualMachine subclasses.
Returns:
List of samples containing the resume times of the vms, the cluster
resume time(duration) and the time stamps when the resume was completed.
| GetTimeToResume | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/suspend_resume_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/suspend_resume_benchmark.py | Apache-2.0 |
def Run(spec: benchmark_spec.BenchmarkSpec) -> List[sample.Sample]:
"""Measure the boot time for all VMs.
Args:
spec: The benchmark specification.
Returns:
An empty list (all boot samples will be added later).
"""
samples = []
samples.extend(GetTimeToSuspend(spec.vms))
samples.extend(GetTimeToRe... | Measure the boot time for all VMs.
Args:
spec: The benchmark specification.
Returns:
An empty list (all boot samples will be added later).
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/suspend_resume_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/suspend_resume_benchmark.py | Apache-2.0 |
def CreateMetadataFromFlags():
"""Create meta data with all flags for sysbench."""
metadata = {
'sysbench_testname': FLAGS.sysbench_testname,
'sysbench_tables': FLAGS.sysbench_tables,
'sysbench_table_size': FLAGS.sysbench_table_size,
'sysbench_scale': FLAGS.sysbench_scale,
'sysbench_wa... | Create meta data with all flags for sysbench. | CreateMetadataFromFlags | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _InstallLuaScriptsIfNecessary(vm):
"""Installs the lua scripts if necessary."""
if _GetSysbenchTestParameter() == 'tpcc':
vm.InstallPreprovisionedBenchmarkData(
BENCHMARK_NAME, [_SYSBENCH_TPCC_TAR], '~'
)
vm.RemoteCommand(
f'tar -zxvf {_SYSBENCH_TPCC_TAR} --strip-components 1'
... | Installs the lua scripts if necessary. | _InstallLuaScriptsIfNecessary | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _GetSysbenchPrepareCommand(
db: relational_db.BaseRelationalDb, num_vms: int, vm_index: int
) -> str:
"""Returns the sysbench command used to load the database."""
# TODO(ruwa): Migrate to use sysbench.BuildLoadCommand()
data_load_cmd_tokens = [
'cd ~/sysbench/ && nice', # run with a niceness of lo... | Returns the sysbench command used to load the database. | _GetSysbenchPrepareCommand | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _LoadDatabaseInParallel(
db: relational_db.BaseRelationalDb,
client_vms: list[virtual_machine.VirtualMachine],
) -> list[sample.Sample]:
"""Loads the database using the sysbench prepare command."""
if _LOAD_CLIENTS.value:
client_vms = client_vms[: _LOAD_CLIENTS.value]
db.UpdateCapacityForLoad()
... | Loads the database using the sysbench prepare command. | _LoadDatabaseInParallel | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _PrepareClients(
db: relational_db.BaseRelationalDb,
client_vms: list[virtual_machine.VirtualMachine],
) -> None:
"""Installs the relevant packages on the clients."""
# Setup common test tools required on the client VM
# Run app install to force reinstalling sysbench.
spanner_oltp = (
db.engin... | Installs the relevant packages on the clients. | _PrepareClients | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _PrepareDatabase(db: relational_db.BaseRelationalDb) -> None:
"""Creates the actual database used for the test, sbtest by default."""
db_name = _GetDatabaseName(db)
# Recreate the DB if needed. Not applicable on a fresh run, but helps with
# manual development.
try:
db.DeleteDatabase(db_name)
excep... | Creates the actual database used for the test, sbtest by default. | _PrepareDatabase | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec) -> List[sample.Sample]:
"""Prepares the DB instance and configures it.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of load samples.
"""
client_vms = benchmark_spec.vm_groups['clients']
... | Prepares the DB instance and configures it.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of load samples.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _GetDatabaseSize(db):
"""Get the size of the database in MB."""
db_engine_type = db.engine_type
if db_engine_type == sql_engine_utils.MYSQL:
stdout, _ = db.client_vm_query_tools.IssueSqlCommand(
"SELECT table_schema AS 'Database', "
'ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) ... | Get the size of the database in MB. | _GetDatabaseSize | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _GetSysbenchRunCommand(
duration: int,
db: relational_db.BaseRelationalDb,
sysbench_thread_count: int,
):
"""Returns the sysbench command as a string."""
if duration <= 0:
raise ValueError('Duration must be greater than zero.')
run_cmd_tokens = [
'nice', # run with a niceness of lower ... | Returns the sysbench command as a string. | _GetSysbenchRunCommand | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _IssueSysbenchCommand(vm, duration, benchmark_spec, sysbench_thread_count):
"""Issues a sysbench run command given a vm and a duration.
Does nothing if duration is <= 0
Args:
vm: The test VM to issue command to.
duration: the duration of the sysbench run.
benchmark_spec: The benchmark specif... | Issues a sysbench run command given a vm and a duration.
Does nothing if duration is <= 0
Args:
vm: The test VM to issue command to.
duration: the duration of the sysbench run.
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
sysbench_... | _IssueSysbenchCommand | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _UpdateSessions(
db: relational_db.BaseRelationalDb, thread_count: int
) -> None:
"""Updates the sessions used for more connection parallelism."""
if (
db.client_vms_query_tools[0].ENGINE_TYPE
== sql_engine_utils.SPANNER_POSTGRES
):
background_tasks.RunThreaded(
lambda client: clie... | Updates the sessions used for more connection parallelism. | _UpdateSessions | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _RunSysbench(vms, metadata, benchmark_spec, sysbench_thread_count):
"""Runs the Sysbench OLTP test.
Args:
vms: The VMs that will issue the sysbench test.
metadata: The PKB metadata to be passed along to the final results.
benchmark_spec: The benchmark specification. Contains all data that is
... | Runs the Sysbench OLTP test.
Args:
vms: The VMs that will issue the sysbench test.
metadata: The PKB metadata to be passed along to the final results.
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
sysbench_thread_count: The number of clien... | _RunSysbench | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _RunScaleUpClientsBenchmark(
vms, run_seconds, benchmark_spec, sysbench_thread_count, metadata
):
"""Runs the Scale Up Clients benchmark. Only TPS and QPS is supported."""
scale_up_samples = []
for i in range(1, _SCALEUP_CLIENTS_TEST_NUM_CLIENTS.value + 1):
new_metadata = metadata.copy()
new_metad... | Runs the Scale Up Clients benchmark. Only TPS and QPS is supported. | _RunScaleUpClientsBenchmark | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run the sysbench benchmark and publish results.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
Results.
"""
logging.info('Start benchmarking, Cloud Provider is %s.', FLAGS.cloud)
results = []
... | Run the sysbench benchmark and publish results.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
Results.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_benchmark.py | Apache-2.0 |
def _ParseSysbenchMemoryOutput(sysbench_memory_output: str) -> List[float]:
"""Parses sysbench_memory output.
Extract relevant TPS numbers.
Args:
sysbench_memory_output: The output from sysbench.
Returns:
An array, the tps numbers.
"""
tps_numbers = []
sysbench_memory_output_io = io.StringIO(s... | Parses sysbench_memory output.
Extract relevant TPS numbers.
Args:
sysbench_memory_output: The output from sysbench.
Returns:
An array, the tps numbers.
| _ParseSysbenchMemoryOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_memory_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_memory_benchmark.py | Apache-2.0 |
def _AddMetricsFromTPSNumbers(
tps_numbers: List[float],
) -> List[Tuple[str, float, str]]:
"""Computes relevant metrics from tps_numbers.
Specifically, we are interested in min/max/mean/(median-min)/(max-min).
Args:
tps_numbers: TPS numbers for each vCPU.
Returns:
An array, the tps metrics.
""... | Computes relevant metrics from tps_numbers.
Specifically, we are interested in min/max/mean/(median-min)/(max-min).
Args:
tps_numbers: TPS numbers for each vCPU.
Returns:
An array, the tps metrics.
| _AddMetricsFromTPSNumbers | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_memory_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_memory_benchmark.py | Apache-2.0 |
def GenerateMetricsForSysbenchMemoryOutput(
sysbench_memory_output: str, metadata: Dict[str, Any]
) -> List[sample.Sample]:
"""Generates results, an array of samples from sysbench_memory output.
Obtains TPS metrics from _ParseSysbenchMemoryOutput and generates samples.
Args:
sysbench_memory_output: The ... | Generates results, an array of samples from sysbench_memory output.
Obtains TPS metrics from _ParseSysbenchMemoryOutput and generates samples.
Args:
sysbench_memory_output: The output from sysbench.
metadata: associated metadata
Returns:
results: a list of Samples
| GenerateMetricsForSysbenchMemoryOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/sysbench_memory_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/sysbench_memory_benchmark.py | Apache-2.0 |
def _MakeSamplesFromOutput(metadata, output):
"""Create a sample continaing the measured tensor2tensor throughput.
Args:
metadata: dict contains all the metadata that reports.
output: tensor2tensor output
Returns:
a Sample containing the tensor2tensor throughput
"""
samples = []
samples.exten... | Create a sample continaing the measured tensor2tensor throughput.
Args:
metadata: dict contains all the metadata that reports.
output: tensor2tensor output
Returns:
a Sample containing the tensor2tensor throughput
| _MakeSamplesFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/t2t_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/t2t_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run the Tensor2Tensor model 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.... | Run the Tensor2Tensor model 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/t2t_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/t2t_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run tailbench and return the latency values as a list of histograms.
Args:
benchmark_spec: allows us to access the vm
Returns:
A list sample.Sample objects
"""
samples = []
vm = benchmark_spec.vms[0]
tailbench.RunTailbench(vm, _TESTS.value)
for test in _TESTS.value:... | Run tailbench and return the latency values as a list of histograms.
Args:
benchmark_spec: allows us to access the vm
Returns:
A list sample.Sample objects
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tailbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tailbench_benchmark.py | Apache-2.0 |
def _GetDefaultBatchSizeByModel(model, gpu_type):
"""Return the default batch size for a given model and gpu / cpu type.
If gpu_type is none, it is assumed that the model will be running on the CPU.
If there is no default for the given model and gpu_type, a default batch
size will be returned as defined by DEF... | Return the default batch size for a given model and gpu / cpu type.
If gpu_type is none, it is assumed that the model will be running on the CPU.
If there is no default for the given model and gpu_type, a default batch
size will be returned as defined by DEFAULT_BATCH_SIZE.
Args:
model: name of the Tensor... | _GetDefaultBatchSizeByModel | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _PrepareVm(vm):
"""Install and set up TensorFlow on the target vm.
The TensorFlow benchmarks are also installed.
A specific branch of the benchmarks cnn_tf_v1.10_compatible which works best
with TensorFlow 1.10 is used and can be overridden with the flag
tf_cnn_benchmarks_branch.
Args:
vm: virtual... | Install and set up TensorFlow on the target vm.
The TensorFlow benchmarks are also installed.
A specific branch of the benchmarks cnn_tf_v1.10_compatible which works best
with TensorFlow 1.10 is used and can be overridden with the flag
tf_cnn_benchmarks_branch.
Args:
vm: virtual machine on which to inst... | _PrepareVm | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install and set up TensorFlow on the target vm.
Args:
benchmark_spec: The benchmark specification
"""
_UpdateBenchmarkSpecWithFlags(benchmark_spec)
vms = benchmark_spec.vms
background_tasks.RunThreaded(_PrepareVm, vms)
benchmark_spec.tensorflow_version = tensorflow.Get... | Install and set up TensorFlow on the target vm.
Args:
benchmark_spec: The benchmark specification
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _GetMetadataFromBenchmarkArgs(tf_cnn_benchmark_args):
"""Return a dictionary of arg names and values.
Only supports arguments in the following format:
--arg_name=arg_value
The above string will result in this function returning a dictionary
like so: {'arg_name': 'arg_value'}
Because this and other ... | Return a dictionary of arg names and values.
Only supports arguments in the following format:
--arg_name=arg_value
The above string will result in this function returning a dictionary
like so: {'arg_name': 'arg_value'}
Because this and other PKB benchmarks use the 'precision' flag to specify
fp16 or fp... | _GetMetadataFromBenchmarkArgs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _CreateMetadataDict(benchmark_spec, model, batch_size):
"""Create metadata dict to be used in run results.
Args:
benchmark_spec: benchmark spec
model: model which was run
batch_size: batch sized used
Returns:
metadata dict
"""
vm = benchmark_spec.vms[0]
metadata = {}
if nvidia_driver... | Create metadata dict to be used in run results.
Args:
benchmark_spec: benchmark spec
model: model which was run
batch_size: batch sized used
Returns:
metadata dict
| _CreateMetadataDict | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _ExtractThroughput(output):
"""Extract throughput from TensorFlow output.
Args:
output: TensorFlow output
Returns:
throuput (float)
"""
regex = r'total images/sec: (\S+)'
try:
return regex_util.ExtractFloat(regex, output)
except:
raise TFParseOutputException('Unable to parse TensorFl... | Extract throughput from TensorFlow output.
Args:
output: TensorFlow output
Returns:
throuput (float)
| _ExtractThroughput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _ExtractTfParameterServerPid(output):
"""Extract the process identification number from TensorFlow parameter server.
Args:
output: string, Remote command output
Returns:
string, process identification number from TensorFlow parameter server
Raises:
TFParsePsPidException
"""
regex = r'{pid... | Extract the process identification number from TensorFlow parameter server.
Args:
output: string, Remote command output
Returns:
string, process identification number from TensorFlow parameter server
Raises:
TFParsePsPidException
| _ExtractTfParameterServerPid | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _MakeSamplesFromOutput(benchmark_spec, output, model, batch_size):
"""Create a sample containing the measured TensorFlow throughput.
Args:
benchmark_spec: benchmark spec
output: TensorFlow output
model: model which was run
batch_size: batch sized used
Returns:
a Sample containing the Ten... | Create a sample containing the measured TensorFlow throughput.
Args:
benchmark_spec: benchmark spec
output: TensorFlow output
model: model which was run
batch_size: batch sized used
Returns:
a Sample containing the TensorFlow throughput in Gflops
| _MakeSamplesFromOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _GetTfCnnBenchmarkCommand(
vm, model, batch_size, benchmark_spec, args='', job_name=''
):
"""Create the command used to run the tf_cnn_benchmarks script.
The command is either formulated using flag values stored on the
benchmark_spec, or is essentially provided outright through the
benchmark_args flag.... | Create the command used to run the tf_cnn_benchmarks script.
The command is either formulated using flag values stored on the
benchmark_spec, or is essentially provided outright through the
benchmark_args flag.
Args:
vm: the VM to run on.
model: name of the model to run.
batch_size: batch size to ... | _GetTfCnnBenchmarkCommand | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _RunModelOnVm(vm, model, batch_size, benchmark_spec, args='', job_name=''):
"""Runs a TensorFlow benchmark on a single VM.
Args:
vm: VM to run on
model: string, the name of model to run
batch_size: int, training batch size
benchmark_spec: BenchmarkSpec object
args: string, distributed argum... | Runs a TensorFlow benchmark on a single VM.
Args:
vm: VM to run on
model: string, the name of model to run
batch_size: int, training batch size
benchmark_spec: BenchmarkSpec object
args: string, distributed arguments
job_name: string, distributed job name
Returns:
a Sample containing t... | _RunModelOnVm | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _RunOnVm(vm, benchmark_spec):
"""Runs a TensorFlow benchmark on a single VM.
Args:
vm: VM to run on
benchmark_spec: benchmark_spec object
Returns:
A list of samples containing the TensorFlow throughput from different models
"""
samples = []
if FLAGS.tf_benchmark_args:
return [_RunModel... | Runs a TensorFlow benchmark on a single VM.
Args:
vm: VM to run on
benchmark_spec: benchmark_spec object
Returns:
A list of samples containing the TensorFlow throughput from different models
| _RunOnVm | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _RunDistributedTf(benchmark_spec):
"""Run distributed TensorFlow for each model specified.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
ps_hosts = benchmark_spec.vm_groups['paramet... | Run distributed TensorFlow for each model specified.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| _RunDistributedTf | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _RunTf(benchmark_spec):
"""Run TensorFlow for each model specified.
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
args = [((vm, benchmark_spec), {}) for vm... | Run TensorFlow for each model specified.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
| _RunTf | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run TensorFlow on the cluster for each model specified.
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)
if bench... | Run TensorFlow on the cluster for each model specified.
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/tensorflow_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_benchmark.py | Apache-2.0 |
def _PrepareClient(vm):
"""Installs Tensorflow Serving on a single client vm.
Args:
vm: client vm to operate on
"""
logging.info('Installing Tensorflow Serving on client %s', vm)
vm.Install('tensorflow_serving')
vm.InstallPreprovisionedBenchmarkData(
BENCHMARK_NAME, [ILSVRC_VALIDATION_IMAGES_TAR]... | Installs Tensorflow Serving on a single client vm.
Args:
vm: client vm to operate on
| _PrepareClient | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def _PrepareServer(vm):
"""Installs Tensorflow Serving on a single server vm.
Args:
vm: server vm to operate on
"""
logging.info('Installing Tensorflow Serving on server %s', vm)
vm.Install('tensorflow_serving')
vm.InstallPreprovisionedBenchmarkData(
BENCHMARK_NAME, [RESNET_NHWC_SAVEDMODEL_TGZ], ... | Installs Tensorflow Serving on a single server vm.
Args:
vm: server vm to operate on
| _PrepareServer | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Installs and prepares Tensorflow Serving on the target vms.
Clients and servers are prepared in parallel using RunThreaded.
Args:
benchmark_spec: The benchmark specification
"""
servers = benchmark_spec.vm_groups['servers']
clients = benchmark_spec.vm_groups['clients']
... | Installs and prepares Tensorflow Serving on the target vms.
Clients and servers are prepared in parallel using RunThreaded.
Args:
benchmark_spec: The benchmark specification
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def _CreateMetadataDict(benchmark_spec, client_thread_count):
"""Creates a metadata dict to be added to run results samples.
Args:
benchmark_spec: The benchmark specification.
client_thread_count: The client thread count used for this particular run.
Returns:
A dict of metadata to be added to sample... | Creates a metadata dict to be added to run results samples.
Args:
benchmark_spec: The benchmark specification.
client_thread_count: The client thread count used for this particular run.
Returns:
A dict of metadata to be added to samples.
| _CreateMetadataDict | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def _StartServer(vm):
"""Starts the tensorflow_model_server binary.
Args:
vm: The server VM.
"""
model_download_directory = posixpath.join(TF_SERVING_BASE_DIRECTORY, 'resnet')
# Use the docker development image to build the inception model
vm.RemoteCommand(
'sudo docker run -d --rm --name tfserv... | Starts the tensorflow_model_server binary.
Args:
vm: The server VM.
| _StartServer | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def _StartClient(vm, server_ip, client_thread_count):
"""Pushes and starts the client workload script.
Args:
vm: The client VM.
server_ip: The server's ip address.
client_thread_count: The client thread count used for this particular run.
Returns:
Stdout from CLIENT_SCRIPT
Raises:
ClientW... | Pushes and starts the client workload script.
Args:
vm: The client VM.
server_ip: The server's ip address.
client_thread_count: The client thread count used for this particular run.
Returns:
Stdout from CLIENT_SCRIPT
Raises:
ClientWorkloadScriptExecutionError: if an error occurred during ex... | _StartClient | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def _CreateSingleSample(sample_name, sample_units, metadata, client_stdout):
"""Creates a sample from the tensorflow_serving_client_workload stdout.
client_stdout is expected to contain output in the following format:
key1: int_or_float_value_1
key2: int_or_float_value_2
Args:
sample_name: Name of t... | Creates a sample from the tensorflow_serving_client_workload stdout.
client_stdout is expected to contain output in the following format:
key1: int_or_float_value_1
key2: int_or_float_value_2
Args:
sample_name: Name of the sample. Used to create a regex to extract the value
from client_stdout. A... | _CreateSingleSample | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def _CreateLatenciesSample(metadata, client_stdout):
"""Extracts latency samples from client_stdout.
Assumes latency samples start one line after 'Latencies:'
and continue until the end of the file, and that each latency sample
is on its own line.
Args:
metadata: Metadata to be added to the returned sam... | Extracts latency samples from client_stdout.
Assumes latency samples start one line after 'Latencies:'
and continue until the end of the file, and that each latency sample
is on its own line.
Args:
metadata: Metadata to be added to the returned sample
client_stdout: Stdout from tensorflow_serving_clie... | _CreateLatenciesSample | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def _MakeSamplesFromClientOutput(
benchmark_spec, client_stdout, client_thread_count
):
"""Returns an array of samples extracted from client_stdout.
Args:
benchmark_spec: The benchmark specification.
client_stdout: Stdout from tensorflow_serving_client_workload.py.
client_thread_count: The client t... | Returns an array of samples extracted from client_stdout.
Args:
benchmark_spec: The benchmark specification.
client_stdout: Stdout from tensorflow_serving_client_workload.py.
client_thread_count: The client thread count used for this particular run.
Returns:
A list of samples extracted from client... | _MakeSamplesFromClientOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs Tensorflow Serving benchmark.
Args:
benchmark_spec: The benchmark specification.
Returns:
A list of sample.Sample objects.
"""
server = benchmark_spec.vm_groups['servers'][0]
client = benchmark_spec.vm_groups['clients'][0]
_StartServer(server)
client.PushDataF... | Runs Tensorflow Serving benchmark.
Args:
benchmark_spec: The benchmark specification.
Returns:
A list of sample.Sample objects.
| Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec):
"""Cleans up Tensorflow Serving.
Args:
benchmark_spec: The benchmark specification.
"""
servers = benchmark_spec.vm_groups['servers']
clients = benchmark_spec.vm_groups['clients']
def _CleanupServer(vm):
vm.RemoteCommand('sudo docker stop tfserving-server || true')
... | Cleans up Tensorflow Serving.
Args:
benchmark_spec: The benchmark specification.
| Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tensorflow_serving_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install tomcat on one VM and wrk on another.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
tomcat_vm = benchmark_spec.vm_groups['server'][0]
wrk_vm = benchmark_spec.vm_groups['client'][0]
tomcat_vm.... | Install tomcat on one VM and wrk 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/tomcat_wrk_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tomcat_wrk_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run wrk against tomcat.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample objects.
"""
tomcat_vm = benchmark_spec.vm_groups['server'][0]
wrk_vm = benchmark_spec.vm_groups['c... | Run wrk against tomcat.
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/tomcat_wrk_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tomcat_wrk_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec):
"""Remove tomcat and wrk.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
tomcat_vm = benchmark_spec.vm_groups['server'][0]
tomcat.Stop(tomcat_vm)
background_tasks.RunThreaded(_RemoveOpenFileLimit, benchm... | Remove tomcat and wrk.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/tomcat_wrk_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/tomcat_wrk_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install Unixbench 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('Unixbench prepare on %s', vm)
vm.Install('unixbench')
if FLAG... | Install Unixbench 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/unixbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/unixbench_benchmark.py | Apache-2.0 |
def ParseResults(results):
"""Result parser for UnixBench.
Sample Results:
1 CPUs in system; running 1 parallel copy of tests
8 CPUs in system; running 8 parallel copies of tests
Double-Precision Whetstone 4022.0 MWIPS (9.9 s, 7 samples)
Execl Throughput 4735... | Result parser for UnixBench.
Sample Results:
1 CPUs in system; running 1 parallel copy of tests
8 CPUs in system; running 8 parallel copies of tests
Double-Precision Whetstone 4022.0 MWIPS (9.9 s, 7 samples)
Execl Throughput 4735.8 lps (29.8 s, 2 samples)
F... | ParseResults | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/unixbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/unixbench_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run UnixBench 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('UnixBench running on %s',... | Run UnixBench 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/unixbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/unixbench_benchmark.py | Apache-2.0 |
def GetConfig(user_config):
"""Get the benchmark config, applying user overrides.
Args:
user_config:
Returns:
Benchmark config.
"""
config = configs.LoadConfig(BENCHMARK_CONFIG, user_config, BENCHMARK_NAME)
# Instead of changing the default data dir of database in (multiple) configs,
# Force the... | Get the benchmark config, applying user overrides.
Args:
user_config:
Returns:
Benchmark config.
| GetConfig | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/unmanaged_mysql_sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/unmanaged_mysql_sysbench_benchmark.py | Apache-2.0 |
def GetBufferPoolSize():
"""Get buffer pool size from flags."""
if _MYSQL_BUFFER_POOL_SIZE.value:
logging.info(
'Buffer pool size was set with mysql_buffer_pool_sizeflag: %s',
_MYSQL_BUFFER_POOL_SIZE.value,
)
if _MYSQL_BUFFER_POOL_SIZE.value.endswith('B'):
# MySQL expects the buffe... | Get buffer pool size from flags. | GetBufferPoolSize | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/unmanaged_mysql_sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/unmanaged_mysql_sysbench_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec: bm_spec.BenchmarkSpec):
"""Prepare the servers and clients for the benchmark run.
Args:
benchmark_spec:
"""
vms = benchmark_spec.vms
background_tasks.RunThreaded(mysql80.ConfigureSystemSettings, vms)
background_tasks.RunThreaded(lambda vm: vm.Install('mysql80'), vms)
buff... | Prepare the servers and clients for the benchmark run.
Args:
benchmark_spec:
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/unmanaged_mysql_sysbench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/unmanaged_mysql_sysbench_benchmark.py | Apache-2.0 |
def Prepare(spec: benchmark_spec.BenchmarkSpec) -> None:
"""Install FFmpeg and download sample videos on the VM.
Args:
spec: The benchmark specification. Contains all data that is required to run
the benchmark.
"""
vm = spec.vm_groups['default'][0]
home_dir = vm.RemoteCommand('echo $HOME')[0].strip... | Install FFmpeg and download sample videos on the VM.
Args:
spec: The benchmark specification. Contains all data that is required to run
the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/vbench_transcoding_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/vbench_transcoding_benchmark.py | Apache-2.0 |
def RunParallel(spec: benchmark_spec.BenchmarkSpec) -> List[sample.Sample]:
"""Runs multiple Ffmpeg processes concurrently using GNU parallel.
Args:
spec: The benchmark specification.
Returns:
samples: A list of samples including total time to transcode.
"""
vm = spec.vm_groups['default'][0]
sampl... | Runs multiple Ffmpeg processes concurrently using GNU parallel.
Args:
spec: The benchmark specification.
Returns:
samples: A list of samples including total time to transcode.
| RunParallel | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/vbench_transcoding_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/vbench_transcoding_benchmark.py | Apache-2.0 |
def _MeasureStart(
vms: List[virtual_machine.BaseVirtualMachine],
) -> List[sample.Sample]:
"""Measures the times to start the VMs.
Args:
vms: The VMs to perform the measurement on.
Returns:
List of Samples containing the start times and an overall cluster start
time.
"""
before_start_timest... | Measures the times to start the VMs.
Args:
vms: The VMs to perform the measurement on.
Returns:
List of Samples containing the start times and an overall cluster start
time.
| _MeasureStart | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/vm_stop_start_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/vm_stop_start_benchmark.py | Apache-2.0 |
def _MeasureStop(
vms: List[virtual_machine.BaseVirtualMachine],
) -> List[sample.Sample]:
"""Measures the times to stop the VMss.
Args:
vms: The VMs to perform the measurement on.
Returns:
List of Samples containing the stop times and an overall cluster stop
time.
"""
before_stop_timestamp ... | Measures the times to stop the VMss.
Args:
vms: The VMs to perform the measurement on.
Returns:
List of Samples containing the stop times and an overall cluster stop
time.
| _MeasureStop | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/vm_stop_start_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/vm_stop_start_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.