opentelemetry-common 0.17.0 → 0.18.0

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: 92344b19100f4c680d20658c4787ca04d9f6d7f5e2da5a13a5380f9b4f32d997
4
- data.tar.gz: 2801ab187f3230630cb3a5691e3b5eb1e0f5ac0016d67f6ee492d335905ca7cd
3
+ metadata.gz: cfc5a762facd7bebc82899e207087f381d27213010f2a5fe5664fb77b4d59391
4
+ data.tar.gz: 58a421bfbe74e7fb05ac4656b1bf8a4e579cff0ddbeaa986ca02eb2689ac1dd4
5
5
  SHA512:
6
- metadata.gz: 90f71ca02e6553136f02e791750fd0c01e3dafb436c032e9bd1b7907bfeb5ead5a5c583215b552951bb9468e235f9e169526ad23a11d5668de8d04aeeca6667f
7
- data.tar.gz: e200ce72b93f1fdfa1b5e77727f50ecdeb314c4f47cc42064dc13b34d9306d2cfcd4bc16967864aaee2d3847acddb25d026f507aa18a491d8f5b8aa63b461d2a
6
+ metadata.gz: 851808bff44e5e2171902fc08dd6aa71979652fb0eeec43e24c995b48eafac968df9a656fe42216b89f06f4e093b1a0e70f635c51e9f868ec150be2da9957652
7
+ data.tar.gz: 68cc2471df27aaa4cffd1eb79b1a79fc337a76214c8d0d52ca73290934053d94c816bce1d114ba9c4552fc9a9e9ef67a07896ac2e10b61e6bcd0b76ac51df37b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
 
2
2
 
3
+ ### v0.18.0 / 2021-05-21
4
+
5
+ * BREAKING CHANGE: Replace Time.now with Process.clock_gettime
6
+
7
+ * FIXED: Replace Time.now with Process.clock_gettime
8
+
3
9
  ### v0.17.0 / 2021-04-22
4
10
 
5
11
  * ADDED: Add zipkin exporter
@@ -13,3 +13,7 @@ ensure
13
13
  env_to_reset.each_pair { |k, v| ENV[k] = v }
14
14
  keys_to_delete.each { |k| ENV.delete(k) }
15
15
  end
16
+
17
+ def exportable_timestamp(time = Time.now)
18
+ (time.to_r * 1_000_000_000).to_i
19
+ end
@@ -14,13 +14,29 @@ module OpenTelemetry
14
14
 
15
15
  # Returns nil if timeout is nil, 0 if timeout has expired,
16
16
  # or the remaining (positive) time left in seconds.
17
+ #
18
+ # @param [Numeric] timeout The timeout in seconds. May be nil.
19
+ # @param [Numeric] start_time Start time for timeout returned
20
+ # by {timeout_timestamp}.
21
+ #
22
+ # @return [Numeric] remaining (positive) time left in seconds.
23
+ # May be nil.
17
24
  def maybe_timeout(timeout, start_time)
18
25
  return nil if timeout.nil?
19
26
 
20
- timeout -= (Time.now - start_time)
27
+ timeout -= (timeout_timestamp - start_time)
21
28
  timeout.positive? ? timeout : 0
22
29
  end
23
30
 
31
+ # Returns a timestamp suitable to pass as the start_time
32
+ # argument to {maybe_timeout}. This has no meaning outside
33
+ # of the current process.
34
+ #
35
+ # @return [Numeric]
36
+ def timeout_timestamp
37
+ Process.clock_gettime(Process::CLOCK_MONOTONIC)
38
+ end
39
+
24
40
  # Encodes a string in utf8
25
41
  #
26
42
  # @param [String] string The string to be utf8 encoded
@@ -6,6 +6,6 @@
6
6
 
7
7
  module OpenTelemetry
8
8
  module Common
9
- VERSION = '0.17.0'
9
+ VERSION = '0.18.0'
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentelemetry-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenTelemetry Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-23 00:00:00.000000000 Z
11
+ date: 2021-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-api
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.17.0
19
+ version: 1.0.0.rc1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.17.0
26
+ version: 1.0.0.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -144,10 +144,10 @@ homepage: https://github.com/open-telemetry/opentelemetry-ruby
144
144
  licenses:
145
145
  - Apache-2.0
146
146
  metadata:
147
- changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.17.0/file.CHANGELOG.html
147
+ changelog_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.18.0/file.CHANGELOG.html
148
148
  source_code_uri: https://github.com/open-telemetry/opentelemetry-ruby/tree/main/common
149
149
  bug_tracker_uri: https://github.com/open-telemetry/opentelemetry-ruby/issues
150
- documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.17.0
150
+ documentation_uri: https://open-telemetry.github.io/opentelemetry-ruby/opentelemetry-common/v0.18.0
151
151
  post_install_message:
152
152
  rdoc_options: []
153
153
  require_paths: