hooks-ruby 0.6.4 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 483ca3984fdff6da4bfb039267d14f3be9e8c2a170d08b2cc1de1bd451ec2207
4
- data.tar.gz: f6d8dc98a54fe9f2e4ad6658a6cd65936eb8202cb048fa4923a47750fdcf0a80
3
+ metadata.gz: d40e21a005dfb4b485946a2b5f3ed086a12de6cc55a1517992ec8aa0533bcab9
4
+ data.tar.gz: 2b83f04a3da257fda6c02d73f5c06e8a62c1d219be0c568910e286262cdb7c65
5
5
  SHA512:
6
- metadata.gz: e6a295a05bdd4abf3352fc33b983934cc2ce5415cc4c9919a43f1d0b185fe5377f05b81c4512e9faf0d50362e1df8344e29577a2ec96cb7ad338abc96008d058
7
- data.tar.gz: b2a7eccf13ed7169f04233a9c7cc71ccbf5fddbf5573761a7967a5dac89def04701b3c1e965d4cf3361f8b85bee797e6b0ca6878a01d5565e3f76b72d32304b2
6
+ metadata.gz: c396c0d3354f6e1968daf2cbcf7edb5d567299d9baa72c973d6932dad73c1b0d5bcb78fd8c8a6b99852202f2253885a6286bdd0029538fa09a2003e69fceb210
7
+ data.tar.gz: 951ac7e716d50b9151ed6254f9e5e4e69fe35a9d0f5206259bfaee1107939d0c0e543748b322346df8c2d840b2ba722a46173c846fe9639e96d22d2f951dcc14
data/lib/hooks/app/api.rb CHANGED
@@ -32,7 +32,7 @@ module Hooks
32
32
  def self.create(config:, endpoints:, log:)
33
33
  # :nocov:
34
34
  @production = config[:environment].downcase.strip == "production"
35
- @server_start_time = Time.now
35
+ @server_start_time = Time.now.utc
36
36
 
37
37
  api_class = Class.new(Grape::API) do
38
38
  content_type :json, "application/json"
@@ -56,7 +56,7 @@ module Hooks
56
56
 
57
57
  send(http_method, full_path) do
58
58
  request_id = uuid
59
- start_time = Time.now
59
+ start_time = Time.now.utc
60
60
 
61
61
  request_context = {
62
62
  request_id:,
@@ -116,7 +116,7 @@ module Hooks
116
116
  end
117
117
 
118
118
  log.info("successfully processed webhook event with handler: #{handler_class_name}")
119
- log.debug("processing duration: #{Time.now - start_time}s")
119
+ log.debug("processing duration: #{Time.now.utc - start_time}s")
120
120
  status 200
121
121
  response
122
122
  rescue Hooks::Plugins::Handlers::Error => e
@@ -34,7 +34,7 @@ module Hooks
34
34
  # :nocov:
35
35
  proc do
36
36
  request_id = uuid
37
- start_time = Time.now
37
+ start_time = Time.now.utc
38
38
 
39
39
  # Use captured values
40
40
  config = captured_config
@@ -86,7 +86,7 @@ module Hooks
86
86
  )
87
87
 
88
88
  log.info("successfully processed webhook event with handler: #{handler_class_name}")
89
- log.debug("processing duration: #{Time.now - start_time}s")
89
+ log.debug("processing duration: #{Time.now.utc - start_time}s")
90
90
  status 200
91
91
  response
92
92
  rescue StandardError => e
@@ -18,7 +18,7 @@ module Hooks
18
18
  status: "healthy",
19
19
  timestamp: Time.now.utc.iso8601,
20
20
  version: Hooks::VERSION,
21
- uptime_seconds: (Time.now - Hooks::App::API.server_start_time).to_i
21
+ uptime_seconds: (Time.now.utc - Hooks::App::API.server_start_time).to_i
22
22
  }
23
23
  end
24
24
  end
@@ -43,9 +43,9 @@ module Hooks
43
43
  # @param tags [Hash] Optional tags/labels for the metric
44
44
  # @return [Object] Return value of the block
45
45
  def measure(metric_name, tags = {})
46
- start_time = Time.now
46
+ start_time = Time.now.utc
47
47
  result = yield
48
- duration = Time.now - start_time
48
+ duration = Time.now.utc - start_time
49
49
  timing(metric_name, duration, tags)
50
50
  result
51
51
  end
data/lib/hooks/version.rb CHANGED
@@ -4,5 +4,5 @@
4
4
  module Hooks
5
5
  # Current version of the Hooks webhook framework
6
6
  # @return [String] The version string following semantic versioning
7
- VERSION = "0.6.4".freeze
7
+ VERSION = "0.7.0".freeze
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hooks-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - github