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

write_redis: Increase parsability of multi-valued keys by insterting … #1070

Closed
wants to merge 3 commits into from
Closed

Conversation

brianpkelly
Copy link
Contributor

This PR modifies the write_redis plugin so that it inserts delimiting | characters into values that have multiple parts. Previously, certain values were difficult to parse (such as those collected by the load plugin) or impossible to parse (such as those collected by the disk plugin).

For instance, a value for load could look like this "1433876308.933760881:00.010" corresponding to load values of 0 0.01 0. This PR changes the plugin to produce values like this: "1433876308.933760881:0|0.01|0"

@octo octo added the Bug A genuine bug label Jun 10, 2015
@octo octo added this to the 5.4 milestone Jun 10, 2015
@octo
Copy link
Member

octo commented Jun 10, 2015

Hi @brianpkelly, thank you very much for your patch! Would it be feasible (on the Redis side) if we used the format_values() function from src/daemon/common.h for this? It will use colons to separate "data sources", e.g. 1433876308.934:0:0.01:0 rather than pipes, which is what essentially all other plugins, including the PUTVAL command, are using. That would make it therefore a lot more consistent.

@brianpkelly
Copy link
Contributor Author

@octo OK, I replaced the APPEND macro method with format_values(). Looks much cleaner now.

@octo
Copy link
Member

octo commented Jun 11, 2015

Thanks @brianpkelly! I've merged the first two commits (5c41662, 1fc8ef7) but solved the third slightly different to avoid using assert() for return value checking (7c04f77).

@octo octo closed this Jun 11, 2015
@octo octo added Fix A pull request fixing a bug and removed Bug A genuine bug labels Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix A pull request fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants