telemetry-metrics-parser 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b495c7a2172e397b350c2c30d3ebe57517024af5ddef9792959db5e0c07dfed7
|
4
|
+
data.tar.gz: 62dd6baeb7e3a17cc92300714e8ea00d611f1f809eacf538675a8f031ada8c77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a41b4aec7089102e51a31dc054a341ba5cbb2046235f55d5f24f84d7d880b41e529248ac0a3d1e7cc9d3dd4897aa26cf726152895f11984b6e23c7942880f415
|
7
|
+
data.tar.gz: 29a726191c6fb767c95a37118ddbd6f612f2cc47a413c6721580b7b5f2d3e8d1cf7c3b535d0f79c4ccb9a77870cc12304192bf4ed0f024be3a9872ba1309f979
|
data/CHANGELOG.md
CHANGED
@@ -4,8 +4,8 @@ require 'telemetry/metrics/parser/line_protocol'
|
|
4
4
|
module Telemetry
|
5
5
|
module Metrics
|
6
6
|
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)
|
9
9
|
end
|
10
10
|
module_function :from_line_protocol
|
11
11
|
|
@@ -7,11 +7,11 @@ module Telemetry
|
|
7
7
|
module LineProtocol
|
8
8
|
extend Telemetry::NumberHelper
|
9
9
|
|
10
|
-
def parse(line, use_shellwords:
|
10
|
+
def parse(line, use_shellwords: true)
|
11
11
|
if use_shellwords
|
12
|
-
raw_tags, raw_fields, timestamp = Shellwords.split(line)
|
12
|
+
raw_tags, raw_fields, timestamp = Shellwords.split(line.strip)
|
13
13
|
else
|
14
|
-
raw_tags, raw_fields, timestamp = line.split
|
14
|
+
raw_tags, raw_fields, timestamp = line.strip.split
|
15
15
|
end
|
16
16
|
|
17
17
|
{
|
@@ -33,6 +33,8 @@ module Telemetry
|
|
33
33
|
|
34
34
|
def split_string_to_hash(raw_string)
|
35
35
|
results = {}
|
36
|
+
return results if raw_string.nil?
|
37
|
+
|
36
38
|
raw_string.split(',').each do |string|
|
37
39
|
next unless string.include? '='
|
38
40
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telemetry-metrics-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esity
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A metrics line parser gem for things like influxdb line protocol
|
14
14
|
email:
|
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
|
-
rubygems_version: 3.
|
73
|
+
rubygems_version: 3.2.15
|
74
74
|
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: Parses common line formats for InfluxDB Line Protocol and turns it into a
|