BenchMark
This section contains source code documentation of Benchmark extension.
benchmark
Benchmark extension for tuning and testing hydra toolkit performance
-
class
hydratk.extensions.benchmark.benchmark.
Extension
(core_instance=None)
Class Extension
-
_init_extension
()
Method initializes extension
Parameters: | none – |
Returns: | void |
-
_register_actions
()
Method registers actions
Parameters: | none – |
Returns: | void |
-
run_benchmark
()
Method handles command benchmark
Parameters: | none – |
Returns: | void |
-
run_test_groups
()
Method runs requested test groups
Parameters: | none – |
Returns: | void |
-
run_test_group
(group)
Method runs requested test group
Parameters: | group (str) – test group |
Returns: | result |
Return type: | dict |
-
run_test
(mod, test)
Method runs requested test
Parameters: |
- mod (str) – test group module
- test (str) – test method
|
Returns: | result
|
Return type: | list
|
-
gen_report
(result)
Method prepares report
Parameters: | result (dict) – test results |
Returns: | void |
-
calc_stats
(values)
Method calculates statistic parameters
Parameters: | values (list) – test executions in ms |
Returns: | mean, median, min, max, var, stddev, quartile1, quartile3 |
Return type: | tuple |
-
print_report
(data)
Method prints report in table form
Parameters: | data (str) – test results in CSV form |
Returns: | void |
disk
Benchmark tests focused on disk operations
-
hydratk.extensions.benchmark.tests.disk.
file_single
(size=10485760)
Method creates single file
Parameters: | size (int) – size |
Returns: | void |
-
hydratk.extensions.benchmark.tests.disk.
file_mult
(n=1000, size=1024)
Method creates multiple files
Parameters: |
- n (int) – count of files
- size (int) – size
|
Returns: | void
|
-
hydratk.extensions.benchmark.tests.disk.
dir_mult
(n=1000)
Method creates multiple directories
Parameters: | n (int) – count of directories |
Returns: | void |
-
hydratk.extensions.benchmark.tests.disk.
dir_tree
(n=500)
Method creates directory tree
Parameters: | n (int) – tree level |
Returns: | void |
event
Benchmark tests focused on event processing
-
hydratk.extensions.benchmark.tests.event.
throughput
(n=10000)
Method tests event throughput
Parameters: | n (int) – count of events |
Returns: | void |
math
Benchmark tests focused on Math
-
hydratk.extensions.benchmark.tests.math.
factorial
(n=10000)
Method tests factorial calculation
Parameters: | n (int) – n! |
Returns: | void |
-
hydratk.extensions.benchmark.tests.math.
fibonacci
(n=10000)
Method tests Fibonacci number calculation
Parameters: | n (int) – n-th number |
Returns: | void |
-
hydratk.extensions.benchmark.tests.math.
floating_point
(n=1000000)
Method tests floating point arithmetics
Parameters: | n (int) – count of operations |
Returns: | void |
memory
Benchmark tests focused on memory allocation
-
hydratk.extensions.benchmark.tests.memory.
allocate_single
(size=1073741824)
Method allocates memory for single variable
Parameters: | size (int) – size |
Returns: | void |
-
hydratk.extensions.benchmark.tests.memory.
allocate_mult
(n=1000, size=1048576)
Method allocates memory for multiple variables
Parameters: |
- n (int) – count of variables
- size (int) – size
|
Returns: | void
|
network
Benchmark tests focused on network operations
-
hydratk.extensions.benchmark.tests.network.
request_single
(size=1048576)
Method sends single TCP request
Parameters: | size (int) – size |
Returns: | void |
-
hydratk.extensions.benchmark.tests.network.
request_mult
(n=100, size=1024)
Method sends multiple TCP requests
Parameters: |
- n (int) – count of requests
- size (int) – size
|
Returns: | void
|