Page 1 of 1

Cumulusutils and realtimegauges.txt

Posted: Tue 23 Nov 2021 5:06 pm
by sutne
I have recently discovered a strange behavior of Cutils:

When opening the main page I have realtimedata almost immediatly, but the gauges shows 0 or nothing for 10 s. Then they show.
Using netinspector in a browser, it tells me that realtimegauges.txt is not found,
but after 10 s it finds it.

My realtime-files are not in the same folder as Cutils, but in web-root, which I have put into cumulusutils.ini. And realtime.txt is found.

I noticed this so time ago, so it is not new in the latest version. But I think it used to be Ok.

http://www.rjoandveret.no/utils/index.html

Re: Cumulusutils and realtimegauges.txt

Posted: Tue 23 Nov 2021 8:32 pm
by HansR
Yes, I noticed this (rare) behaviour too. When all files are renewed (e.g. after an update), the download for the website is quite large and the loading takes a lot of time. Normally I would expect a timeout on some of the realtime files, not a 'not found'. A refresh of the site should load it faster because some files are already in present and in cache and therefore it has more time for the others. It is especially a renewal of the index and the javascript libraries which take their toll.

It depends on the performance of the client machine, the internet speed and the server.
There is little I can do from an application point of view.

But if there is anybody who has a brilliant idea, I am all ears.

Re: Cumulusutils and realtimegauges.txt

Posted: Tue 23 Nov 2021 8:53 pm
by Mapantz
It's trying to find: http://www.rjoandveret.no/utils/realtimegauges.txt

When it should be: http://www.rjoandveret.no/realtimegauges.txt

In: http://www.rjoandveret.no/utils/lib/gauges.js

realTimeUrl: 'realtimegauges.txt', // *** Cumulus Users: Change to your location of the realtime file ***

I would have thought that the file path should be: '../realtimegauges.txt'

Re: Cumulusutils and realtimegauges.txt

Posted: Tue 23 Nov 2021 9:20 pm
by sutne
I would have thought that the file path should be: '../realtimegauges.txt'
Yes, that solved the problem.
Temporarly, because this file will be overwritten next time I do a ‘cumulusutils.exe website’.
And it does not explain why it did work after 10s before this change.

Re: Cumulusutils and realtimegauges.txt

Posted: Tue 23 Nov 2021 9:25 pm
by HansR
Aha... thank you @Mapantz! You are not fully right but you pointed in the better direction, my first thoughts were on another effect.

What happens during intialisation is that with a promise.all, four files are loaded amongst which the gauges.js. Then when the gauges are loaded (and only then) I am able to change the location of the realtimegauges.js and the timer settings. But when that is done the first file read moment - native to gauges.js - has already passed and leaves the file utils/realtimegauges.txt not found. This cannot be prevented as it is only after the gauges are loaded that I can change the default settings (like the timing and the location of the realtimegauges.txt).

So this is a problem of having to load gauges.js before being able to change the settings (don't do that manually by editing the gauges!).
It would also wait with changing the look and feel of the gauges if you had not used the default.

So, in summary, when you change the defaults of the gauges.js, those changes will only be effective after the loading of the gauges.
I might take a second look at that situation, especially at the first reading of that realtimegauges.txt.

Re: Cumulusutils and realtimegauges.txt

Posted: Wed 24 Nov 2021 8:57 am
by HansR
solved in 6.7.7