From bb8c98053434e5aa0de09b0a2a0fbe35e69542f3 Mon Sep 17 00:00:00 2001 From: drebs Date: Tue, 17 Oct 2017 02:21:23 -0200 Subject: Add benchmark status to dashboard. A "benchmarks" widget is added, together with a update job. The job queries the benchmarks.leap.se website and shows current benchmarking status and outliers. It's a simple start for something that can get more complex depending on identified needs. --- jobs/update_benchmark.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 jobs/update_benchmark.rb (limited to 'jobs') diff --git a/jobs/update_benchmark.rb b/jobs/update_benchmark.rb new file mode 100644 index 0000000..8e98db3 --- /dev/null +++ b/jobs/update_benchmark.rb @@ -0,0 +1,16 @@ +require "json" +require "net/http" +require "uri" + +outliers_uri = URI.parse("https://benchmarks.leap.se/outliers.json") +is_benchmarked_uri = URI.parse("https://benchmarks.leap.se/is-benchmarked.html") + +SCHEDULER.every '5m', :first_in => 0 do |job| + response = Net::HTTP.get(outliers_uri) + outliers = JSON.parse(response) + + response = Net::HTTP.get(is_benchmarked_uri) + benchmarked = response.gsub /<[^>]+>/, '' + + send_event('benchmarks', { "good": outliers["good"].length, "bad": outliers["bad"].length, "is-benchmarked-status": benchmarked}) +end -- cgit v1.2.3