hooks-ruby 0.6.3 → 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 +4 -4
- data/lib/hooks/app/api.rb +3 -3
- data/lib/hooks/app/endpoints/catchall.rb +2 -2
- data/lib/hooks/app/endpoints/health.rb +1 -1
- data/lib/hooks/core/config_loader.rb +0 -1
- data/lib/hooks/core/stats.rb +2 -2
- data/lib/hooks/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d40e21a005dfb4b485946a2b5f3ed086a12de6cc55a1517992ec8aa0533bcab9
|
4
|
+
data.tar.gz: 2b83f04a3da257fda6c02d73f5c06e8a62c1d219be0c568910e286262cdb7c65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/hooks/core/stats.rb
CHANGED
@@ -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