-
Notifications
You must be signed in to change notification settings - Fork 674
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
MF-454 - Use message Time field as a time for InfluxDB points #455
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in the issue - tagset is wrong.
This tagset will form huge number of different series. Only channelID
and eventually content-type
should be in a tagset.
Codecov Report
@@ Coverage Diff @@
## master #455 +/- ##
==========================================
- Coverage 91.33% 91.25% -0.09%
==========================================
Files 46 46
Lines 1834 1840 +6
==========================================
+ Hits 1675 1679 +4
- Misses 106 107 +1
- Partials 53 54 +1
Continue to review full report at Codecov.
|
df02a96
to
ae38186
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
Update all Reader and Writer services to use time from the message instead of time given from the corrseponding Writer service. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
Messages time less than 2**28 represent time relative to the current time so Writer used to convert this to the correct value, i.e. msg.Time += time.Now(). However, this step is optional and should really be a part of the app on top of Mainflux or could be introduced with minor changes in Normalizer, Reader or Writer services, so there is no need for this to be supported out of box. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
Move all the other Message fields to the field keys. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…h#455) * Use message time as Point time in InfluxDB Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use actual message time Update all Reader and Writer services to use time from the message instead of time given from the corrseponding Writer service. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove message time check Messages time less than 2**28 represent time relative to the current time so Writer used to convert this to the correct value, i.e. msg.Time += time.Now(). However, this step is optional and should really be a part of the app on top of Mainflux or could be introduced with minor changes in Normalizer, Reader or Writer services, so there is no need for this to be supported out of box. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use channel and publisher as tag keys Move all the other Message fields to the field keys. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
* Use message time as Point time in InfluxDB Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use actual message time Update all Reader and Writer services to use time from the message instead of time given from the corrseponding Writer service. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Remove message time check Messages time less than 2**28 represent time relative to the current time so Writer used to convert this to the correct value, i.e. msg.Time += time.Now(). However, this step is optional and should really be a part of the app on top of Mainflux or could be introduced with minor changes in Normalizer, Reader or Writer services, so there is no need for this to be supported out of box. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com> * Use channel and publisher as tag keys Move all the other Message fields to the field keys. Signed-off-by: Dusan Borovcanin <dusan.borovcanin@mainflux.com>
Signed-off-by: Dusan Borovcanin dusan.borovcanin@mainflux.com
What does this do?
Use time from received message to set time value in InfluxDB.
Which issue(s) does this PR fix/relate to?
This pull request closes #454.
Notes
This pull request slightly modifies the way messages are saved in InfluxDB. Field "Time" is removed and replaced by default "time" column of InfluxDB. Previously, "time" kept information about timestamp when the message is saved in the database, so that info is no longer persistent in InfluxDB. However, this information can be found in service logs if needed. This also means that the size of tag set of the single point is slightly reduced.