prometheus_parser 0.2.0 → 0.2.2
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 +16 -0
- data/.gitignore +3 -0
- data/Gemfile +14 -0
- data/Rakefile +10 -0
- data/lib/prometheus_parser.rb +2 -2
- data/prometheus_parser.gemspec +3 -3
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eae0090340e5e75bc4059d47898962094be94992045a40d052d64b7f2a597529
|
4
|
+
data.tar.gz: 8d784b2bfeeafc754ce3e4ca6e94c6226244bd95d78d18c22c38be6477d59f4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 800a596c7ac13a61456dd3fa1dac58ffbbdf93c0803ce219adf7bad3da3e70f93123372eb7d9752d96b439c7a89e6069a729e4ff2d9f7df3db03f3d966d74f65
|
7
|
+
data.tar.gz: c504a7427741e0615178a0699e732e4094301260ae24987e17ccdcb8bd7a3b0d0f00a17cbfdd8c8fd82e16cc0ce6dcbd116af62b79a5a7f684871a52ac2f5a88
|
@@ -0,0 +1,16 @@
|
|
1
|
+
on: [push,pull_request]
|
2
|
+
|
3
|
+
jobs:
|
4
|
+
build:
|
5
|
+
strategy:
|
6
|
+
fail-fast: false
|
7
|
+
matrix:
|
8
|
+
ruby: [ 3.2 ]
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
steps:
|
11
|
+
- uses: actions/checkout@v3
|
12
|
+
- uses: ruby/setup-ruby@v1
|
13
|
+
with:
|
14
|
+
bundler-cache: true
|
15
|
+
ruby-version: ${{ matrix.ruby }}
|
16
|
+
- run: bundle exec rake
|
data/.gitignore
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
source "https://rubygems.org"
|
2
|
+
|
3
|
+
group :development, :test do
|
4
|
+
gem "bundler"
|
5
|
+
gem "minitest"
|
6
|
+
gem "minitest-focus"
|
7
|
+
gem "minitest-hooks"
|
8
|
+
gem "minitest-line"
|
9
|
+
gem "minitest-reporters"
|
10
|
+
gem "rake"
|
11
|
+
gem "simplecov", require: false
|
12
|
+
gem "simplecov-csv"
|
13
|
+
gem "simplecov-lcov"
|
14
|
+
end
|
data/Rakefile
ADDED
data/lib/prometheus_parser.rb
CHANGED
@@ -8,13 +8,13 @@ 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)
|
15
15
|
res = []
|
16
16
|
until s.eos?
|
17
|
-
if s.peek(1) == "#" # Skip comment lines
|
17
|
+
if s.peek(1) == "#" || s.peek(1) == "\n" # Skip comment and empty lines
|
18
18
|
s.scan(/.*\n/)
|
19
19
|
next
|
20
20
|
end
|
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.2"
|
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.2
|
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-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: mange@84codes.com
|
@@ -16,8 +16,12 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- ".github/workflows/ci.yml"
|
20
|
+
- ".gitignore"
|
21
|
+
- Gemfile
|
19
22
|
- LICENSE
|
20
23
|
- README.md
|
24
|
+
- Rakefile
|
21
25
|
- lib/prometheus_parser.rb
|
22
26
|
- prometheus_parser.gemspec
|
23
27
|
homepage: https://rubygems.org/gems/prometheus_parser
|
@@ -39,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
39
43
|
- !ruby/object:Gem::Version
|
40
44
|
version: '0'
|
41
45
|
requirements: []
|
42
|
-
rubygems_version: 3.4.
|
46
|
+
rubygems_version: 3.4.10
|
43
47
|
signing_key:
|
44
48
|
specification_version: 4
|
45
49
|
summary: Parse prometheus metrics
|