Skip to content

MainController#index and Monitor#index charts

Victor Pereira edited this page Nov 1, 2020 · 6 revisions

StatusHistory

We have charts in both pages, which both come from StatusHistory

StatusHistories are created every 30 seconds, getting the information from backend via Backend::Api::BuildResults::Worker.status, as described here. We delete every day StatusHistory that are older than 1 year.

After that, We down-sample the StatusHistory using the following rules:

In comparison with the newest created record (The decision of the time frame is not a diff from Time.now, but a diff from the newest created StatusHistory time, using StatusHistory.maximum(:time) - time_offset):

  • For records older than a month, re-scale the data in 12 hours slots

  • For records older than 7 days, re-scale the data in 6 hours slots

  • For records older than 1 day, re-scale the data in 1 hour slots

  • For records older than 2 hours, re-scale the data in 4 minutes slots

  • Records newer than 2 hours, stay untouched.

MainController#index

  • We fetch allStatusHistory from last week
  • We resample this data to over-sample it and have a smooth chart (this resample happens dynamically, using StatusHelper.resample)
  • We cache this data for 10 minutes
  • We show the chart in https://build.opensuse.org/

MonitorController#index

  • TBD
Clone this wiki locally