diff --git a/Pipfile b/Pipfile index 9c34de2ed947439f1fa7172296f2cdcba1ce1ec6..29aa0f7ceacc55c64263da48f9c10634d5b0d58e 100644 --- a/Pipfile +++ b/Pipfile @@ -13,6 +13,7 @@ funcy = "*" mypy = "*" pytest-clarity = "*" prettytable = "*" +pytest_harvest = "*" [requires] python_version = "3.10" diff --git a/Pipfile.lock b/Pipfile.lock index 29d94c95e9ebdd2cfbe8b7f2f22f3d5c3eedcf4e..5af3f2c7c4fd04b3e77801f9cc33bf20490e27ad 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "cfcf97046bdd8d0fb1ee8e187e1eb7971ca1ca9cc7f98a7d7efb5443fd1c23a7" + "sha256": "fc6762600a9f93547b45aadabf499b600a21cc2b47f2066fd9f38ba15364cf42" }, "pipfile-spec": 6, "requires": { @@ -26,32 +26,30 @@ }, "black": { "hashes": [ - "sha256:0a12e4e1353819af41df998b02c6742643cfef58282915f781d0e4dd7a200411", - "sha256:0ad827325a3a634bae88ae7747db1a395d5ee02cf05d9aa7a9bd77dfb10e940c", - "sha256:32a4b17f644fc288c6ee2bafdf5e3b045f4eff84693ac069d87b1a347d861497", - "sha256:3b2c25f8dea5e8444bdc6788a2f543e1fb01494e144480bc17f806178378005e", - "sha256:4a098a69a02596e1f2a58a2a1c8d5a05d5a74461af552b371e82f9fa4ada8342", - "sha256:5107ea36b2b61917956d018bd25129baf9ad1125e39324a9b18248d362156a27", - "sha256:53198e28a1fb865e9fe97f88220da2e44df6da82b18833b588b1883b16bb5d41", - "sha256:5594efbdc35426e35a7defa1ea1a1cb97c7dbd34c0e49af7fb593a36bd45edab", - "sha256:5b879eb439094751185d1cfdca43023bc6786bd3c60372462b6f051efa6281a5", - "sha256:78dd85caaab7c3153054756b9fe8c611efa63d9e7aecfa33e533060cb14b6d16", - "sha256:792f7eb540ba9a17e8656538701d3eb1afcb134e3b45b71f20b25c77a8db7e6e", - "sha256:8ce13ffed7e66dda0da3e0b2eb1bdfc83f5812f66e09aca2b0978593ed636b6c", - "sha256:a05da0430bd5ced89176db098567973be52ce175a55677436a271102d7eaa3fe", - "sha256:a983526af1bea1e4cf6768e649990f28ee4f4137266921c2c3cee8116ae42ec3", - "sha256:bc4d4123830a2d190e9cc42a2e43570f82ace35c3aeb26a512a2102bce5af7ec", - "sha256:c3a73f66b6d5ba7288cd5d6dad9b4c9b43f4e8a4b789a94bf5abfb878c663eb3", - "sha256:ce957f1d6b78a8a231b18e0dd2d94a33d2ba738cd88a7fe64f53f659eea49fdd", - "sha256:cea1b2542d4e2c02c332e83150e41e3ca80dc0fb8de20df3c5e98e242156222c", - "sha256:d2c21d439b2baf7aa80d6dd4e3659259be64c6f49dfd0f32091063db0e006db4", - "sha256:d839150f61d09e7217f52917259831fe2b689f5c8e5e32611736351b89bb2a90", - "sha256:dd82842bb272297503cbec1a2600b6bfb338dae017186f8f215c8958f8acf869", - "sha256:e8166b7bfe5dcb56d325385bd1d1e0f635f24aae14b3ae437102dedc0c186747", - "sha256:e981e20ec152dfb3e77418fb616077937378b322d7b26aa1ff87717fb18b4875" + "sha256:14ff67aec0a47c424bc99b71005202045dc09270da44a27848d534600ac64fc7", + "sha256:197df8509263b0b8614e1df1756b1dd41be6738eed2ba9e9769f3880c2b9d7b6", + "sha256:1e464456d24e23d11fced2bc8c47ef66d471f845c7b7a42f3bd77bf3d1789650", + "sha256:2039230db3c6c639bd84efe3292ec7b06e9214a2992cd9beb293d639c6402edb", + "sha256:21199526696b8f09c3997e2b4db8d0b108d801a348414264d2eb8eb2532e540d", + "sha256:2644b5d63633702bc2c5f3754b1b475378fbbfb481f62319388235d0cd104c2d", + "sha256:432247333090c8c5366e69627ccb363bc58514ae3e63f7fc75c54b1ea80fa7de", + "sha256:444ebfb4e441254e87bad00c661fe32df9969b2bf224373a448d8aca2132b395", + "sha256:5b9b29da4f564ba8787c119f37d174f2b69cdfdf9015b7d8c5c16121ddc054ae", + "sha256:5cc42ca67989e9c3cf859e84c2bf014f6633db63d1cbdf8fdb666dcd9e77e3fa", + "sha256:5d8f74030e67087b219b032aa33a919fae8806d49c867846bfacde57f43972ef", + "sha256:72ef3925f30e12a184889aac03d77d031056860ccae8a1e519f6cbb742736383", + "sha256:819dc789f4498ecc91438a7de64427c73b45035e2e3680c92e18795a839ebb66", + "sha256:915ace4ff03fdfff953962fa672d44be269deb2eaf88499a0f8805221bc68c87", + "sha256:9311e99228ae10023300ecac05be5a296f60d2fd10fff31cf5c1fa4ca4b1988d", + "sha256:974308c58d057a651d182208a484ce80a26dac0caef2895836a92dd6ebd725e0", + "sha256:b8b49776299fece66bffaafe357d929ca9451450f5466e997a7285ab0fe28e3b", + "sha256:c957b2b4ea88587b46cf49d1dc17681c1e672864fd7af32fc1e9664d572b3458", + "sha256:e41a86c6c650bcecc6633ee3180d80a025db041a8e2398dcc059b3afa8382cd4", + "sha256:f513588da599943e0cde4e32cc9879e825d58720d6557062d1098c5ad80080e1", + "sha256:fba8a281e570adafb79f7755ac8721b6cf1bbf691186a287e990c7929c7692ff" ], "index": "pypi", - "version": "==22.8.0" + "version": "==22.10.0" }, "click": { "hashes": [ @@ -68,6 +66,13 @@ ], "version": "==0.9.1" }, + "decopatch": { + "hashes": [ + "sha256:957f49c93f4150182c23f8fb51d13bb3213e0f17a79e09c8cca7057598b55720", + "sha256:e151f7f93de2b1b3fd3f3272dcc7cefd1a69f68ec1c2d8e288ecd9deb36dc5f7" + ], + "version": "==1.4.10" + }, "execnet": { "hashes": [ "sha256:8f694f3ba9cc92cab508b152dcfe322153975c29bda272e2fd7f3f00f36e47c5", @@ -99,6 +104,13 @@ ], "version": "==1.1.1" }, + "makefun": { + "hashes": [ + "sha256:5b110e733d94f7a49d8ac27b1e2d40f2bb0501e98c1d825e0d932d26920dd5df", + "sha256:d79319f9e71b6825ca163be0afa45cbc5b1215e682efa35b2d355a03c594279c" + ], + "version": "==1.15.0" + }, "mccabe": { "hashes": [ "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", @@ -166,32 +178,33 @@ }, "mypy": { "hashes": [ - "sha256:02ef476f6dcb86e6f502ae39a16b93285fef97e7f1ff22932b657d1ef1f28655", - "sha256:0d054ef16b071149917085f51f89555a576e2618d5d9dd70bd6eea6410af3ac9", - "sha256:19830b7dba7d5356d3e26e2427a2ec91c994cd92d983142cbd025ebe81d69cf3", - "sha256:1f7656b69974a6933e987ee8ffb951d836272d6c0f81d727f1d0e2696074d9e6", - "sha256:23488a14a83bca6e54402c2e6435467a4138785df93ec85aeff64c6170077fb0", - "sha256:23c7ff43fff4b0df93a186581885c8512bc50fc4d4910e0f838e35d6bb6b5e58", - "sha256:25c5750ba5609a0c7550b73a33deb314ecfb559c350bb050b655505e8aed4103", - "sha256:2ad53cf9c3adc43cf3bea0a7d01a2f2e86db9fe7596dfecb4496a5dda63cbb09", - "sha256:3fa7a477b9900be9b7dd4bab30a12759e5abe9586574ceb944bc29cddf8f0417", - "sha256:40b0f21484238269ae6a57200c807d80debc6459d444c0489a102d7c6a75fa56", - "sha256:4b21e5b1a70dfb972490035128f305c39bc4bc253f34e96a4adf9127cf943eb2", - "sha256:5a361d92635ad4ada1b1b2d3630fc2f53f2127d51cf2def9db83cba32e47c856", - "sha256:77a514ea15d3007d33a9e2157b0ba9c267496acf12a7f2b9b9f8446337aac5b0", - "sha256:855048b6feb6dfe09d3353466004490b1872887150c5bb5caad7838b57328cc8", - "sha256:9796a2ba7b4b538649caa5cecd398d873f4022ed2333ffde58eaf604c4d2cb27", - "sha256:98e02d56ebe93981c41211c05adb630d1d26c14195d04d95e49cd97dbc046dc5", - "sha256:b793b899f7cf563b1e7044a5c97361196b938e92f0a4343a5d27966a53d2ec71", - "sha256:d1ea5d12c8e2d266b5fb8c7a5d2e9c0219fedfeb493b7ed60cd350322384ac27", - "sha256:d2022bfadb7a5c2ef410d6a7c9763188afdb7f3533f22a0a32be10d571ee4bbe", - "sha256:d3348e7eb2eea2472db611486846742d5d52d1290576de99d59edeb7cd4a42ca", - "sha256:d744f72eb39f69312bc6c2abf8ff6656973120e2eb3f3ec4f758ed47e414a4bf", - "sha256:ef943c72a786b0f8d90fd76e9b39ce81fb7171172daf84bf43eaf937e9f220a9", - "sha256:f2899a3cbd394da157194f913a931edfd4be5f274a88041c9dc2d9cdcb1c315c" + "sha256:1021c241e8b6e1ca5a47e4d52601274ac078a89845cfde66c6d5f769819ffa1d", + "sha256:14d53cdd4cf93765aa747a7399f0961a365bcddf7855d9cef6306fa41de01c24", + "sha256:175f292f649a3af7082fe36620369ffc4661a71005aa9f8297ea473df5772046", + "sha256:26ae64555d480ad4b32a267d10cab7aec92ff44de35a7cd95b2b7cb8e64ebe3e", + "sha256:41fd1cf9bc0e1c19b9af13a6580ccb66c381a5ee2cf63ee5ebab747a4badeba3", + "sha256:5085e6f442003fa915aeb0a46d4da58128da69325d8213b4b35cc7054090aed5", + "sha256:58f27ebafe726a8e5ccb58d896451dd9a662a511a3188ff6a8a6a919142ecc20", + "sha256:6389af3e204975d6658de4fb8ac16f58c14e1bacc6142fee86d1b5b26aa52bda", + "sha256:724d36be56444f569c20a629d1d4ee0cb0ad666078d59bb84f8f887952511ca1", + "sha256:75838c649290d83a2b83a88288c1eb60fe7a05b36d46cbea9d22efc790002146", + "sha256:7b35ce03a289480d6544aac85fa3674f493f323d80ea7226410ed065cd46f206", + "sha256:85f7a343542dc8b1ed0a888cdd34dca56462654ef23aa673907305b260b3d746", + "sha256:86ebe67adf4d021b28c3f547da6aa2cce660b57f0432617af2cca932d4d378a6", + "sha256:8ee8c2472e96beb1045e9081de8e92f295b89ac10c4109afdf3a23ad6e644f3e", + "sha256:91781eff1f3f2607519c8b0e8518aad8498af1419e8442d5d0afb108059881fc", + "sha256:a692a8e7d07abe5f4b2dd32d731812a0175626a90a223d4b58f10f458747dd8a", + "sha256:a705a93670c8b74769496280d2fe6cd59961506c64f329bb179970ff1d24f9f8", + "sha256:c6e564f035d25c99fd2b863e13049744d96bd1947e3d3d2f16f5828864506763", + "sha256:cebca7fd333f90b61b3ef7f217ff75ce2e287482206ef4a8b18f32b49927b1a2", + "sha256:d6af646bd46f10d53834a8e8983e130e47d8ab2d4b7a97363e35b24e1d588947", + "sha256:e7aeaa763c7ab86d5b66ff27f68493d672e44c8099af636d433a7f3fa5596d40", + "sha256:eaa97b9ddd1dd9901a22a879491dbb951b5dec75c3b90032e2baa7336777363b", + "sha256:eb7a068e503be3543c4bd329c994103874fa543c1727ba5288393c21d912d795", + "sha256:f793e3dd95e166b66d50e7b63e69e58e88643d80a3dcc3bcd81368e0478b089c" ], "index": "pypi", - "version": "==0.971" + "version": "==0.982" }, "mypy-extensions": { "hashes": [ @@ -310,6 +323,14 @@ "markers": "python_version >= '3.6'", "version": "==1.4.0" }, + "pytest-harvest": { + "hashes": [ + "sha256:b7e55247a9aad8d5bc3a80a80b7ac5718039a1dcf680b6c00ca90d5446d0e42a", + "sha256:f80d72958c349511ceb5ffa8a25a6166d1ec6abcfddc23690408f31b96a77124" + ], + "index": "pypi", + "version": "==1.10.4" + }, "pytest-xdist": { "hashes": [ "sha256:4580deca3ff04ddb2ac53eba39d76cb5dd5edeac050cb6fbc768b0dd712b4edf", @@ -320,11 +341,19 @@ }, "rich": { "hashes": [ - "sha256:2eb4e6894cde1e017976d2975ac210ef515d7548bc595ba20e195fb9628acdeb", - "sha256:63a5c5ce3673d3d5fbbf23cd87e11ab84b6b451436f1b7f19ec54b6bc36ed7ca" + "sha256:a4eb26484f2c82589bd9a17c73d32a010b1e29d89f1604cd9bf3a2097b81bb5e", + "sha256:ba3a3775974105c221d31141f2c116f4fd65c5ceb0698657a11e9f295ec93fd0" ], "markers": "python_full_version >= '3.6.3' and python_full_version < '4.0.0'", - "version": "==12.5.1" + "version": "==12.6.0" + }, + "six": { + "hashes": [ + "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", + "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", + "version": "==1.16.0" }, "tarantool": { "hashes": [ @@ -344,11 +373,11 @@ }, "typing-extensions": { "hashes": [ - "sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02", - "sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6" + "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa", + "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e" ], "markers": "python_version >= '3.7'", - "version": "==4.3.0" + "version": "==4.4.0" }, "wcwidth": { "hashes": [ diff --git a/test/manual/test_benchmark.py b/test/manual/test_benchmark.py index c6848c6611c153d58461cecbea70c87693be5f35..885815fb12cdf5ad181f79d5af2c9fbc8debcf51 100644 --- a/test/manual/test_benchmark.py +++ b/test/manual/test_benchmark.py @@ -1,16 +1,18 @@ +import os +import subprocess from dataclasses import field -from itertools import count from multiprocessing.pool import ThreadPool from typing import Callable -from conftest import Cluster, Instance, pgrep_tree, pid_alive, retrying -from prettytable import PrettyTable # type: ignore -import os import funcy # type: ignore -import subprocess +import pytest +from conftest import Cluster, Instance, pgrep_tree, pid_alive +from prettytable import PrettyTable # type: ignore +from pytest_harvest import saved_fixture -def test_benchmark_replace(cluster: Cluster, tmpdir, with_flamegraph, capsys): - FIBERS = [1, 2, 3, 5, 10, 60, 70, 100, 200, 300, 400, 500, 600, 700, 800] +@pytest.mark.parametrize("fibers", [1, 2, 3, 5, 10, 50, 100]) +@saved_fixture +def test_benchmark_replace(cluster: Cluster, tmpdir, with_flamegraph, fibers): DURATION = 2 FLAMEGRAPH_TMP_DIR = tmpdir FLAMEGRAPH_OUT_DIR = "tmp/flamegraph/replace" @@ -65,97 +67,59 @@ def test_benchmark_replace(cluster: Cluster, tmpdir, with_flamegraph, capsys): def benchmark(): i = i1 - stats = [] pid = child_pid(i) acc = [] - for c in FIBERS: - - def f(i, t, c): - return i.eval("return benchmark_replace(...)", t, c, timeout=60) - - if with_flamegraph: - f = flamegraph_decorator( - f, - f"f{str(c).zfill(3)}", - pid, - FLAMEGRAPH_TMP_DIR, - FLAMEGRAPH_OUT_DIR, - DURATION, - acc, - ) - stat = f(i, DURATION, c) - stats.append((c, stat)) - - if with_flamegraph: - gather_flamegraphs(acc) - - return stats - - def report(stats): - t = PrettyTable() - t.title = "tarantool replace/sec" - t.field_names = ["fibers", "rps"] - for (c, stat) in stats: - t.add_row([c, int(stat["rps"])]) - t.align = "r" - return t - - with capsys.disabled(): - print("") - print(report(benchmark())) + c = fibers + def f(i, t, c): + return i.eval("return benchmark_replace(...)", t, c, timeout=60) -def test_benchmark_nop( - binary_path, xdist_worker_number, tmpdir, with_flamegraph, capsys -): + if with_flamegraph: + f = flamegraph_decorator( + f, + f"f{str(c).zfill(3)}", + pid, + FLAMEGRAPH_TMP_DIR, + FLAMEGRAPH_OUT_DIR, + DURATION, + acc, + ) + stat = f(i, DURATION, c) + + return ((c, stat), acc[0] if len(acc) > 0 else None) + + return benchmark() + + +# fmt: off +@pytest.mark.parametrize("cluster_size,fibers", [ + (1, 1), (1, 10), (1, 20), + (2, 1), (2, 10), (2, 20), + (3, 1), (3, 10), (3, 20), + (10, 1), (10, 10), (10, 20), + (20, 1), (20, 10), (20, 20) +]) +# fmt: on +@saved_fixture +def test_benchmark_nop(cluster, tmpdir, cluster_size, fibers, with_flamegraph): """ For adequate flamegraphs don't forget to set kernel options: $ sudo echo 0 > /proc/sys/kernel/perf_event_paranoid $ sudo echo 0 > /proc/sys/kernel/kptr_restrict """ - SIZES = [1, 2, 3, 10, 25, 50] - FIBERS = [1, 10, 30, 40, 50, 75] DURATION = 2 FLAMEGRAPH_OUT_DIR = "tmp/flamegraph/nop" - FLAMEGRAPH_TMP_DIR = os.path.join(tmpdir, "flamegraph") - CLUSTER_DATA_DIR = os.path.join(tmpdir, "cluster") - - def new_cluster(): - n = xdist_worker_number - assert isinstance(n, int) - assert n >= 0 - - # Provide each worker a dedicated pool of 200 listening ports - base_port = 3300 + n * 200 - max_port = base_port + 199 - assert max_port <= 65535 - - cluster_ids = (f"cluster-{xdist_worker_number}-{i}" for i in count()) - - cluster = Cluster( - binary_path=binary_path, - id=next(cluster_ids), - data_dir=CLUSTER_DATA_DIR, - base_host="127.0.0.1", - base_port=base_port, - max_port=max_port, - ) - return cluster + FLAMEGRAPH_TMP_DIR = tmpdir def expand_cluster(cluster: Cluster, size: int): c = 0 while len(cluster.instances) < size: cluster.add_instance(wait_ready=False).start() c += 1 - if c % 3 == 0: + if c % 5 == 0: wait_longer(cluster) wait_longer(cluster) - def make_cluster(size: int): - cluster = new_cluster() - expand_cluster(cluster, size) - return cluster - def init(i: Instance): init_code = """ fiber=require('fiber') @@ -200,108 +164,90 @@ def test_benchmark_nop( def state(i: Instance): return i.eval("return picolib.raft_status()") - def instance_to_pid(i: Instance): - assert i.process - return i.process.pid - def benchmark(): - stats = [] - sizes = list(set(SIZES)) - sizes.sort() + print(f"===== Cluster size = {cluster_size}, fibers = {fibers} =====") acc = [] - for s in sizes: - print(f"===== Cluster size = {s} =====") - cluster = make_cluster(s) - pids = list(map(instance_to_pid, cluster.instances)) - i = find_leader(cluster) - init(i) - pid = child_pid(i) - - for c in FIBERS: - print(f"===== Cluster size = {s}, fibers = {c} =====") - - def f(i, t, c): - return [i.eval("return benchmark_nop(...)", t, c, timeout=300)] - - if with_flamegraph: - f = flamegraph_decorator( - f, - f"s{str(s).zfill(3)}f{str(c).zfill(3)}", - pid, - FLAMEGRAPH_TMP_DIR, - FLAMEGRAPH_OUT_DIR, - DURATION, - acc, - ) - stat = f(i, DURATION, c) - stats.append((s, c, stat)) - - cluster.kill() - cluster.remove_data() - retrying(lambda: assert_all_pids_down(pids)) + expand_cluster(cluster, cluster_size) + i = find_leader(cluster) + init(i) + pid = child_pid(i) + + def f(instance, duration, fiber_count): + return instance.eval("return benchmark_nop(...)", duration, fiber_count, timeout=300) if with_flamegraph: - gather_flamegraphs(acc) + f = flamegraph_decorator( + f, + f"s{str(cluster_size).zfill(3)}f{str(fibers).zfill(3)}", + pid, + FLAMEGRAPH_TMP_DIR, + FLAMEGRAPH_OUT_DIR, + DURATION, + acc, + ) + stat = f(i, DURATION, fibers) + + return ((cluster_size, fibers, stat), acc[0] if len(acc) > 0 else None) + + return benchmark() + - return stats +@funcy.retry(tries=30, timeout=10) # type: ignore +def wait_longer(cluster): + for instance in cluster.instances: + instance.wait_ready() - def report_vertical(stats): + +def test_summarize_replace_and_nop(fixture_store, with_flamegraph, capsys): + def report_replace(stats): t = PrettyTable() - t.field_names = ["cluster size", "fibers", "rps"] + t.title = "tarantool replace/sec" + t.field_names = ["fibers", "rps"] + for (c, stat) in stats: + t.add_row([c, int(stat["rps"])]) t.align = "r" - for (s, c, stat) in stats: - t.add_row([s, c, int(avg(rps(stat)))]) return t - def report_table(stats): - def index_exist(lis: list, i: int): - try: - lis[i] - except IndexError: - return False - return True + def report_nop(stats): + sizes = list(set(d[0] for d in stats)) + fibers = list(set(d[1] for d in stats)) - data = [] + data = [[""] * len(fibers) for _ in sizes] for (s, c, stat) in stats: - size_index = SIZES.index(s) - fiber_index = FIBERS.index(c) - val = int(avg(rps(stat))) - if not index_exist(data, size_index): - data.insert(size_index, []) - if not index_exist(data[size_index], fiber_index): - data[size_index].insert(fiber_index, val) + size_index = sizes.index(s) + fiber_index = fibers.index(c) + val = int(stat["rps"]) + data[size_index][fiber_index] = val # type: ignore t = PrettyTable() t.title = "Nop/s" - t.field_names = ["Cluster size \\ fibers", *FIBERS] + t.field_names = ["Cluster size \\ fibers", *fibers] t.align = "r" index = 0 for d in data: - row = [SIZES[index], *d] + row = [sizes[index], *d] t.add_row(row) index += 1 return t - def rps(stat): - return list(map(lambda s: s["rps"], stat)) - - def avg(x): - return sum(x) / len(x) - - def assert_all_pids_down(pids): - assert all(map(lambda pid: not pid_alive(pid), pids)) - with capsys.disabled(): - stats = benchmark() - print(report_table(stats)) - - -@funcy.retry(tries=30, timeout=10) -def wait_longer(cluster): - for instance in cluster.instances: - instance.wait_ready() + print() + if "test_benchmark_replace" in fixture_store: + stats1 = [d[1][0] for d in fixture_store["test_benchmark_replace"].items()] + print(report_replace(stats1)) + if "test_benchmark_nop" in fixture_store: + stats2 = [d[1][0] for d in fixture_store["test_benchmark_nop"].items()] + print(report_nop(stats2)) + + if with_flamegraph: + acc = [] + for d in fixture_store["test_benchmark_replace"].items(): + acc.append(d[1][1]) + for d in fixture_store["test_benchmark_nop"].items(): + acc.append(d[1][1]) + gather_flamegraphs(acc) class Flamegraph: @@ -409,7 +355,7 @@ def flamegraph_decorator( flamegraph.start() result = f(*args, **kwargs) flamegraph.wait() - acc.append(flamegraph) + acc.insert(0, flamegraph) return result return inner