Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Berechnungen um MItternacht manuell ausführen #905

Open
ManfredHi opened this issue Oct 20, 2023 · 3 comments
Open

Berechnungen um MItternacht manuell ausführen #905

ManfredHi opened this issue Oct 20, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@ManfredHi
Copy link

Wenn aus irgendeinem Grund die SA-Instanz genau um MItternacht nicht läuft, werden keine berechnungen von SA durchgeführt. D.h. die Werte von currentDay, previousDay usw. werden nicht aktualisiert.
Es wäre meiner Meinung nach sinnvoll, dass man die Funktion die um MItternacht automatisch abläuft auch manuell anstossen kann. Sinnvoll ist dies z.b. dann wenn man zeitnah merkt dass die Instanz nicht läuft. Auch wenn dann die Werte nicht 100%ig stimmen, ist es immer noch besser, als komplett falsche Werte zu haben bzw. alle einträge manuell ändern zu müssen.

@ManfredHi ManfredHi added the enhancement New feature or request label Oct 20, 2023
@harvey637
Copy link

harvey637 commented Nov 11, 2023

Hi, thank you for the tool.
But I also have no rotation (seen for daily rotation in the screenshot) at midnight with seldom changing values.
grafik
The thin BLUE line is from my ancient calculation before I used Sourceanalytics, the value rises and drops to ZERO at midnight.

The RED line is from sourceanalytics. Around midnight it continues at the last level until a new datapoint arrives. and then the sourceanalytics value does not go to ZERO but starts with the first value of the new day. So the red line never touches the x-axis=ZERO.
My idea is that at midnight all daily counters are rotated (to zero) , even without new values. May be this midnight rotation should be considered for rotation weekly/monthly/quarterly/yearly also. Normally only a small glitch, but very seldom counters will show a difference, eg. if a value is change on the 5th day of the month for the first time.

I checked with monthly rotation: it also only takes place with a new value for the datapoint, which in my case was on the 2. day of the month. So I think, that a automatically daily midnight rotation should be done to all time ranges.

Looking into the code around line 620 I found a "schedule 0 0 * * *" statement, is it possible, that this schedule never runs?
Hoe To check?

cu
Harvey

@harvey637
Copy link

The reason for this request seams to be described also in #478

So the problem will vanish with a stable schedule around midnight, which is not affected by high cpu consumption or other timeouts. Near midnight time (within minutes) seems better than NOT running the midnight rotation! Under "all" circumstances the rotation (thus nulling seldom updated values) should run!

@DutchmanNL
Copy link
Collaborator

DutchmanNL commented Nov 13, 2023

The reason for this request seams to be described also in #478

So the problem will vanish with a stable schedule around midnight, which is not affected by high cpu consumption or other timeouts. Near midnight time (within minutes) seems better than NOT running the midnight rotation! Under "all" circumstances the rotation (thus nulling seldom updated values) should run!

I'm rebuilding the adapter (also moving to typescript) to solve some issue and add new functionality.
#478 is indeed related to this one but fully different use case and issue, one is caused by crash (like the log files) the other by missing 0 value (better said day reset) as long no values are received

Current implementation only handles 1-time schedule, future will be handled also at midnight but also at adapter started by comparing data & time with know values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants