InfluxDB Publisher String Handling #198
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add string support to the line protocol publishing in the InfluxDB publisher.
Related changes include splitting out the helper class and function from the InfluxDB Publisher agent file to
ocs/agent/
like has been done with other Agents.Motivation and Context
'line' and 'json' protocols in the InfluxDB python module have different format requirements for strings. This patch updates the line protocol to properly place strings in double quotes before publishing.
Splitting the helper code from the Agent to the OCS library enabled writing two small unit tests, one for timestamp formatting and one for data formatting with the 'line' protocol. In doing so, we also added some code to enforce UTC in the timestamp translation function. This makes sense, as InfluxDB by default expects UTC, and in the past having an OS with a non-UTC timezone has caused some confusion.
fixes #197
How Has This Been Tested?
Test build running on the system at Yale. Still requires testing with the ACU agent, as that's the one where we first noticed the poor string handling shown in #197.
Types of changes
Checklist:
develop
branch.