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

Add timesecond precision field for measurements #634

Open
ojousima opened this issue Sep 12, 2022 · 6 comments
Open

Add timesecond precision field for measurements #634

ojousima opened this issue Sep 12, 2022 · 6 comments
Labels
enhancement New feature or request proposal Suggested feature, discuss the details before starting work

Comments

@ojousima
Copy link
Member

Firmwares sending data at > 1 Hz rate can lead to mixed order of packets on poor network connections. Having the millisecond precision would solve this issue.

This is mostly relevant for MQTT data, one possibility is to add a field iso_time: 2022-09-12T09:55:40.378983Z

@ojousima ojousima added enhancement New feature or request proposal Suggested feature, discuss the details before starting work labels Sep 12, 2022
@Scrin
Copy link
Contributor

Scrin commented Sep 12, 2022

I would prefer either millisecond or nanosecond int64 unix timestamps (even if the internal implementation doesn't offer this precise resolution). The reasoning is that this doesn't require any "date/time format parsing" in the consuming application, and the messages are technically not meant to be "directly consumed by humans", so having a human readable iso timestamp is of very little benefit.

@TheSomeMan
Copy link
Collaborator

We first need to decide on the format of the timestamps, so as not to break the client's custom software.
Maybe we should implement some configuration options in UI to select the format of timestamps

@Scrin
Copy link
Contributor

Scrin commented Nov 9, 2022

I would suggest against making this configurable, since doing so would mean that "client applications" would need to implement support for every format in order to avoid interoperability problems if a user wants to use different pieces of software simultaneously

Since the MQTT data is not meant to be "directly consumed" by humans, any machine readable/parseable format with sufficient precision is fine, it's up to the client applications to decide how to format the timestamps for the end users

@markoaamunkajo
Copy link
Collaborator

@ojousima how do you see this feature, is it beneficial?
@TheSomeMan does this affect memory usage?

@ojousima
Copy link
Member Author

I think this is a really edge case, I have hit this only when dealing with custom acceleration firmwares. It might make sense to just close this and live with the second precision.

@TheSomeMan
Copy link
Collaborator

I agree, this task does not make much sense for environmental sensors and HTTP(S) targets.
But for MQTT it does make sense to prevent mixing up measurements with the same timestamp.
Adding of new attribute 'iso_time: 2022-09-12T09:55:40.378983Z' is not hard, and it will not require additional memory because every measurement is relayed immediately to MQTT and we don't need to store this precise timestamp for all measurements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request proposal Suggested feature, discuss the details before starting work
Projects
None yet
Development

No branches or pull requests

4 participants