applicaster-logger 0.8.3 → 0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/applicaster/logger/sidekiq/job_logger.rb +16 -14
- data/lib/applicaster/logger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aeb4e7b00bbb9aa2ee2efb1aadf545afc7629bf
|
4
|
+
data.tar.gz: 853bf94c7926e6505b03ddf52ed519895c690c99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 147c482cb97c2ded9506d527e5cc536fc67e27e3e973c3cc5e10a43f073f7126d7c4928d564704034a6a46fc8a22bf4e8a3ca31c2f32a06f877b636a43d64b1b
|
7
|
+
data.tar.gz: f74960bda06ab5cd32c7a2d6b75f5b6ca30df8e27cc9193b7f97b287f655bf4cfb24f30cb1896509ce3faf822a87124da60cb2273fb8c2d5a030834a1c1a67f6
|
@@ -1,23 +1,25 @@
|
|
1
1
|
require_relative "./common_events"
|
2
2
|
|
3
3
|
module Applicaster
|
4
|
-
module
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
module Logger
|
5
|
+
module Sidekiq
|
6
|
+
class JobLogger
|
7
|
+
include Applicaster::Logger::Sidekiq
|
8
|
+
include Applicaster::Logger::Sidekiq::CommonEvents
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
def call(item, queue)
|
11
|
+
start = Time.now
|
12
|
+
logger.info(job_context(item, queue).deep_merge(start_event(item)))
|
13
|
+
yield
|
14
|
+
runtime = elapsed(start)
|
15
|
+
logger.info(job_context(item, queue).deep_merge(done_event(item, runtime: runtime)))
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
+
private
|
18
19
|
|
19
|
-
|
20
|
-
|
20
|
+
def elapsed(start)
|
21
|
+
(Time.now - start).round(3)
|
22
|
+
end
|
21
23
|
end
|
22
24
|
end
|
23
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: applicaster-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitaly Gorodetsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-logger
|