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

Split on comma instead of CSV.parse for metrics capture #107

Merged
merged 2 commits into from
Oct 2, 2017

Conversation

agrare
Copy link
Member

@agrare agrare commented Sep 13, 2017

Split on commas instead of the full CSV.parse() which is more general but also much slower.

There are two values that are returned in CSV, sampleInfoCSV and value defined here EntityMetricCSV

The SampleInfo contains a xsd:int and a xsd:dateTime which looks like:
sampleInfoCSV: 20,2011-08-12T20:33:20Z,20,2011-08-12T20:33:40Z,.....
The PerfMetricIntSeries contains an array of xsd:long and looks like:
value: 0,0,0,3,0,1273,1099,0,0,0,0,0,0,...

Both of these should be safe to split on commas and save the overhead of CSV.parse()

Depends:

@agrare agrare force-pushed the split_on_comma_instead_of_csv branch from aacd40e to 055ffe5 Compare September 27, 2017 20:30
@agrare agrare force-pushed the split_on_comma_instead_of_csv branch from fdedd3e to 0c3f9a2 Compare September 27, 2017 20:57
@miq-bot
Copy link
Member

miq-bot commented Sep 27, 2017

Checked commits agrare/manageiq-providers-vmware@055ffe5~...0c3f9a2 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
1 file checked, 0 offenses detected
Everything looks fine. ⭐

@agrare agrare changed the title [WIP] Split on comma instead of CSV.parse for metrics capture Split on comma instead of CSV.parse for metrics capture Sep 27, 2017
@agrare agrare removed the wip label Sep 27, 2017
@agrare
Copy link
Member Author

agrare commented Sep 27, 2017

@Fryguy I added a check to see if there were any quotes and fallback to CSV.parse so this is safer while using the faster .split(",") most (all?) of the time

@Fryguy Fryguy merged commit 3164b71 into ManageIQ:master Oct 2, 2017
@Fryguy Fryguy added this to the Sprint 70 Ending Oct 2, 2017 milestone Oct 2, 2017
@agrare agrare deleted the split_on_comma_instead_of_csv branch October 2, 2017 20:35
agrare pushed a commit to agrare/manageiq-providers-vmware that referenced this pull request Apr 15, 2019
Ensure spec/support from ManageIQ::AutomationEngine is loaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants