prometheus_parser 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/.gitignore +2 -0
- data/Gemfile +0 -4
- data/Rakefile +0 -1
- data/lib/prometheus_parser.rb +7 -2
- data/prometheus_parser.gemspec +3 -3
- metadata +2 -4
- data/.ruby-version +0 -1
- data/Gemfile.lock +0 -52
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f0a8810f45fd59f739072c5498e66cdd0e4c3f1ffe85efaaa91e3a9ae4b68f5
|
4
|
+
data.tar.gz: 27ee84027584d8cbe2dd2e4e9a77973b3d6af00632256dd5edd1227d39fd4c24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c29e27461fe5734fa0917546eeb9cbe0777123a09639e2c221c846c2b5f9ea91ae62eebe251db85c798e5c6128c8d80c54d022b3b2b85c0a7a66fd84d789a8a0
|
7
|
+
data.tar.gz: d4b5a15260166cddfc965c595cca124d95d6b9beddd5aa2ea394330b75454ea94e5e950bd2a01b6ab9521c9dc420680607c06b43ebf3815d21d9149ebdce67b7
|
data/.github/workflows/ci.yml
CHANGED
@@ -5,12 +5,12 @@ jobs:
|
|
5
5
|
strategy:
|
6
6
|
fail-fast: false
|
7
7
|
matrix:
|
8
|
-
ruby: [ 3.2
|
8
|
+
ruby: [ 3.2 ]
|
9
9
|
runs-on: ubuntu-latest
|
10
10
|
steps:
|
11
11
|
- uses: actions/checkout@v3
|
12
12
|
- uses: ruby/setup-ruby@v1
|
13
13
|
with:
|
14
|
+
bundler-cache: true
|
14
15
|
ruby-version: ${{ matrix.ruby }}
|
15
|
-
- run: bundle install
|
16
16
|
- run: bundle exec rake
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/prometheus_parser.rb
CHANGED
@@ -8,7 +8,7 @@ class PrometheusParser
|
|
8
8
|
KEY_RE = /[\w:]+/
|
9
9
|
VALUE_RE = /-?\d+\.?\d*E?-?\d*|NaN/
|
10
10
|
ATTR_KEY_RE = /[ \w-]+/
|
11
|
-
ATTR_VALUE_RE =
|
11
|
+
ATTR_VALUE_RE = /\s*"([^"\\]*(\\.[^"\\]*)*)"\s*/ # /\s*"(\S*)"\s*/
|
12
12
|
|
13
13
|
def self.parse(raw)
|
14
14
|
s = StringScanner.new(raw)
|
@@ -20,7 +20,12 @@ class PrometheusParser
|
|
20
20
|
end
|
21
21
|
key = s.scan KEY_RE
|
22
22
|
raise Invalid unless key
|
23
|
-
|
23
|
+
begin
|
24
|
+
attrs = parse_attrs(s)
|
25
|
+
rescue Invalid
|
26
|
+
s.scan(/.*\n/)
|
27
|
+
next
|
28
|
+
end
|
24
29
|
value = s.scan VALUE_RE
|
25
30
|
raise Invalid unless value
|
26
31
|
value = value.to_f
|
data/prometheus_parser.gemspec
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "prometheus_parser"
|
3
|
-
s.version = "0.2.
|
3
|
+
s.version = "0.2.3"
|
4
4
|
s.summary = "Parse prometheus metrics"
|
5
5
|
s.authors = ["Magnus Landerblom"]
|
6
6
|
s.email = "mange@84codes.com"
|
7
7
|
s.files = Dir.chdir(File.expand_path(__dir__)) do
|
8
8
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
9
9
|
end
|
10
|
-
s.homepage
|
10
|
+
s.homepage =
|
11
11
|
"https://rubygems.org/gems/prometheus_parser"
|
12
|
-
s.license
|
12
|
+
s.license = "MIT"
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prometheus_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Magnus Landerblom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: mange@84codes.com
|
@@ -18,9 +18,7 @@ extra_rdoc_files: []
|
|
18
18
|
files:
|
19
19
|
- ".github/workflows/ci.yml"
|
20
20
|
- ".gitignore"
|
21
|
-
- ".ruby-version"
|
22
21
|
- Gemfile
|
23
|
-
- Gemfile.lock
|
24
22
|
- LICENSE
|
25
23
|
- README.md
|
26
24
|
- Rakefile
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
3.2.2
|
data/Gemfile.lock
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
ansi (1.5.0)
|
5
|
-
builder (3.2.4)
|
6
|
-
docile (1.4.0)
|
7
|
-
dotenv (2.8.1)
|
8
|
-
minitest (5.18.0)
|
9
|
-
minitest-focus (1.3.1)
|
10
|
-
minitest (>= 4, < 6)
|
11
|
-
minitest-hooks (1.5.0)
|
12
|
-
minitest (> 5.3)
|
13
|
-
minitest-line (0.6.5)
|
14
|
-
minitest (~> 5.0)
|
15
|
-
minitest-reporters (1.6.0)
|
16
|
-
ansi
|
17
|
-
builder
|
18
|
-
minitest (>= 5.0)
|
19
|
-
ruby-progressbar
|
20
|
-
rake (13.0.6)
|
21
|
-
ruby-progressbar (1.13.0)
|
22
|
-
simplecov (0.22.0)
|
23
|
-
docile (~> 1.1)
|
24
|
-
simplecov-html (~> 0.11)
|
25
|
-
simplecov_json_formatter (~> 0.1)
|
26
|
-
simplecov-csv (0.1.3)
|
27
|
-
simplecov
|
28
|
-
simplecov-html (0.12.3)
|
29
|
-
simplecov-lcov (0.8.0)
|
30
|
-
simplecov_json_formatter (0.1.4)
|
31
|
-
|
32
|
-
PLATFORMS
|
33
|
-
arm64-darwin-22
|
34
|
-
|
35
|
-
DEPENDENCIES
|
36
|
-
bundler
|
37
|
-
dotenv
|
38
|
-
minitest
|
39
|
-
minitest-focus
|
40
|
-
minitest-hooks
|
41
|
-
minitest-line
|
42
|
-
minitest-reporters
|
43
|
-
rake
|
44
|
-
simplecov
|
45
|
-
simplecov-csv
|
46
|
-
simplecov-lcov
|
47
|
-
|
48
|
-
RUBY VERSION
|
49
|
-
ruby 3.2.2p53
|
50
|
-
|
51
|
-
BUNDLED WITH
|
52
|
-
2.4.11
|