Axiom Time Stamp Math
Hello All,
I am building a data source diagnostics page in Axiom and would like to calculate the age of the last TVQ for each data source. I have two parts of this I am having trouble with. The first is how would I reference or get the current time. Once I have this, is there a way to take the current time and find the difference between a TVQ timestamp and the current time so I can calculate the "age" of the last TVQ. Any help would be much appreciated! Thank you in advance.
Version 23.2.1.24029
5 replies
-
, can you use the DurationSinceLastTVQ function?
-
Hey Damon,
I was trying to stay away from creating any new tags. I know I could use that in the Calcs & Events service but would like to stay in Axiom for the time calculation if I can. Thanks for the suggestion though bud.
Tim
-
, this isn't 100% what you described. But I think it meets your needs. Warning, this script is ugly and unrefined!
It takes a tag (line 69). Every 5s it will look over the previous 1 day period and return the last value found. Then it compares the timestamp of the value found to the current time (UTC!) and write the difference in seconds to a Label.
I wasn't able to find a method that simply returned last value. So I had to give it a reasonable bound (1 day). There's an if/then that write a descriptive method if no TVQs were found in the last day. I figured at that point a day compared to a day and 5 seconds were equally bad.
Is this in the vein of what you were looking for?!
Content aside

- 4 mths agoMon, January 6, 2025 at 9:16 PM UTCLast active
- 5Replies
- 34Views
-
2
Following