Skip to content

Commit 03355a6

Browse files
committed
Force to show ips first
1 parent 7c38aa1 commit 03355a6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

app/controllers/repos_controller.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ def index
2121

2222
def commits
2323
unless @benchmark.blank?
24-
@charts = @benchmark.benchmark_result_types.map do |benchmark_type|
24+
@charts = ips_first(@benchmark.benchmark_result_types).map do |benchmark_type|
2525
chart_for(benchmark_type)
2626
end.compact
2727
end
2828
end
2929

3030
def releases
3131
unless @benchmark.blank?
32-
@charts = @benchmark.benchmark_result_types.map do |benchmark_result_type|
32+
@charts = ips_first(@benchmark.benchmark_result_types).map do |benchmark_result_type|
3333
benchmark_runs = BenchmarkRun.fetch_release_benchmark_runs(
3434
@benchmark.category, benchmark_result_type
3535
)
@@ -220,4 +220,10 @@ def set_redis_cache_keys
220220
end
221221
end
222222
end
223+
224+
# i/s is a new metric but I want to see it first
225+
def ips_first(result_types)
226+
ips, others = result_types.partition { |t| t.unit == 'i/s' }
227+
[*ips, *others]
228+
end
223229
end

0 commit comments

Comments
 (0)