yabeda-activejob 0.5.0 → 0.6.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: c3c22dd8f72f9eb6bfe6e70ab014b7e0dfe539df47f08127474fc7fc08f14b5b
4
- data.tar.gz: 2b25afaacc5fbe787c23e2c8d8e69ea44e8b8ca569714c68043fef8de6683bf5
3
+ metadata.gz: 60e4883609c3f41c5e62ac6f807af400ac90d1180c6a288f68943a3546a82c1b
4
+ data.tar.gz: 97df01bf0694fe8c2bc68b88869c0fa91387eedcab69b014fa0d09328b7305dd
5
5
  SHA512:
6
- metadata.gz: e7ec04003b26361f39904f30c55421032897aba30e3a896318ae1ec6ecb91ea0095aed31220f3f6d0345150e61522129c4c132624869bf16b4f31570e393a94e
7
- data.tar.gz: e45c270929a89d80add771fa8da32e45332ca4fb02ca2cc6906192daad1a5c33687efad3d4ef5e73a490323961bc2a9ccdd997cd999edabeae412de2d86cd3bc
6
+ metadata.gz: '09dcd483c4f5925e93b0c870fb9501f2b580aafa08c1a355620624def59b2f35d91c156dbb8754126c0641941ec60b43ea67353bd31ea4fcbe28c32d41daf1bb'
7
+ data.tar.gz: 3449856c1ad9cbb7d37e6691659f25331661959b19478b365bba060cbb02f5229e62faa61ee428830b7d80e3a11e678a913c68e9d16179da2a65efa809a9b633
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # desc "Explaining what the task does"
3
4
  # task :yabeda_activejob do
4
5
  # # Task goes here
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yabeda
4
4
  module ActiveJob
5
- VERSION = "0.5.0"
5
+ VERSION = "0.6.0"
6
6
  end
7
7
  end
@@ -96,13 +96,27 @@ module Yabeda
96
96
  enqueue_time = event.payload[:job].enqueued_at
97
97
  return nil unless enqueue_time.present?
98
98
 
99
- enqueue_time = Time.parse(enqueue_time).utc unless enqueue_time.is_a?(Time)
100
- perform_at_time = Time.parse(event.end.to_s).utc
101
- (perform_at_time - enqueue_time)
99
+ enqueue_time = parse_event_time(enqueue_time)
100
+ perform_at_time = parse_event_time(event.end)
101
+
102
+ perform_at_time - enqueue_time
102
103
  end
103
104
 
104
105
  def self.ms2s(milliseconds)
105
106
  (milliseconds.to_f / 1000).round(3)
106
107
  end
108
+
109
+ def self.parse_event_time(time)
110
+ case time
111
+ when Time then time
112
+ when String then Time.parse(time).utc
113
+ else
114
+ if time > 1e12
115
+ Time.at(ms2s(time)).utc
116
+ else
117
+ Time.at(time).utc
118
+ end
119
+ end
120
+ end
107
121
  end
108
122
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yabeda-activejob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fullscript
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-01 00:00:00.000000000 Z
11
+ date: 2024-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.2'
19
+ version: '6.1'
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: '5.2'
26
+ version: '6.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: yabeda
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,76 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.6'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '2.0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '2.0'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '13.0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '13.0'
69
- - !ruby/object:Gem::Dependency
70
- name: rspec
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '3.0'
83
- - !ruby/object:Gem::Dependency
84
- name: rspec-rails
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '6.0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '6.0'
97
- - !ruby/object:Gem::Dependency
98
- name: simplecov
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '0.21'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '0.21'
111
41
  description: Prometheus exporter for collecting metrics around your activejobs
112
42
  email:
113
43
  - josh.etsenake@fullscript.com
@@ -128,7 +58,7 @@ metadata:
128
58
  homepage_uri: https://github.com/Fullscript/yabeda-activejob
129
59
  source_code_uri: https://github.com/Fullscript/yabeda-activejob
130
60
  changelog_uri: https://github.com/Fullscript/yabeda-activejob/CHANGELOG.md
131
- post_install_message:
61
+ post_install_message:
132
62
  rdoc_options: []
133
63
  require_paths:
134
64
  - lib
@@ -136,15 +66,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
136
66
  requirements:
137
67
  - - ">="
138
68
  - !ruby/object:Gem::Version
139
- version: '2.5'
69
+ version: '3.0'
140
70
  required_rubygems_version: !ruby/object:Gem::Requirement
141
71
  requirements:
142
72
  - - ">="
143
73
  - !ruby/object:Gem::Version
144
74
  version: '0'
145
75
  requirements: []
146
- rubygems_version: 3.3.7
147
- signing_key:
76
+ rubygems_version: 3.1.6
77
+ signing_key:
148
78
  specification_version: 4
149
79
  summary: Yabeda Prometheus exporter for monitoring your activejobs
150
80
  test_files: []