Skip to content
Snippets Groups Projects
Commit 932583d1 authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

Add a asv_result_time script used to display how long are each benchmarks.

By using started_at / ended_at in json results.
Unfortunately there is no detail about parameters, probably something to
implement on ASV.

Exemple output: ./asv_result_time.py results/cyanea/7de7bd40-virtualenv-py2.7.json

	Benchmark                                                                    Time           %
	Total                                                                    16:05:11        100%
	basic_commands.ExchangeTimeSuite.time_outgoing                            3:31:19      21.89%
	basic_commands.ExchangeTimeSuite.time_incoming                            3:30:10      21.77%
	basic_commands.PushPullTimeSuite.time_pull                                2:52:14      17.84%
	basic_commands.PushPullTimeSuite.time_push                                1:57:41      12.19%
	basic_commands.DiscoveryTimeSuite.time_debugdiscovery                     1:46:00      10.98%
	basic_commands.BundleTimeTestSuite.time_bundle                            0:35:58       3.73%
	basic_commands.UpdateTimeTestSuite.time_up_tip                            0:34:43       3.60%
	basic_commands.ExchangeTimeSuite.time_debugdiscovery                      0:20:09       2.09%
	basic_commands.CloneTimeSuite.time_clone                                  0:13:36       1.41%
	basic_commands.TimeTestSuite.time_version                                 0:03:50       0.40%
	basic_commands.TimeTestSuite.time_id                                      0:03:31       0.36%
	basic_commands.TimeTestSuite.time_emptydiff                               0:03:29       0.36%
	basic_commands.TimeTestSuite.time_status_tip                              0:03:29       0.36%
	basic_commands.TimeTestSuite.time_diff_tip                                0:03:29       0.36%
	basic_commands.TimeTestSuite.time_summary                                 0:03:25       0.35%
	basic_commands.TimeTestSuite.time_id_current                              0:03:19       0.34%
	basic_commands.TimeTestSuite.time_emptystatus                             0:03:18       0.34%
	basic_commands.TimeTestSuite.time_log_tip                                 0:03:15       0.34%
	basic_commands.TimeTestSuite.time_bookmarks                               0:03:11       0.33%
	others.track_branchmap                                                    0:01:46       0.18%
	others.track_changegroupchangelog                                         0:01:29       0.15%
	others.track_perfindex                                                    0:00:33       0.06%
	others.track_ancestors                                                    0:00:33       0.06%
	others.track_manifest                                                     0:00:31       0.05%
	others.track_perfwalk                                                     0:00:31       0.05%
	others.track_status                                                       0:00:31       0.05%
	basic_commands.TestSuite.track_commit                                     0:00:25       0.04%
	others.track_dirstate                                                     0:00:18       0.03%
	others.track_perffncacheload                                              0:00:17       0.03%
	others.track_perffncacheencode                                            0:00:17       0.03%
	others.track_tags                                                         0:00:17       0.03%
	others.track_perfparents                                                  0:00:17       0.03%
	others.track_perfdirstatewrite                                            0:00:16       0.03%
	others.track_perffncachewrite                                             0:00:16       0.03%
	others.track_startup                                                      0:00:16       0.03%
	others.track_perfphases                                                   0:00:16       0.03%
	others.track_heads                                                        0:00:16       0.03%
parent f83f0968
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
import datetime
import json
import operator
import sys
def main():
with open(sys.argv[1], 'r') as f:
result = json.load(f)
times = {}
mname = 0
total_time = datetime.timedelta()
for name, start in result['started_at'].items():
times[name] = datetime.timedelta(seconds=(result['ended_at'][name] - start) / 1000.)
total_time += times[name]
mname = max(mname, len(name))
fmt = '{:<70} {:>10} {:>10}%'
print(fmt.format('Benchmark', 'Time', ''))
print(fmt.format('Total', total_time, '100'))
for name, btime in sorted(times.items(), key=operator.itemgetter(1), reverse=True):
percent = '%.2f' % (btime.total_seconds() / total_time.total_seconds() * 100,)
print(fmt.format(name, btime, percent))
if __name__ == '__main__':
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment