prometheus-client-mmap 0.7.0.beta20 → 0.7.0.beta21

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
  SHA1:
3
- metadata.gz: 5f3038b491c8c0275542e65d54fdaed12db3d3d4
4
- data.tar.gz: 42f7dc3bd93f479970f0c205c2ecb220c4ae8053
3
+ metadata.gz: 05c2d171bfeeb4f30eadedd0ef75e06b39d66785
4
+ data.tar.gz: caa03d42c1075a8944b341390f2f62c01a1d6beb
5
5
  SHA512:
6
- metadata.gz: bbcafb4386700fed0d333cb5a1439e81ea565bd0f1b1ab621d796a696720a28cfef1cb7b5bdacef5d2bd600e68c7b8e2629bab2fa53d2eb7b9449b8df78d3355
7
- data.tar.gz: edbd6726495c8e47196de765b297e1868099777bd7770cd440a49834f0084ab49cb996365a4170fcaaa7681a260619c36e1d5cf1550b54df7d28fc35c69becfc
6
+ metadata.gz: 43c827be0d6f745c2ffa34e79163a28ea05c14e735d07c6c8863190e45b8d34f33914fc9fe8340460aa6eadef645d8c7bf8aaf90b9d06e1f16a74550fdf4b40a
7
+ data.tar.gz: c4ab77d90e3f094f612a1c4feec3a4f5bfa2f792119db96f7304fdf063870f541a17c581299d5814ca57a050064107d5ff43a3df8ee771aed3c0826bc37c4b68
@@ -43,19 +43,19 @@ module Prometheus
43
43
  def read_value(key)
44
44
  @mutex.synchronize do
45
45
  init_value(key) unless @positions.key?(key)
46
+
47
+ pos = @positions[key]
48
+ @m[pos..pos + 7].unpack('d')[0]
46
49
  end
47
- pos = @positions[key]
48
- # We assume that reading from an 8 byte aligned value is atomic.
49
- @m[pos..pos + 7].unpack('d')[0]
50
50
  end
51
51
 
52
52
  def write_value(key, value)
53
53
  @mutex.synchronize do
54
54
  init_value(key) unless @positions.key?(key)
55
+
56
+ pos = @positions[key]
57
+ @m[pos..pos + 7] = [value].pack('d')
55
58
  end
56
- pos = @positions[key]
57
- # We assume that writing to an 8 byte aligned value is atomic.
58
- @m[pos..pos + 7] = [value].pack('d')
59
59
  end
60
60
 
61
61
  def path
@@ -1,5 +1,5 @@
1
1
  module Prometheus
2
2
  module Client
3
- VERSION = '0.7.0.beta20'
3
+ VERSION = '0.7.0.beta21'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus-client-mmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.beta20
4
+ version: 0.7.0.beta21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schmidt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-14 00:00:00.000000000 Z
11
+ date: 2017-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mmap2