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 Decode(self, value, component_full_name, flag_values):
"""Verify managed_model dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.... | Verify managed_model dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
BaseS... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies edw service dictionary of a benchmark config object.
Args:
value: dict edw service config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
fl... | Verifies edw service dictionary of a benchmark config object.
Args:
value: dict edw service config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def _GetOptionDecoderConstructions(cls):
"""Gets decoder classes and constructor args for each configurable option.
Returns:
dict. Maps option name string to a (ConfigOptionDecoder class, dict) pair.
The pair specifies a decoder class and its __init__() keyword arguments to
construct in order... | Gets decoder classes and constructor args for each configurable option.
Returns:
dict. Maps option name string to a (ConfigOptionDecoder class, dict) pair.
The pair specifies a decoder class and its __init__() keyword arguments to
construct in order to decode the named option.
| _GetOptionDecoderConstructions | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def _ApplyFlags(cls, config_values, flag_values):
"""Modifies config options based on runtime flag values.
Can be overridden by derived classes to add support for specific flags.
Args:
config_values: dict mapping config option names to provided values. May be
modified by this function.
... | Modifies config options based on runtime flag values.
Can be overridden by derived classes to add support for specific flags.
Args:
config_values: dict mapping config option names to provided values. May be
modified by this function.
flag_values: flags.FlagValues. Runtime flags that ma... | _ApplyFlags | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies edw compute resource dictionary of a benchmark config object.
Args:
value: dict edw_compute_resource config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the confi... | Verifies edw compute resource dictionary of a benchmark config object.
Args:
value: dict edw_compute_resource config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag value... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies placement_group_specs dictionary of a benchmark config object.
Args:
value: dict mapping Placement Group Spec name string to the corresponding
placement group spec config dict.
component_full_name: string. Fully qualifie... | Verifies placement_group_specs dictionary of a benchmark config object.
Args:
value: dict mapping Placement Group Spec name string to the corresponding
placement group spec config dict.
component_full_name: string. Fully qualified name of the configurable
component containing the config... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verify relational_db dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.... | Verify relational_db dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
BaseS... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verify non_relational_db dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: fl... | Verify non_relational_db dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
B... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verify tpu dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues... | Verify tpu dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
BaseSpec constr... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def _ApplyFlags(cls, config_values, flag_values):
"""Modifies config options based on runtime flag values.
Args:
config_values: dict mapping config option names to provided values. May be
modified by this function.
flag_values: flags.FlagValues. Runtime flags that may override the
p... | Modifies config options based on runtime flag values.
Args:
config_values: dict mapping config option names to provided values. May be
modified by this function.
flag_values: flags.FlagValues. Runtime flags that may override the
provided config values.
| _ApplyFlags | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verify memory_store dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.F... | Verify memory_store dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
BaseSp... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verify vpn_service dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.Fl... | Verify vpn_service dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
BaseSpe... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifys app_groups dictionary of a benchmark config object.
Args:
value: dict. Config dictionary.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: fl... | Verifys app_groups dictionary of a benchmark config object.
Args:
value: dict. Config dictionary.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
Ba... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verify app_service dict of a benchmark config object.
Args:
value: dict. Config dictionary.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.Fl... | Verify app_service dict of a benchmark config object.
Args:
value: dict. Config dictionary.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
BaseSpec... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verify messaging_service dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: fl... | Verify messaging_service dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
B... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verify data_discovery_service dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_value... | Verify data_discovery_service dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies the key dict of a benchmark config object."""
key_config = super().Decode(value, component_full_name, flag_values)
if 'cloud' in key_config:
providers.LoadProvider(key_config['cloud'])
key_spec_class = key.GetKeySpecClass(key... | Verifies the key dict of a benchmark config object. | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def __init__(self, component_full_name, expected_os_types=None, **kwargs):
"""Initializes a BenchmarkConfigSpec.
Args:
component_full_name: string. Fully qualified name of the benchmark config
dict within the config file.
expected_os_types: Optional series of strings from os_types.ALL.
... | Initializes a BenchmarkConfigSpec.
Args:
component_full_name: string. Fully qualified name of the benchmark config
dict within the config file.
expected_os_types: Optional series of strings from os_types.ALL.
**kwargs: Keyword arguments for the BaseSpec constructor.
Raises:
err... | __init__ | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def _GetOptionDecoderConstructions(cls):
"""Gets decoder classes and constructor args for each configurable option.
Can be overridden by derived classes to add options or impose additional
requirements on existing options.
Returns:
dict. Maps option name string to a (ConfigOptionDecoder class, d... | Gets decoder classes and constructor args for each configurable option.
Can be overridden by derived classes to add options or impose additional
requirements on existing options.
Returns:
dict. Maps option name string to a (ConfigOptionDecoder class, dict) pair.
The pair specifies a decoder cl... | _GetOptionDecoderConstructions | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def _DecodeAndInit(self, component_full_name, config, decoders, flag_values):
"""Initializes spec attributes from provided config option values.
Args:
component_full_name: string. Fully qualified name of the configurable
component containing the config options.
config: dict mapping option n... | Initializes spec attributes from provided config option values.
Args:
component_full_name: string. Fully qualified name of the configurable
component containing the config options.
config: dict mapping option name string to option value.
decoders: OrderedDict mapping option name string to... | _DecodeAndInit | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/benchmark_config_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/benchmark_config_spec.py | Apache-2.0 |
def _ApplyFlags(
cls, config_values: dict[str, Any], flag_values: flags.FlagValues
):
"""Apply flag settings to the container spec."""
super()._ApplyFlags(config_values, flag_values)
if flag_values['image'].present:
config_values['image'] = flag_values.image
if flag_values['static_containe... | Apply flag settings to the container spec. | _ApplyFlags | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/container_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/container_spec.py | Apache-2.0 |
def _ApplyFlags(
cls, config_values: dict[str, Any], flag_values: flags.FlagValues
):
"""Apply flag values to the spec."""
super()._ApplyFlags(config_values, flag_values)
if flag_values['cloud'].present or 'cloud' not in config_values:
config_values['cloud'] = flag_values.cloud
updated_spe... | Apply flag values to the spec. | _ApplyFlags | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/container_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/container_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies container_registry dictionary of a benchmark config object.
Args:
value: dict mapping VM group name string to the corresponding container
spec config dict.
component_full_name: string. Fully qualified name of the configu... | Verifies container_registry dictionary of a benchmark config object.
Args:
value: dict mapping VM group name string to the corresponding container
spec config dict.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_v... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/container_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/container_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies container_specs dictionary of a benchmark config object.
Args:
value: dict mapping VM group name string to the corresponding container
spec config dict.
component_full_name: string. Fully qualified name of the configurab... | Verifies container_specs dictionary of a benchmark config object.
Args:
value: dict mapping VM group name string to the corresponding container
spec config dict.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_valu... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/container_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/container_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verify Nodepool dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagV... | Verify Nodepool dict of a benchmark config object.
Args:
value: dict. Config dictionary
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
BaseSpec c... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/container_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/container_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Decodes the sandbox configuration option of a nodepool.
Args:
value: Dictionary with the sandbox config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_val... | Decodes the sandbox configuration option of a nodepool.
Args:
value: Dictionary with the sandbox config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/container_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/container_spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies container_cluster dictionary of a benchmark config object."""
cluster_config = super().Decode(value, component_full_name, flag_values)
return ContainerClusterSpec(
self._GetOptionFullName(component_full_name),
flag_value... | Verifies container_cluster dictionary of a benchmark config object. | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/container_spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/container_spec.py | Apache-2.0 |
def __init__(self, option=None, **kwargs):
"""Initializes a ConfigOptionDecoder.
Args:
option: None or string. Name of the config option.
**kwargs: May optionally contain a 'default' key mapping to a value or
callable object. If a value is provided, the config option is optional,
an... | Initializes a ConfigOptionDecoder.
Args:
option: None or string. Name of the config option.
**kwargs: May optionally contain a 'default' key mapping to a value or
callable object. If a value is provided, the config option is optional,
and the provided value is the default if the user do... | __init__ | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def _GetOptionFullName(self, component_full_name):
"""Returns the fully qualified name of a config option.
Args:
component_full_name: string. Fully qualified name of a configurable object
to which the option belongs.
"""
return (
component_full_name
if self.option is None
... | Returns the fully qualified name of a config option.
Args:
component_full_name: string. Fully qualified name of a configurable object
to which the option belongs.
| _GetOptionFullName | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def default(self):
"""Gets the config option's default value.
Returns:
Default value of an optional config option.
"""
assert not self.required, (
'Attempted to get the default value of required config option '
'"{}".'.format(self.option)
)
if hasattr(self._default, '__cal... | Gets the config option's default value.
Returns:
Default value of an optional config option.
| default | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def __init__(self, valid_values, **kwargs):
"""Initializes the EnumVerifier.
Args:
valid_values: list of the allowed values
**kwargs: Keyword arguments to pass to the base class.
"""
super().__init__(**kwargs)
self.valid_values = valid_values | Initializes the EnumVerifier.
Args:
valid_values: list of the allowed values
**kwargs: Keyword arguments to pass to the base class.
| __init__ | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies that the provided value is in the allowed set.
Args:
value: The value specified in the config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_val... | Verifies that the provided value is in the allowed set.
Args:
value: The value specified in the config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def __init__(self, valid_types=(dict,), none_ok=False, **kwargs):
"""Initializes a TypeVerifier.
Args:
valid_types: tuple of allowed types.
none_ok: boolean. If True, None is also an allowed option value.
**kwargs: Keyword arguments to pass to the base class.
"""
super().__init__(**kw... | Initializes a TypeVerifier.
Args:
valid_types: tuple of allowed types.
none_ok: boolean. If True, None is also an allowed option value.
**kwargs: Keyword arguments to pass to the base class.
| __init__ | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies that the provided value is of an allowed type.
Args:
value: The value specified in the config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_valu... | Verifies that the provided value is of an allowed type.
Args:
value: The value specified in the config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies that the provided value is an int.
Args:
value: The value specified in the config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.Fl... | Verifies that the provided value is an int.
Args:
value: The value specified in the config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
BaseSpec... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies that the provided value is a float.
Args:
value: The value specified in the config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.F... | Verifies that the provided value is a float.
Args:
value: The value specified in the config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagated to
BaseSpe... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def __init__(self, item_decoder, **kwargs):
"""Initializes a ListDecoder.
Args:
item_decoder: ConfigOptionDecoder. Used to decode the items of an input
list.
**kwargs: Keyword arguments to pass to the base class.
"""
super().__init__((list,), **kwargs)
self._item_decoder = item_... | Initializes a ListDecoder.
Args:
item_decoder: ConfigOptionDecoder. Used to decode the items of an input
list.
**kwargs: Keyword arguments to pass to the base class.
| __init__ | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies that the provided value is a list with appropriate items.
Args:
value: The value specified in the config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
... | Verifies that the provided value is a list with appropriate items.
Args:
value: The value specified in the config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propaga... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/option_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/option_decoders.py | Apache-2.0 |
def GetSpecClass(base_class, **kwargs) -> 'BaseSpecMetaClass':
"""Returns the subclass with the corresponding attributes.
Args:
base_class: The base class of the resource to return (e.g. BaseVmSpec).
**kwargs: Every attribute/value of the subclass's ATTRS that were used to
register the subclass.
R... | Returns the subclass with the corresponding attributes.
Args:
base_class: The base class of the resource to return (e.g. BaseVmSpec).
**kwargs: Every attribute/value of the subclass's ATTRS that were used to
register the subclass.
Raises:
Exception: If class found was not a subclass of base clas... | GetSpecClass | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/spec.py | Apache-2.0 |
def __init__(
self,
component_full_name: str,
flag_values: flags.FlagValues | None = None,
**kwargs: Any,
):
"""Initializes a BaseSpec.
Translates keyword arguments via the class's decoders and assigns the
corresponding instance attribute. Derived classes can register decoders
... | Initializes a BaseSpec.
Translates keyword arguments via the class's decoders and assigns the
corresponding instance attribute. Derived classes can register decoders
for additional attributes by overriding _GetOptionDecoderConstructions
and can add support for additional flags by overriding _ApplyFlags... | __init__ | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/spec.py | Apache-2.0 |
def _DecodersToString(self):
"""Returns a string representation of the decoders."""
if not self._decoders:
return 'Decoders not initialized'
decoder_names = [
f'{arg}: {decoder.__class__.__name__}'
for arg, decoder in self._decoders.items()
]
return '{' + ',\n'.join(decoder_nam... | Returns a string representation of the decoders. | _DecodersToString | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/spec.py | Apache-2.0 |
def _InitDecoders(cls):
"""Creates a ConfigOptionDecoder for each config option.
Populates cls._decoders and cls._required_options.
"""
with cls._init_decoders_lock:
if not cls._decoders:
constructions = cls._GetOptionDecoderConstructions()
for option, decoder_construction in sort... | Creates a ConfigOptionDecoder for each config option.
Populates cls._decoders and cls._required_options.
| _InitDecoders | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Decodes the disk_spec or vm_spec option of a VM group config object.
Args:
value: None or dict mapping cloud provider name string to a dict.
component_full_name: string. Fully qualified name of the configurable
component containi... | Decodes the disk_spec or vm_spec option of a VM group config object.
Args:
value: None or dict mapping cloud provider name string to a dict.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/spec.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/spec.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Decodes an item of the static_vms list of a VM group config object.
Args:
value: dict mapping static VM config option name string to corresponding
option value.
component_full_name: string. Fully qualified name of the configurabl... | Decodes an item of the static_vms list of a VM group config object.
Args:
value: dict mapping static VM config option name string to corresponding
option value.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_value... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/static_vm_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/static_vm_decoders.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies vm_groups dictionary of a benchmark config object.
Args:
value: dict mapping VM group name string to the corresponding VM group
config dict.
component_full_name: string. Fully qualified name of the configurable
c... | Verifies vm_groups dictionary of a benchmark config object.
Args:
value: dict mapping VM group name string to the corresponding VM group
config dict.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.Fl... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/vm_group_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/vm_group_decoders.py | Apache-2.0 |
def Decode(self, value, component_full_name, flag_values):
"""Verifies vm_groups dictionary of a benchmark config object.
Args:
value: dict corresponding to a VM group config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
... | Verifies vm_groups dictionary of a benchmark config object.
Args:
value: dict corresponding to a VM group config.
component_full_name: string. Fully qualified name of the configurable
component containing the config option.
flag_values: flags.FlagValues. Runtime flag values to be propagat... | Decode | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/vm_group_decoders.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/vm_group_decoders.py | Apache-2.0 |
def _GetImportFiles(config_file, imported_set=None):
"""Get a list of file names that get imported from config_file.
Args:
config_file: The name of a config file to find imports for.
imported_set: A set of files that _GetImportFiles has already been called on
that should be ignored.
Returns:
A... | Get a list of file names that get imported from config_file.
Args:
config_file: The name of a config file to find imports for.
imported_set: A set of files that _GetImportFiles has already been called on
that should be ignored.
Returns:
A list of file names that are imported by config_file
(... | _GetImportFiles | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/__init__.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/__init__.py | Apache-2.0 |
def _LoadUserConfig(path):
"""Loads a user config from the supplied path."""
config_files = _GetImportFiles(path)
with contextlib.ExitStack() as stack:
files = [stack.enter_context(open(f)) for f in config_files]
return yaml.safe_load(_ConcatenatedFiles(files)) | Loads a user config from the supplied path. | _LoadUserConfig | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/__init__.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/__init__.py | Apache-2.0 |
def _GetConfigFromOverrides(overrides):
"""Converts a list of overrides into a config."""
config = {}
for override in overrides:
if override.count('=') != 1:
raise ValueError(
'--config_override flag value has incorrect number of '
'"=" characters. The value must take the form '
... | Converts a list of overrides into a config. | _GetConfigFromOverrides | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/__init__.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/__init__.py | Apache-2.0 |
def GetDefaultAndUserConfig():
"""Returns the user config merged with a default config, with any overrides applied.
This loads configs from --benchmark_config_file, merges it with
default_config, which is then merged with any overrides specified via
--config_override and returns the result. These configs are d... | Returns the user config merged with a default config, with any overrides applied.
This loads configs from --benchmark_config_file, merges it with
default_config, which is then merged with any overrides specified via
--config_override and returns the result. These configs are different from the
BENCHMARK_CONFIG... | GetDefaultAndUserConfig | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/__init__.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/__init__.py | Apache-2.0 |
def MergeConfigs(default_config, override_config, warn_new_key=False):
"""Merges the override config into the default config.
This function will recursively merge two nested dicts.
The override_config represents overrides to the default_config dict, so any
leaf key/value pairs which are present in both dicts w... | Merges the override config into the default config.
This function will recursively merge two nested dicts.
The override_config represents overrides to the default_config dict, so any
leaf key/value pairs which are present in both dicts will take their value
from the override_config.
Args:
default_config... | MergeConfigs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/__init__.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/__init__.py | Apache-2.0 |
def LoadMinimalConfig(benchmark_config, benchmark_name):
"""Loads a benchmark config without using any flags in the process.
This function will prepend configs/default_config_constants.yaml to the
benchmark config prior to loading it. This allows the config to use
references to anchors defined in the constants... | Loads a benchmark config without using any flags in the process.
This function will prepend configs/default_config_constants.yaml to the
benchmark config prior to loading it. This allows the config to use
references to anchors defined in the constants file.
Args:
benchmark_config: str. The default config ... | LoadMinimalConfig | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/__init__.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/__init__.py | Apache-2.0 |
def LoadConfig(benchmark_config, user_config, benchmark_name):
"""Loads a benchmark configuration.
This function loads a benchmark's default configuration (in YAML format),
then merges it with any overrides the user provided, and returns the result.
This loaded config is then passed to the benchmark_spec.Bench... | Loads a benchmark configuration.
This function loads a benchmark's default configuration (in YAML format),
then merges it with any overrides the user provided, and returns the result.
This loaded config is then passed to the benchmark_spec.BenchmarkSpec
constructor in order to create a BenchmarkSpec.
Args:
... | LoadConfig | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/configs/__init__.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/configs/__init__.py | Apache-2.0 |
def _GetResourceLoaders():
"""Gets a list of registered ResourceLoaders.
Returns:
List of ResourceLoader instances. FileResourceLoaders for paths in
FLAGS.data_search_paths will be listed first, followed by
DEFAULT_RESOURCE_LOADERS.
"""
loaders = []
# Add all paths to list if they are specified ... | Gets a list of registered ResourceLoaders.
Returns:
List of ResourceLoader instances. FileResourceLoaders for paths in
FLAGS.data_search_paths will be listed first, followed by
DEFAULT_RESOURCE_LOADERS.
| _GetResourceLoaders | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/__init__.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/__init__.py | Apache-2.0 |
def ResourcePath(resource_name, search_user_paths=True):
"""Gets the filename of a resource.
Loaders are searched in order until the resource is found.
If no loader provides 'resource_name', an exception is thrown.
If 'search_user_paths' is true, the directories specified by
"--data_search_paths" are consul... | Gets the filename of a resource.
Loaders are searched in order until the resource is found.
If no loader provides 'resource_name', an exception is thrown.
If 'search_user_paths' is true, the directories specified by
"--data_search_paths" are consulted before the default paths.
Args:
resource_name: stri... | ResourcePath | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/__init__.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/__init__.py | Apache-2.0 |
def ResourceExists(resource_name, search_user_paths=True):
"""Returns True if a resource exists.
Loaders are searched in order until the resource is found.
If no loader provides 'resource_name', returns False.
If 'search_user_paths' is true, the directories specified by
"--data_search_paths" are consulted b... | Returns True if a resource exists.
Loaders are searched in order until the resource is found.
If no loader provides 'resource_name', returns False.
If 'search_user_paths' is true, the directories specified by
"--data_search_paths" are consulted before the default paths.
Args:
resource_name: string. Nam... | ResourceExists | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/__init__.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/__init__.py | Apache-2.0 |
def calculate_fibonacci(n):
"""Returns the nth Fibonacci number (inefficient for the sake of CPU load).
Args:
n: nth Fibonacci number to be calculated.
"""
if n <= 1:
return n
else:
return calculate_fibonacci(n - 1) + calculate_fibonacci(n - 2) | Returns the nth Fibonacci number (inefficient for the sake of CPU load).
Args:
n: nth Fibonacci number to be calculated.
| calculate_fibonacci | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/docker/fibonacci/perf_server.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/docker/fibonacci/perf_server.py | Apache-2.0 |
def manage_streams():
"""Method to launch concurrent execution of multiple profiles.
Returns:
A dictionary containing
1. wall_time: Total time taken for all the profiles to complete execution.
2. profile details:
2.1. profile_execution_time: Time taken for all scripts in the profile to
comp... | Method to launch concurrent execution of multiple profiles.
Returns:
A dictionary containing
1. wall_time: Total time taken for all the profiles to complete execution.
2. profile details:
2.1. profile_execution_time: Time taken for all scripts in the profile to
complete execution.
2.2. ... | manage_streams | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/edw/multistream_multiprofile_driver.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/edw/multistream_multiprofile_driver.py | Apache-2.0 |
def default_logfile_names(script, suffix):
"""Method to return the names for output and error log files."""
suffix = script.split('.')[0] if suffix is None else suffix
output_logfile = '{}_out.txt'.format(suffix)
error_logfile = '{}_err.txt'.format(suffix)
return output_logfile, error_logfile | Method to return the names for output and error log files. | default_logfile_names | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/edw/script_driver.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/edw/script_driver.py | Apache-2.0 |
def execute_script(script, logfile_suffix):
"""Method to execute a sql script on a EDW cluster.
Arguments:
script: SQL script which contains the query.
logfile_suffix: Suffix to use for the output and error files.
Returns:
Dictionary containing the name of the script and its execution time (-1 if
... | Method to execute a sql script on a EDW cluster.
Arguments:
script: SQL script which contains the query.
logfile_suffix: Suffix to use for the output and error files.
Returns:
Dictionary containing the name of the script and its execution time (-1 if
the script fails)
| execute_script | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/edw/script_driver.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/edw/script_driver.py | Apache-2.0 |
def execute_profile(profile):
"""Method to execute a profile (list of sql scripts) on an edw cluster.
Execute a profile (list of sql scripts, identified by names) on a cluster and
report a dictionary with the execution time.
Arguments:
profile: Profile to identify the sequence of scripts.
Returns:
... | Method to execute a profile (list of sql scripts) on an edw cluster.
Execute a profile (list of sql scripts, identified by names) on a cluster and
report a dictionary with the execution time.
Arguments:
profile: Profile to identify the sequence of scripts.
Returns:
A dictionary containing
1. In... | execute_profile | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/edw/unistream_profile_driver.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/edw/unistream_profile_driver.py | Apache-2.0 |
def generate_provider_specific_cmd_list(script, driver, output, error):
"""Method to compile the BigQuery specific script execution command.
Arguments:
script: SQL script which contains the query.
driver: Driver that contains the BigQuery specific script executor.
output: Output log file.
error: Er... | Method to compile the BigQuery specific script execution command.
Arguments:
script: SQL script which contains the query.
driver: Driver that contains the BigQuery specific script executor.
output: Output log file.
error: Error log file.
Returns:
Command list to execute the supplied script.
| generate_provider_specific_cmd_list | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/edw/athena/provider_specific_script_driver.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/edw/athena/provider_specific_script_driver.py | Apache-2.0 |
def generate_provider_specific_cmd_list(script, driver, output, error):
"""Method to compile the Azure SQL specific script execution command.
Arguments:
script: SQL script which contains the query.
driver: Driver that contains the Azure SQL data warehouse specific script
executor.
output: Output ... | Method to compile the Azure SQL specific script execution command.
Arguments:
script: SQL script which contains the query.
driver: Driver that contains the Azure SQL data warehouse specific script
executor.
output: Output log file.
error: Error log file.
Returns:
Command list to execute ... | generate_provider_specific_cmd_list | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/edw/azuresqldatawarehouse/provider_specific_script_driver.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/edw/azuresqldatawarehouse/provider_specific_script_driver.py | Apache-2.0 |
def generate_provider_specific_cmd_list(script, driver, output, error):
"""Method to compile the Redshift specific script execution command.
Arguments:
script: SQL script which contains the query.
driver: Driver that contains the Redshift specific script executor.
output: Output log file.
error: Er... | Method to compile the Redshift specific script execution command.
Arguments:
script: SQL script which contains the query.
driver: Driver that contains the Redshift specific script executor.
output: Output log file.
error: Error log file.
Returns:
Command list to execute the supplied script.
| generate_provider_specific_cmd_list | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/edw/redshift/provider_specific_script_driver.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/edw/redshift/provider_specific_script_driver.py | Apache-2.0 |
def generate_provider_specific_cmd_list(script, driver, output, error):
"""Method to compile the Snowflake specific script execution command.
Arguments:
script: SQL script which contains the query.
driver: Driver that contains the BigQuery specific script executor.
output: Output log file.
error: E... | Method to compile the Snowflake specific script execution command.
Arguments:
script: SQL script which contains the query.
driver: Driver that contains the BigQuery specific script executor.
output: Output log file.
error: Error log file.
Returns:
Command list to execute the supplied script.
... | generate_provider_specific_cmd_list | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/edw/snowflake_aws/provider_specific_script_driver.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/edw/snowflake_aws/provider_specific_script_driver.py | Apache-2.0 |
def _generate_file_names():
"""Returns a file name as tuple (output, error).. mostly for mocking."""
name_base = str(uuid.uuid4())[:6]
return (name_base + '.out', name_base + '.err') | Returns a file name as tuple (output, error).. mostly for mocking. | _generate_file_names | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/http/poll_http_endpoint.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/http/poll_http_endpoint.py | Apache-2.0 |
def call_curl(
endpoint, headers=None, expected_response_code=None, expected_response=None
):
"""Curl endpoint once and return response.
Args:
endpoint: string. HTTP(S) endpoint to curl.
headers: list. A list of strings, each representing a header.
expected_response_code: string. Expected http resp... | Curl endpoint once and return response.
Args:
endpoint: string. HTTP(S) endpoint to curl.
headers: list. A list of strings, each representing a header.
expected_response_code: string. Expected http response code. Can be either a
string or a regex.
expected_response: string. Expected http respon... | call_curl | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/http/poll_http_endpoint.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/http/poll_http_endpoint.py | Apache-2.0 |
def poll(
endpoint,
headers=None,
max_retries=0,
retry_interval=0.5,
timeout=600,
expected_response_code=None,
expected_response=None,
):
"""Poll HTTP endpoint until expected response code is received or time out.
Args:
endpoint: string. HTTP(S) endpoint to curl.
headers: list. ... | Poll HTTP endpoint until expected response code is received or time out.
Args:
endpoint: string. HTTP(S) endpoint to curl.
headers: list. A list of strings, each representing a header.
max_retries: int. Indicates how many retires before give up.
retry_interval: float. Indicates interval in sec betwee... | poll | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/http/poll_http_endpoint.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/http/poll_http_endpoint.py | Apache-2.0 |
def ConfirmIPAccessible(client_host, port, timeout=MAX_TIME_SECONDS):
"""Confirm the given host's port is accessible and return the access time."""
netcat_command = 'nc -zv -w 1 {client} {port}'.format(
client=client_host, port=port
)
start_time = time.time()
while time.time() <= (start_time + timeout):... | Confirm the given host's port is accessible and return the access time. | ConfirmIPAccessible | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/large_scale_boot/listener_server.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/large_scale_boot/listener_server.py | Apache-2.0 |
def WaitForRunningStatus(client_host, timeout=MAX_TIME_SECONDS):
"""Wait for the VM to report running status.
Status command generated from data/large_scale_boot/vm_status.sh.jinja2.
Args:
client_host: client host to check for running status.
timeout: Max timeout to wait before declaring failure.
Ret... | Wait for the VM to report running status.
Status command generated from data/large_scale_boot/vm_status.sh.jinja2.
Args:
client_host: client host to check for running status.
timeout: Max timeout to wait before declaring failure.
Returns:
host status string.
| WaitForRunningStatus | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/large_scale_boot/listener_server.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/large_scale_boot/listener_server.py | Apache-2.0 |
def WriteResultsToFile(results_path, queue):
"""Write anything in results queue to a file."""
with open(results_path, 'a') as writer:
while True:
result = queue.get()
if result == _STOP_QUEUE_ENTRY:
logging.info('Told to stop writing to file %s from queue', results_path)
return
... | Write anything in results queue to a file. | WriteResultsToFile | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/large_scale_boot/listener_server.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/large_scale_boot/listener_server.py | Apache-2.0 |
def BuildHostNames(name_pattern, count, use_public_ip):
"""Derieve host names from either name pattern or boot logs.
See large_scale_boot benchmark for name_pattern. For example, SEQUENTIAL_IP
name pattern is in the form of 'SEQUENTIAL_IP_{public_dns}_{start_index}'.
Args:
name_pattern: Name pattern to bu... | Derieve host names from either name pattern or boot logs.
See large_scale_boot benchmark for name_pattern. For example, SEQUENTIAL_IP
name pattern is in the form of 'SEQUENTIAL_IP_{public_dns}_{start_index}'.
Args:
name_pattern: Name pattern to build host names with.
count: count of vms.
use_public_... | BuildHostNames | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/large_scale_boot/listener_server.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/large_scale_boot/listener_server.py | Apache-2.0 |
def WaitForHostNames(use_public_ip, timeout=MAX_TIME_SECONDS_NO_CALLING):
"""Wait for boot logs to complete and grep the newly created ips.
After boot_script.sh completes, it will print out [completed].
In boot_script.sh output, outputs will be of the following formats:
GCP:
networkInterfaces[0].accessCon... | Wait for boot logs to complete and grep the newly created ips.
After boot_script.sh completes, it will print out [completed].
In boot_script.sh output, outputs will be of the following formats:
GCP:
networkInterfaces[0].accessConfigs[0].natIP: 34.94.81.165
AWS:
PRIVATEIPADDRESSES True ip-10-0-0-143.ec... | WaitForHostNames | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/large_scale_boot/listener_server.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/large_scale_boot/listener_server.py | Apache-2.0 |
def GenerateHostIPs(boot_vm_index, count):
"""Logic must be aligned with large_scale_boot/boot_script.sh."""
hostnames = []
for vm_id in range(boot_vm_index, boot_vm_index + count):
hostnames.append(
'10.0.{octet3}.{octet4}'.format(octet3=vm_id // 256, octet4=vm_id % 256)
)
return hostnames | Logic must be aligned with large_scale_boot/boot_script.sh. | GenerateHostIPs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/large_scale_boot/listener_server.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/large_scale_boot/listener_server.py | Apache-2.0 |
def __init__(self, pool, launcher, queue, access_port, *args, **kwargs):
"""Creates a RequestHandler for a http request received by the server.
Args:
pool: multiprocessing process pool object.
launcher: name string of the launcher vm that the server is on.
queue: multiprocessing queue object.... | Creates a RequestHandler for a http request received by the server.
Args:
pool: multiprocessing process pool object.
launcher: name string of the launcher vm that the server is on.
queue: multiprocessing queue object.
access_port: port number to call on the booted vms.
*args: Other ar... | __init__ | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/data/large_scale_boot/listener_server.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/data/large_scale_boot/listener_server.py | Apache-2.0 |
def Prepare(benchmark_spec: bm_spec.BenchmarkSpec) -> None:
"""Install Aerospike server and Aerospike tools on the other.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
clients = benchmark_spec.vm_groups['clients']
num_client_vms = le... | Install Aerospike server and Aerospike tools on the other.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Prepare | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/aerospike_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aerospike_benchmark.py | Apache-2.0 |
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> List[sample.Sample]:
"""Runs a read/update load test on Aerospike.
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_spe... | Runs a read/update load test on Aerospike.
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/aerospike_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aerospike_benchmark.py | Apache-2.0 |
def Cleanup(benchmark_spec: bm_spec.BenchmarkSpec) -> None:
"""Cleanup Aerospike.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
servers = benchmark_spec.vm_groups['workers']
clients = benchmark_spec.vm_groups['client']
def StopCli... | Cleanup Aerospike.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
| Cleanup | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/aerospike_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aerospike_benchmark.py | Apache-2.0 |
def GetConfig(user_config):
"""Get benchmark config for act benchmark."""
config = configs.LoadConfig(BENCHMARK_CONFIG, user_config, BENCHMARK_NAME)
if FLAGS.data_disk_type == disk.LOCAL:
config['vm_groups']['default']['disk_count'] = (
config['vm_groups']['default']['disk_count'] or None
)
else... | Get benchmark config for act benchmark. | GetConfig | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/aerospike_certification_tool_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aerospike_certification_tool_benchmark.py | Apache-2.0 |
def CheckPrerequisites(benchmark_config):
"""Verifies that the required resources are present.
Args:
benchmark_config: Unused.
Raises:
perfkitbenchmarker.data.ResourceNotFound: On missing resource.
"""
del benchmark_config
if FLAGS.act_dynamic_load and len(FLAGS.act_load) > 1:
raise errors.Con... | Verifies that the required resources are present.
Args:
benchmark_config: Unused.
Raises:
perfkitbenchmarker.data.ResourceNotFound: On missing resource.
| CheckPrerequisites | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/aerospike_certification_tool_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aerospike_certification_tool_benchmark.py | Apache-2.0 |
def PrepareActConfig(vm, load):
"""Prepare config file for act benchmark."""
if FLAGS.act_parallel:
for i in range(FLAGS.act_reserved_partitions, len(vm.scratch_disks)):
act.PrepActConfig(vm, float(load), i)
else:
act.PrepActConfig(vm, float(load)) | Prepare config file for act benchmark. | PrepareActConfig | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/aerospike_certification_tool_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aerospike_certification_tool_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Runs act and reports the results."""
vm = benchmark_spec.vms[0]
act.RunActPrep(vm)
samples = []
run_samples = []
for load in GenerateLoad():
def _Run(act_load, index):
run_samples.extend(act.RunAct(vm, act_load, index))
PrepareActConfig(vm, load)
if FLAGS.act_... | Runs act and reports the results. | Run | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/aerospike_certification_tool_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aerospike_certification_tool_benchmark.py | Apache-2.0 |
def _ValidateExistingModels(
ai_model: managed_ai_model.BaseManagedAiModel, expected_count: int
) -> int:
"""Validates that no other models are running in the region."""
endpoints = ai_model.ListExistingEndpoints()
# The presence of other models in a region changes startup performance.
if len(endpoints) != ... | Validates that no other models are running in the region. | _ValidateExistingModels | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/ai_model_create_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ai_model_create_benchmark.py | Apache-2.0 |
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> list[sample.Sample]:
"""Run the example benchmark.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample instances.
"""
logging.info('Running Run phase & gat... | Run the example 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/ai_model_create_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ai_model_create_benchmark.py | Apache-2.0 |
def _SendPrompt(
ai_model: managed_ai_model.BaseManagedAiModel,
prompt: str,
):
"""Sends a prompt to the model and prints the response."""
responses = ai_model.SendPrompt(
prompt=prompt, max_tokens=512, temperature=0.8
)
for response in responses:
logging.info('Sent request & got response: %s'... | Sends a prompt to the model and prints the response. | _SendPrompt | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/ai_model_create_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ai_model_create_benchmark.py | Apache-2.0 |
def Run(benchmark_spec: bm_spec.BenchmarkSpec) -> list[sample.Sample]:
"""Runs the throughput benchmark.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
Returns:
A list of sample.Sample instances.
"""
logging.info('Running Run phase &... | Runs the throughput 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/ai_model_throughput_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ai_model_throughput_benchmark.py | Apache-2.0 |
def FindMaxThroughput(
ai_model: managed_ai_model.BaseManagedAiModel,
throughput_script: str,
vm: virtual_machine.BaseVirtualMachine,
) -> list[sample.Sample]:
"""Finds the max throughput for the model."""
command = ai_model.GetPromptCommand(_SHARED_REQUEST, 512, 1.0)
logging.info(
'Finding max ... | Finds the max throughput for the model. | FindMaxThroughput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/ai_model_throughput_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ai_model_throughput_benchmark.py | Apache-2.0 |
def _BurstRequestsOverTime(
command: str,
throughput_script: str,
vm: virtual_machine.BaseVirtualMachine,
burst_requests: int,
) -> list[throughput_load_driver.CommandResponse]:
"""Calls VM to send burst_requests requests in parallel.
Also pulls from flag values from throughput_load_driver. Specifi... | Calls VM to send burst_requests requests in parallel.
Also pulls from flag values from throughput_load_driver. Specifically, the
load test will send burst_requests requests in parallel for
TEST_DURATION seconds, waiting BURST_TIME seconds before sending another
burst.
Args:
command: The command to send ... | _BurstRequestsOverTime | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/ai_model_throughput_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/ai_model_throughput_benchmark.py | Apache-2.0 |
def GetSamples(self, metadata: Dict[str, Any]) -> List[sample.Sample]:
"""Generate a list of samples based on the data stored in this object."""
return [
sample.Sample('Failed requests', self.failed_requests, '', metadata),
sample.Sample(
'Requests per second',
self.reque... | Generate a list of samples based on the data stored in this object. | GetSamples | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/apachebench_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/apachebench_benchmark.py | Apache-2.0 |
def _GetYcsbArgs(
client: virtual_machine.VirtualMachine,
instance: aws_dynamodb.AwsDynamoDBInstance,
) -> dict[str, Any]:
"""Returns args to pass to YCSB."""
run_kwargs = {
'dynamodb.awsCredentialsFile': GetRemoteCredentialsFullPath(client),
'dynamodb.primaryKey': instance.primary_key,
'd... | Returns args to pass to YCSB. | _GetYcsbArgs | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/aws_dynamodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aws_dynamodb_ycsb_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install YCSB on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
benchmark_spec.always_call_cleanup = True
vms = benchmark_spec.vms
# Install required packages.
background_tasks.RunThr... | Install YCSB 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/aws_dynamodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aws_dynamodb_ycsb_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run YCSB 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
instance: aws_dynamodb.AwsDynamoDBInstance = benchmark_spe... | Run YCSB 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/aws_dynamodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aws_dynamodb_ycsb_benchmark.py | Apache-2.0 |
def _GetTargetQps(db: aws_dynamodb.AwsDynamoDBInstance) -> int:
"""Gets the target QPS for eventual and strong reads."""
read_multiplier = 1 if _CONSISTENT_READS.value else 2
rcu = 0 if db.rcu <= 25 else db.rcu * read_multiplier
wcu = 0 if db.wcu <= 25 else db.wcu
return rcu + wcu | Gets the target QPS for eventual and strong reads. | _GetTargetQps | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/aws_dynamodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aws_dynamodb_ycsb_benchmark.py | Apache-2.0 |
def RampUpRun(
executor: ycsb.YCSBExecutor,
db: aws_dynamodb.AwsDynamoDBInstance,
vms: Collection[virtual_machine.VirtualMachine],
run_kwargs: MutableMapping[str, Any],
) -> list[sample.Sample]:
"""Runs YCSB starting from provisioned QPS until max throughput is found."""
# Database is already provis... | Runs YCSB starting from provisioned QPS until max throughput is found. | RampUpRun | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/aws_dynamodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aws_dynamodb_ycsb_benchmark.py | Apache-2.0 |
def GenerateCredentials(vm) -> None:
"""Generates AWS credentials properties file and pushes it to the VM."""
key_id, secret = aws_credentials.GetCredentials(profile=_CLI_PROFILE.value)
with vm_util.NamedTemporaryFile(prefix=AWS_CREDENTIALS_FILE, mode='w') as f:
f.write(f"""
accessKey={key_id}
secretKey={sec... | Generates AWS credentials properties file and pushes it to the VM. | GenerateCredentials | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/aws_dynamodb_ycsb_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/aws_dynamodb_ycsb_benchmark.py | Apache-2.0 |
def CheckPrerequisites(benchmark_config_spec):
"""Verifies that the required resources are present.
Raises:
perfkitbenchmarker.errors.Config.InvalidValue: If no Beam args are provided.
NotImplementedError: If an invalid runner is specified.
"""
if FLAGS.beam_it_options is None and FLAGS.beam_it_args is... | Verifies that the required resources are present.
Raises:
perfkitbenchmarker.errors.Config.InvalidValue: If no Beam args are provided.
NotImplementedError: If an invalid runner is specified.
| CheckPrerequisites | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/beam_integration_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/beam_integration_benchmark.py | Apache-2.0 |
def Prepare(benchmark_spec):
"""Install netperf on the target vm.
Args:
benchmark_spec: The benchmark specification. Contains all data that is
required to run the benchmark.
"""
vms = benchmark_spec.vms
background_tasks.RunThreaded(PrepareNetperf, vms)
num_streams = FLAGS.bidirectional_stream_nu... | Install netperf 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/bidirectional_network_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/bidirectional_network_benchmark.py | Apache-2.0 |
def _ParseNetperfOutput(stdout, metadata, benchmark_name, iteration_id):
"""Parses the stdout of a single netperf process.
Args:
stdout: the stdout of the netperf process
metadata: metadata for any sample.Sample objects we create
benchmark_name: name of the netperf benchmark
iteration_id: the uniqu... | Parses the stdout of a single netperf process.
Args:
stdout: the stdout of the netperf process
metadata: metadata for any sample.Sample objects we create
benchmark_name: name of the netperf benchmark
iteration_id: the unique id of the benchmark within the bidirectional
network benchmark
Retu... | _ParseNetperfOutput | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/bidirectional_network_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/bidirectional_network_benchmark.py | Apache-2.0 |
def RunNetperf(
primary_vm, secondary_vm, benchmark_name, num_streams, iteration, results
):
"""Spawns netperf on a remote VM, parses results.
Args:
primary_vm: The VM that the netperf benchmark will be run upon.
secondary_vm: The VM that the netperf server is running on.
benchmark_name: The netper... | Spawns netperf on a remote VM, parses results.
Args:
primary_vm: The VM that the netperf benchmark will be run upon.
secondary_vm: The VM that the netperf server is running on.
benchmark_name: The netperf benchmark to run, see the documentation.
num_streams: The number of netperf client threads to ru... | RunNetperf | python | GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_benchmarks/bidirectional_network_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/bidirectional_network_benchmark.py | Apache-2.0 |
def Run(benchmark_spec):
"""Run the specified networking tests.
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_tests = len(FLAGS.bidirectional_network_tests... | Run the specified networking tests.
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/bidirectional_network_benchmark.py | https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/blob/master/perfkitbenchmarker/linux_benchmarks/bidirectional_network_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.