File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed 
actions/run-tests/benchmark Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,13 @@ inputs:
1717runs :
1818  using : " composite" 
1919  steps :
20+   - name : (Test) aggregate benchmark results and produce historical average 
21+     if : always() 
22+     uses : ./devops/actions/benchmarking/aggregate 
23+     with :
24+       cutoff_timestamp : 20240101_000000 
25+     env :
26+       GITHUB_TOKEN : ${{ env.GITHUB_TOKEN }} 
2027  - name : Run compute-benchmarks 
2128    shell : bash 
2229    run : | 
6067    with :
6168      name : Compute-benchmark run ${{ github.run_id }} (${{ runner.name }}) 
6269      path : ./artifact 
63-   - name : (Test) aggregate benchmark results and produce historical average 
64-     if : always() 
65-     uses : ./devops/actions/benchmarking/aggregate 
66-     with :
67-       cutoff_timestamp : 20240101_000000 
68-     env :
69-       GITHUB_TOKEN : ${{ env.GITHUB_TOKEN }} 
Original file line number Diff line number Diff line change 55import  statistics 
66from  common  import  Validate , SanitizedConfig 
77from  abc  import  ABC , abstractmethod 
8- 
8+ import   os 
99
1010class  Aggregator (ABC ):
1111    """ 
@@ -52,7 +52,7 @@ def get_type() -> str:
5252    def  add (self , n : float ):
5353        self .elements .append (n )
5454
55-     def  get_median (self ) ->  float :
55+     def  get_avg (self ) ->  float :
5656        return  statistics .median (self .elements )
5757
5858
@@ -91,7 +91,7 @@ def add(self, n: float):
9191        elif  len (self .maxheap_smaller ) <  len (self .minheap_larger ):
9292            heapq .heappush (self .maxheap_smaller , - heapq .heappop (self .minheap_larger ))
9393
94-     def  get_median (self ) ->  float :
94+     def  get_avg (self ) ->  float :
9595        if  len (self .maxheap_smaller ) ==  len (self .minheap_larger ):
9696            # Equal number of elements smaller and larger than "median": 
9797            # thus, there are two median values. The median would then become 
@@ -163,9 +163,9 @@ def csv_samples() -> list[str]:
163163            writer .writeheader ()
164164            for  test  in  samples_aggregate :
165165                writer .writerow (
166-                     {"TestCase" : test_case }
166+                     {"TestCase" : test }
167167                    |  {
168-                         metric : samples_aggregate [test ][metric ].get_median ()
168+                         metric : samples_aggregate [test ][metric ].get_avg ()
169169                        for  metric  in  SanitizedConfig .METRICS_TOLERANCES 
170170                    }
171171                )
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments