How to use _run_info_from_es_record method in pytest-benchmark

Best Python code snippet using pytest-benchmark

storage.py

Source:storage.py Github

copy

Full Screen

...107 for benchmark_key in ("group", "stats", "options", "param", "name", "params", "fullname", "benchmark_id"):108 result[benchmark_key] = source_es_record[benchmark_key]109 return result110 @staticmethod111 def _run_info_from_es_record(source_es_record):112 result = {}113 for run_key in ("machine_info", "commit_info", "datetime", "version"):114 result[run_key] = source_es_record[run_key]115 return result116 def _group_by_commit_and_time(self, hits):117 result = {}118 for hit in hits:119 source_hit = hit["_source"]120 key = "%s_%s" % (source_hit["commit_info"]["id"], source_hit["datetime"])121 benchmark = self._benchmark_from_es_record(source_hit)122 if key in result:123 result[key]["benchmarks"].append(benchmark)124 else:125 run_info = self._run_info_from_es_record(source_hit)126 run_info["benchmarks"] = [benchmark]127 result[key] = run_info128 return result129 def load_benchmarks(self, *args):130 """131 Yield benchmarks that corresponds with project. Put path and132 source (uncommon part of path) to benchmark dict.133 """134 id_prefix = args[0] if args else None135 r = self._search(self._project_name, id_prefix)136 for hit in r["hits"]["hits"]:137 bench = self._benchmark_from_es_record(hit["_source"])138 bench.update(bench.pop("stats"))139 bench["source"] = bench["benchmark_id"]...

Full Screen

Full Screen

elasticsearch.py

Source:elasticsearch.py Github

copy

Full Screen

...107 for benchmark_key in ("group", "stats", "options", "param", "name", "params", "fullname", "benchmark_id"):108 result[benchmark_key] = source_es_record[benchmark_key]109 return result110 @staticmethod111 def _run_info_from_es_record(source_es_record):112 result = {}113 for run_key in ("machine_info", "commit_info", "datetime", "version"):114 result[run_key] = source_es_record[run_key]115 return result116 def _group_by_commit_and_time(self, hits):117 result = {}118 for hit in hits:119 source_hit = hit["_source"]120 key = "%s_%s" % (source_hit["commit_info"]["id"], source_hit["datetime"])121 benchmark = self._benchmark_from_es_record(source_hit)122 if key in result:123 result[key]["benchmarks"].append(benchmark)124 else:125 run_info = self._run_info_from_es_record(source_hit)126 run_info["benchmarks"] = [benchmark]127 result[key] = run_info128 return result129 def load_benchmarks(self, *args):130 """131 Yield benchmarks that corresponds with project. Put path and132 source (uncommon part of path) to benchmark dict.133 """134 id_prefix = args[0] if args else None135 r = self._search(self._project_name, id_prefix)136 for hit in r["hits"]["hits"]:137 bench = self._benchmark_from_es_record(hit["_source"])138 bench.update(bench.pop("stats"))139 bench["source"] = bench["benchmark_id"]...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run pytest-benchmark automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful