File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -223,4 +223,24 @@ namespace :oneshot do
223
223
puts
224
224
end
225
225
end
226
+
227
+ desc 'Remove invalid preview2 2.6.0'
228
+ task remove_26 : :environment do
229
+ time_result_type = BenchmarkResultType . find_by! ( name : 'Execution time' , unit : 'Seconds' )
230
+ ips_result_type = BenchmarkResultType . find_by! ( name : 'Iteration per second' , unit : 'i/s' )
231
+
232
+ BenchmarkType . all . each do |benchmark_type |
233
+ unless benchmark_type . script_url . match ( %r[\A https://raw\. githubusercontent\. com/ruby-bench/ruby-bench-suite/master/ruby/benchmark/] )
234
+ next
235
+ end
236
+
237
+ original_type = BenchmarkType . where . not ( id : benchmark_type . id ) . find_by ( category : benchmark_type . category )
238
+ if original_type . nil? || !original_type . script_url . match ( %r[\A https://raw.githubusercontent.com/ruby-bench/ruby-bench-suite/master/ruby/benchmarks/bm_] )
239
+ next
240
+ end
241
+
242
+ puts "benchmark_type: #{ benchmark_type . category } "
243
+ benchmark_type . benchmark_runs . where ( benchmark_result_type : time_result_type ) . delete_all
244
+ end
245
+ end
226
246
end
You can’t perform that action at this time.
0 commit comments