prometheus-client-mmap 0.16.0 → 0.16.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: b7508c0a12a333d9d4ed51fee15b383fbf54a61bc38569a70192e6576f784b59
4
- data.tar.gz: 74c277ba777d4d2d5c4bd6ea09ad142749b5b2b7cbeecb4c5afa07ec872c6f07
3
+ metadata.gz: cb9518fee00dc259d136dac76ada9b7a70e815f74e851db9a26b4abf4dfe8ca7
4
+ data.tar.gz: 5856aee9086371551492b88ead9190cf9185742c0590a05e7d6e5735a999b407
5
5
  SHA512:
6
- metadata.gz: 4a824ab20640df5dfb613a98c5959874af1094c43623cf471075c2438e0ba1aae65f416f7a7ef7b5e0c1b83b3666966a33cf7a8a8803b9be5a40d3d9b71bf41f
7
- data.tar.gz: c6f59b4c4d828312faac358f418b3f277856d61419a8b88c71c5f38b934fb6c334b12654bcc1b51b37ee036de989536fd8eeedfedc18169de8d24297866f6a49
6
+ metadata.gz: 2978ab2938c16dd038044212606f4fd0cc403205ee09f561a3f79048c75066f4fa1d2b76edb0f97ce7bf6d287ed364e7daa14de39f4a204d7bd8b4328bbab164
7
+ data.tar.gz: 50c030f5eca4bab55e7718ed96cbb74c09645fbe0ff64f98b59eb1ac79e154701855b3e064f41314cdb0aeedaa067922cd393523c4e5dad6b062c29de13c7ee9
@@ -0,0 +1,23 @@
1
+ require 'json'
2
+
3
+ module Prometheus
4
+ module Client
5
+ module Helper
6
+ module JsonParser
7
+ class << self
8
+ if defined?(Oj)
9
+ def load(s)
10
+ Oj.load(s)
11
+ rescue Oj::ParseError => e
12
+ raise JSON::ParserError.new(e.message)
13
+ end
14
+ else
15
+ def load(s)
16
+ JSON.parse(s)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -8,6 +8,8 @@ module Prometheus
8
8
  if defined?(Oj)
9
9
  def load(s)
10
10
  Oj.load(s)
11
+ rescue Oj::ParseError, EncodingError => e
12
+ raise JSON::ParserError.new(e.message)
11
13
  end
12
14
  else
13
15
  def load(s)
@@ -37,7 +37,7 @@ module Prometheus
37
37
  valid?(labels)
38
38
 
39
39
  unless @validated.empty? || match?(labels, @validated.first.last)
40
- raise InvalidLabelSetError, 'labels must have the same signature'
40
+ raise InvalidLabelSetError, "labels must have the same signature: (#{label_diff(labels, @validated.first.last)})"
41
41
  end
42
42
 
43
43
  @validated[labels.hash] = labels
@@ -45,6 +45,10 @@ module Prometheus
45
45
 
46
46
  private
47
47
 
48
+ def label_diff(a, b)
49
+ "expected keys: #{b.keys.sort}, got: #{a.keys.sort}"
50
+ end
51
+
48
52
  def match?(a, b)
49
53
  a.keys.sort == b.keys.sort
50
54
  end
@@ -1,5 +1,5 @@
1
1
  module Prometheus
2
2
  module Client
3
- VERSION = '0.16.0'.freeze
3
+ VERSION = '0.16.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus-client-mmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schmidt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-03-10 00:00:00.000000000 Z
12
+ date: 2022-07-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fuzzbert
@@ -123,6 +123,7 @@ files:
123
123
  - lib/prometheus/client/counter.rb
124
124
  - lib/prometheus/client/formats/text.rb
125
125
  - lib/prometheus/client/gauge.rb
126
+ - lib/prometheus/client/helper/#json_parser.rb#
126
127
  - lib/prometheus/client/helper/entry_parser.rb
127
128
  - lib/prometheus/client/helper/file_locker.rb
128
129
  - lib/prometheus/client/helper/json_parser.rb
@@ -181,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
182
  - !ruby/object:Gem::Version
182
183
  version: '0'
183
184
  requirements: []
184
- rubygems_version: 3.1.6
185
+ rubygems_version: 3.3.16
185
186
  signing_key:
186
187
  specification_version: 4
187
188
  summary: A suite of instrumentation metric primitivesthat can be exposed through a