meerkat-dashboard/meerkat

Countdown / Countup / Time Since Element

Opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
Icinga data is fixed, but time-based data marches onward - if the check was run 5 minutes ago and the time-based data was 7 minutes ago, then the dashboard will say "2 minutes ago". Some pieces of data we want the data to automatically go up every seconds, or go down.
An example would be if it was useful to know the age of the data, e.g. if the data rendered on the dashboard is 30 seconds old when the check is run, it gets older and older until the next refresh, but the dashboard only updates when the check is run again.

Describe the solution you'd like
An option ("epoch timer") for perfdata to treat an epoch timestamp as a basis for a clock-like timer, which would re-render when the computer clock ticked forward. e.g. 16876514321 30 seconds in the past would render as 00:30, then 00:31, then 00:32 as the point in time got further and further away. Similarly a future time would be -00:30, -00:29, -00:28 etc.

Describe alternatives you've considered
It is currently possible to render times as strings in the icinga check output (e.g. 11:30, 14:53) but this requires the person looking at the dashboard to know what the current time is.

Additional context
A similar, useful feature would be a "current time" card which rendered the current time and date

hey @s2156945 don't we have a world clock feature for the last bit of your FR? perhaps we can extend that to seconds?

How this would work:

  • new element type - a cut down version of card "time"
  • get a "base" time from perfdata or last check time or next check time or fixed time or now or last state change
  • for "now" timezone selection, default is browser
  • time for perfdata will be epoch seconds
  • anything machine based will be converted to epoch seconds
  • display options will be human readable