File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ module RubybenchOneshot
2
+ class << self
3
+ end
4
+ end
5
+
1
6
namespace :oneshot do
2
7
desc 'Remove duplicated commit'
3
8
task remove_duplicates : :environment do
@@ -17,4 +22,27 @@ namespace :oneshot do
17
22
end
18
23
end
19
24
end
25
+
26
+ desc 'Resolve legacy typo'
27
+ task normalize_rss : :environment do
28
+ wrong_type = BenchmarkResultType . find_by! ( name : 'RSS memory usage' , unit : 'Kilobtyes' )
29
+ right_type = BenchmarkResultType . find_by! ( name : 'RSS memory usage' , unit : 'Kilobytes' )
30
+
31
+ BenchmarkType . all . each do |benchmark_type |
32
+ unless benchmark_type . script_url . match ( %r[\A https://raw.githubusercontent.com/ruby-bench/ruby-bench-suite/master/ruby/benchmark/] )
33
+ next
34
+ end
35
+
36
+ original_type = BenchmarkType . where . not ( id : benchmark_type . id ) . find_by ( category : benchmark_type . category )
37
+ if original_type . nil? || !original_type . script_url . match ( %r[\A https://raw.githubusercontent.com/ruby-bench/ruby-bench-suite/master/ruby/benchmarks/bm_] )
38
+ next
39
+ end
40
+
41
+ puts "benchmark_type: #{ benchmark_type . id } "
42
+ original_type . benchmark_runs . where ( benchmark_result_type : wrong_type ) . update_all (
43
+ benchmark_result_type_id : right_type . id ,
44
+ benchmark_type_id : benchmark_type . id ,
45
+ )
46
+ end
47
+ end
20
48
end
You can’t perform that action at this time.
0 commit comments