NagiosEnterprises / ncpa

Nagios Cross-Platform Agent
Other
176 stars 95 forks source link

Fixes #980 - Delta Graph #985

Closed ne-bbahn closed 9 months ago

ne-bbahn commented 9 months ago

Delta graph wasn't loading properly if the pickle was yet to be created.

Testing:

Go to https://NCPA_IP:5693 and navigate to graphs. Select a graph like CPU percent, check the delta checkbox and generate the graph.

Old behavior:

The first time you load the graph, the graph will load, but the numerical indicators will all show 0.00

On Linux, you can make it fail again by deleting the pickle files (/tmp/NCPA-XXXXXXXXXXXXXXXXXX)

Fixed behavior:

The first time you load the graph the numbers will show the current values

sawolf commented 9 months ago

(Did not test, just looking at changes)

Overall, this looks good to me. Just out of curiosity, what's the reasoning for choosing different values for the two timeouts (setInterval() and .fail())?

ne-bbahn commented 9 months ago

(Did not test, just looking at changes)

Overall, this looks good to me. Just out of curiosity, what's the reasoning for choosing different values for the two timeouts (setInterval() and .fail())?

The reason I went with 1 second if the pickle file hasn't been generated yet it that it doesn't take very long and I wanted to ensure a swift load time. The reason I went with 5 seconds if it fails is because I thought that if the ajax is failing, there is some underlying issue that would likely lead to repeated failing and it could use a larger buffer, particularly with how slow ajax can be.