File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed
Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 11# Telemetry::Metrics::Parser Changelog
22
3+ ## v0.1.1
4+ * Adding more rspec tests for shellwords
5+ * Adding in ** opts to from_line_protocol method
6+ * Changing line protocol parser to use shellwords logic by default
7+
38## v0.1.0
49Initial Version
Original file line number Diff line number Diff line change 44module Telemetry
55 module Metrics
66 module Parser
7- def from_line_protocol ( line )
8- Telemetry ::Metrics ::Parser ::LineProtocol . parse ( line )
7+ def from_line_protocol ( line , ** opts )
8+ Telemetry ::Metrics ::Parser ::LineProtocol . parse ( line , ** opts )
99 end
1010 module_function :from_line_protocol
1111
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ module Parser
77 module LineProtocol
88 extend Telemetry ::NumberHelper
99
10- def parse ( line , use_shellwords : false )
10+ def parse ( line , use_shellwords : true )
1111 if use_shellwords
12- raw_tags , raw_fields , timestamp = Shellwords . split ( line )
12+ raw_tags , raw_fields , timestamp = Shellwords . split ( line . strip )
1313 else
14- raw_tags , raw_fields , timestamp = line . split
14+ raw_tags , raw_fields , timestamp = line . strip . split
1515 end
1616
1717 {
@@ -33,6 +33,8 @@ def get_measurement(line)
3333
3434 def split_string_to_hash ( raw_string )
3535 results = { }
36+ return results if raw_string . nil?
37+
3638 raw_string . split ( ',' ) . each do |string |
3739 next unless string . include? '='
3840
Original file line number Diff line number Diff line change 11module Telemetry
22 module Metrics
33 module Parser
4- VERSION = '0.1.0 ' . freeze
4+ VERSION = '0.1.1 ' . freeze
55 end
66 end
77end
You can’t perform that action at this time.
0 commit comments