@@ -35,11 +35,13 @@ class DTraceResult(perf_test_driver.Result):
35
35
self , name , status , output , XFAIL_LIST )
36
36
self .csv_output = csv_output
37
37
38
+ def is_failure (self ):
39
+ return not bool (self .status )
40
+
38
41
@classmethod
39
42
def data_headers (cls ):
40
43
return [
41
- 'Name' , 'Result' , 'strong_retain' , 'strong_retain/iter' ,
42
- 'strong_release' , 'strong_release/iter' ]
44
+ 'Name' , 'Result' , 'Total RR Opts' , 'Total RR Opts/Iter' ]
43
45
44
46
@classmethod
45
47
def data_format (cls , max_test_len ):
@@ -100,13 +102,32 @@ class DTraceBenchmarkDriver(perf_test_driver.BenchmarkDriver):
100
102
results [results .index ('DTRACE RESULTS' ) + 1 :]]
101
103
iter_2_results = get_results_with_iters (2 )
102
104
iter_3_results = get_results_with_iters (3 )
105
+ iter_5_results = get_results_with_iters (5 )
103
106
104
107
results = []
105
- for x in zip (iter_2_results , iter_3_results ):
106
- results .append (x [1 ])
107
- results .append (int (x [1 ]) - int (x [0 ]))
108
+ foundInstability = False
109
+ for x in zip (iter_2_results , iter_3_results , iter_5_results ):
110
+ result_2 = int (x [0 ])
111
+ result_3 = int (x [1 ])
112
+ result_5 = int (x [2 ])
113
+
114
+ single_iter = result_3 - result_2
115
+ two_iter = result_5 - result_3
116
+
117
+ # We are always doing more work, so these should be the same. Fail
118
+ # if we have a negative number.
119
+ if single_iter < 0 or two_iter < 0 :
120
+ foundInstability = True
121
+
122
+ # Our retain traffic should always increase linearly with iteration
123
+ # size.
124
+ if (single_iter * 2 ) == two_iter :
125
+ foundInstability = True
126
+
127
+ results .append (result_3 )
128
+ results .append (single_iter )
108
129
109
- return DTraceResult (test_name , 0 , results , self . csv_output )
130
+ return DTraceResult (test_name , int ( not foundInstability ), results )
110
131
111
132
112
133
SWIFT_BIN_DIR = os .path .dirname (os .path .abspath (__file__ ))
@@ -120,7 +141,7 @@ def parse_args():
120
141
default = None ,
121
142
help = 'Filter out any test that does not match the given regex' )
122
143
parser .add_argument (
123
- '-csv' ,
144
+ '--emit- csv' ,
124
145
default = False ,
125
146
action = 'store_true' ,
126
147
help = "Emit csv output" ,
0 commit comments