Added ability to add benchmark results from hardware page
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@ -5,4 +5,18 @@ class Hardware < Sequel::Model(:hardware)
|
||||
|
||||
one_to_many :results
|
||||
|
||||
def bench_results()
|
||||
br = Hash.new()
|
||||
|
||||
self.results.each do |r|
|
||||
unless br.key?(r.benchmark.name)
|
||||
br[r.benchmark.name.to_s] = []
|
||||
end
|
||||
|
||||
br[r.benchmark.name.to_s].push(r.avg_score)
|
||||
end
|
||||
|
||||
return br
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -4,10 +4,10 @@
|
||||
class Result < Sequel::Model
|
||||
|
||||
many_to_one :hardware
|
||||
many_to_one :benchmarks
|
||||
many_to_one :benchmark
|
||||
|
||||
def formatted_score
|
||||
return @score
|
||||
return @avg_score
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user