Forum Home › Forums › Runtime Bugs › Server Bugs › CurData and EventData with a difference of about 2 seconds
- This topic has 13 replies, 4 voices, and was last updated 3 months, 3 weeks ago by zzz.
-
AuthorPosts
-
April 2, 2024 at 4:59 am #14315ZeusParticipant
The current time of the data is inconsistent with the event time, with a difference of about 2 seconds. When there are more events, the longer the difference is
April 2, 2024 at 5:01 am #14316ZeusParticipantthe current data time is 04:34:24 and the event time is 04:34:02 when I check data in influxdb and postgres
April 2, 2024 at 12:14 pm #14320MikhailModeratorA timestamp of the event is set by the Server service when the event is created.
A timestamp of the data point may be changed according to the archive writing period. It depends on the archive properties.April 3, 2024 at 3:14 am #14322ZeusParticipantI set my archive period 1 second
April 3, 2024 at 9:46 am #14324MikhailModeratorIs it possible to reproduce the problem?
April 3, 2024 at 11:20 am #14326ZeusParticipantI checked the source code.
In server corelogic line 520 method Execute(). CalcCnlData and ProcessData use DateTime.UtcNow
in server corelogic line 1029 eventtime use another DateTime.UtcNowApril 4, 2024 at 11:54 am #14340MikhailModeratorYes, event has it’s own timestamp that equals to an event creation time. While archive timestamp may be different if the archive uses a writing period. But 20 seconds difference is too big if the archive period parameter is 1 second. I would be OK if the archive writing period is 1 minute for example.
April 5, 2024 at 10:59 am #14345ZeusParticipantHi
Now I am using the event time for calculating current data. sometimes when the data changes every time. the result of my calculation is not right.
I want to make the event time and current time in the same time line.April 5, 2024 at 12:20 pm #14346ZeusParticipantCould you give me some advice?
April 8, 2024 at 5:36 am #14350JWParticipantI am sharing some of my experience, not sure if they are the same case.
Is it an input cnl or calculated cnl? what’s the refresh rate of this data cnl?
If the data fluctuated and refreshed 10 times in 1 second, e.g. [1.9,1.9,1.9,1.8,1.9,1.8,2.1,2.1,1.9,1.8]
the data archive will only write data of 1.9 at 0.000ms because of the sampling, so it missed the max value of 2.1.
but the event will be able to detect the value of 2.1 and write an event.some time later, the data become [2.1,2.1,2.1,2.1,1.9,2.1,1.8,2.1,2.2,2.2], the data archive will record data of 2.1.
April 8, 2024 at 11:49 am #14356MikhailModeratorThe above is a good example of what I was saying.
Also you can try to set an archive option to write data on each change. But it may require a lot of disk space if data change too fast.May 4, 2024 at 9:39 am #14490ZeusParticipantThere is a new question about get history data.
I am to trying to get silice data by event time.
The historical data obtained through event time does not seem to match the real-time data collectedMay 6, 2024 at 9:30 am #14492MikhailModeratorSlice timestamp depends on the archive parameters that are set in the Server configuration. You should check how the archive is written.
June 17, 2024 at 9:16 am #14708zzzParticipantIn my case, I run RS only for sampling. You can inject data into influxdb as frequently as you like, but set a expiration period to the raw data bucket and create continuous query tasks to move aggregated data into a new bucket. Max/Min/Std/Mean/Medium, you can take one of them as the resampled data or take them all into the new data buckets.
- This reply was modified 3 months, 3 weeks ago by zzz.
-
AuthorPosts
- You must be logged in to reply to this topic.