@@ -55,14 +55,16 @@ def commit_runtime(runtime_results: [], annotate=False):
5555
5656 # Add annotation
5757 if annotate :
58- ax .annotate (f'{ runtimes_below_one :,.0f} commits require\n less than one minute.' , xy = (0 , runtimes_below_one ),
58+ percentage = 100 * runtimes_below_one / len (runtimes )
59+ ax .annotate (f'{ runtimes_below_one :,.0f} commits require\n less than one minute ({ percentage :,.2f} %).' , xy = (0 , runtimes_below_one ),
5960 xytext = (5 , 40_000 ),
6061 arrowprops = dict (arrowstyle = "->" ),
6162 bbox = dict (boxstyle = "round" , fc = "w" ),
6263 fontsize = text_box_font_size
6364 )
6465
65- ax .annotate (f'Two commits require\n { runtime_max :,.0f} minutes.' , xy = (runtime_max , 2 ),
66+ percentage = 100 * runtime_max / len (runtimes )
67+ ax .annotate (f'Two commits require\n { runtime_max :,.0f} minutes ({ percentage :,.2f} %).' , xy = (runtime_max , 2 ),
6668 xytext = (runtime_max - 30 , 10 ),
6769 arrowprops = dict (arrowstyle = "->" ),
6870 bbox = dict (boxstyle = "round" , fc = "w" ),
@@ -81,10 +83,11 @@ def major_formatter(x, pos):
8183
8284# For debugging
8385if __name__ == "__main__" :
86+ # folder = "/data/m2/edit-patterns/results/"
8487 folder = "../results"
8588 print ("Loading results..." )
8689 results = load_runtime_results (folder )
8790 print ("Plotting runtime histogram..." )
88- # commit_runtime(results, True)
89- commit_runtime (results )
91+ commit_runtime (results , True )
92+ # commit_runtime(results)
9093 print ("Done." )
0 commit comments