statusengine / interface

AngularJS based Web Interface for Statusengine
https://statusengine.org/ui/#overview
GNU General Public License v3.0
18 stars 7 forks source link

With the different views (24h 1w 1m) there are different down tims #51

Closed tinoklauer closed 3 years ago

tinoklauer commented 3 years ago

Hello nook24,

I open the ticket here and close the ticket in broker.

https://github.com/statusengine/broker/issues/27

the problem is that the status engine's statement is wrong.

The problem was at 5:30 pm and not 3:55 pm. Because at 3:55 pm everything was fine.

Bild 2 Bild3

nook24 commented 3 years ago

the problem is that the status engine's statement is wrong.

As mentioned, the chart will always display a maximum of 100 data points. Let's assume your service check gets executed every 5 minutes. This means: Time Datapoints
5m 1
2.5h 30
8h 96
24h 228
1w 1440
1m 8640

Without any aggregation method (average, minimum, maximum) the chart can only display 8 hours (96/100 datapoints). So the first 8 hours will display the exact values and exact timestamps.

As soon as the system has more than 100 data points, an aggregation operation has to be done. By default Statusengine will use average.

The calculation is quite simple. The time series gets splitted into junks: 1440 datapoints for 1 week / 100 max = 14.4 = 14 chunks of data: https://github.com/statusengine/interface/blob/master/src/Controller/ServicePerfdata.php#L77-L78 The system will build up an average from the first 14 values and the corresponding timestamp: https://github.com/statusengine/interface/blob/master/src/Controller/ServicePerfdata.php#L91-L92 Than the system will calculate the average over the next 14 points, and the next 14 points and so on.

For this reason the chart will not display exact values anymore. It is just an average.

I would recommend to connect a Grafana instance to your system. Grafana can render beautiful graphs (also uses averages by the way) but you can zoom down to an area of interest. While zooming to a specific area the system has less data points to aggregate which will result in more exact charts.

nook24 commented 3 years ago

While writing this issue I noticed the the interface did not pass the limit parameter correctly to the API. The limit of 100 was a bug and a quite small amount of data.

Statusengine UI will load a maximum of 500 data points per chart now. This makes the charts more accurate, but still not exact :)

tinoklauer commented 3 years ago

Hi nook24,

today I testet the new version and in the montly view I have now 15m different (think thats ok), but in the year view i have 3h 25m different :( .

Can you increase the dataponits only for the year view?

Can you show a hint with the possible time deviation in the UI?