dry-monitor 0.6.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -0
- data/LICENSE +1 -1
- data/dry-monitor.gemspec +3 -5
- data/lib/dry/monitor/clock.rb +20 -0
- data/lib/dry/monitor/notifications.rb +0 -13
- data/lib/dry/monitor/rack/logger.rb +0 -1
- data/lib/dry/monitor/rack/middleware.rb +3 -3
- data/lib/dry/monitor/sql/colorizers/default.rb +2 -0
- data/lib/dry/monitor/sql/logger.rb +2 -3
- data/lib/dry/monitor/version.rb +1 -1
- data/lib/dry/monitor.rb +6 -5
- metadata +22 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02b2ad507bf711d0d3f5ab6bb2ea574afff379851d1ac3897f8bce1aa984dba7
|
4
|
+
data.tar.gz: 0ef87b325ef52c171a11e385b97158d4e0744508b767a83beb581abb51e6ead5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b449e83e90980e65b0e38996a257338409797e4dabd2ed3a632cea63fa157db1cd07878c5979698727300ad2c1ac5bc5d1eec9a32f432bcb7c5e816162043c4f
|
7
|
+
data.tar.gz: e73a5defc0e6cda1e5bb0f27c992f9d41fc6ed064f51f670130e9863951cf8f984a6b880df68f74a95face1af6a15b20a28a65f5060ddcc3cc94f5f8b02e9057
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,44 @@
|
|
1
1
|
<!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
|
2
2
|
|
3
|
+
## 1.0.0 2022-11-04
|
4
|
+
|
5
|
+
|
6
|
+
### Changed
|
7
|
+
|
8
|
+
- This version is compatible with recently released dry-rb dependencies (@flash-gordon)
|
9
|
+
- Bumped version to 1.0.0 (@solnic)
|
10
|
+
|
11
|
+
[Compare v0.7.0...v1.0.0](https://github.com/dry-rb/dry-monitor/compare/v0.7.0...v1.0.0)
|
12
|
+
|
13
|
+
## 0.7.0 2022-10-15
|
14
|
+
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
- Bump dry-core to >= 0.9.0 (@flash-gordon)
|
19
|
+
|
20
|
+
[Compare v0.6.3...v0.7.0](https://github.com/dry-rb/dry-monitor/compare/v0.6.3...v0.7.0)
|
21
|
+
|
22
|
+
## 0.6.3 2022-08-11
|
23
|
+
|
24
|
+
|
25
|
+
### Fixed
|
26
|
+
|
27
|
+
- Extensions were excluded from auto-loading. They to be loaded manually (addresses #49) (@flash-gordon)
|
28
|
+
|
29
|
+
|
30
|
+
[Compare v0.6.2...v0.6.3](https://github.com/dry-rb/dry-monitor/compare/v0.6.2...v0.6.3)
|
31
|
+
|
32
|
+
## 0.6.2 2022-08-10
|
33
|
+
|
34
|
+
|
35
|
+
### Fixed
|
36
|
+
|
37
|
+
- Exclude `VERSION` constant from autoload (fixes #49) (@flash-gordon)
|
38
|
+
|
39
|
+
|
40
|
+
[Compare v0.6.1...v0.6.2](https://github.com/dry-rb/dry-monitor/compare/v0.6.1...v0.6.2)
|
41
|
+
|
3
42
|
## 0.6.1 2022-07-11
|
4
43
|
|
5
44
|
|
data/LICENSE
CHANGED
data/dry-monitor.gemspec
CHANGED
@@ -29,13 +29,11 @@ Gem::Specification.new do |spec|
|
|
29
29
|
spec.required_ruby_version = ">= 2.7.0"
|
30
30
|
|
31
31
|
# to update dependencies edit project.yml
|
32
|
-
spec.add_runtime_dependency "dry-configurable", "~> 0
|
33
|
-
spec.add_runtime_dependency "dry-core", "~> 0
|
34
|
-
spec.add_runtime_dependency "dry-events", "~> 0
|
35
|
-
spec.add_runtime_dependency "zeitwerk", "~> 2.5"
|
32
|
+
spec.add_runtime_dependency "dry-configurable", "~> 1.0", "< 2"
|
33
|
+
spec.add_runtime_dependency "dry-core", "~> 1.0", "< 2"
|
34
|
+
spec.add_runtime_dependency "dry-events", "~> 1.0", "< 2"
|
36
35
|
|
37
36
|
spec.add_development_dependency "bundler"
|
38
|
-
spec.add_development_dependency "rake"
|
39
37
|
spec.add_development_dependency "rouge", "~> 2.0", ">= 2.2.1"
|
40
38
|
spec.add_development_dependency "rspec"
|
41
39
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Dry
|
4
|
+
module Monitor
|
5
|
+
# @api public
|
6
|
+
class Clock
|
7
|
+
# @api public
|
8
|
+
def measure
|
9
|
+
start = current
|
10
|
+
result = yield
|
11
|
+
[result, current - start]
|
12
|
+
end
|
13
|
+
|
14
|
+
# @api public
|
15
|
+
def current
|
16
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -1,22 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry/core/constants"
|
4
3
|
require "dry/events/publisher"
|
5
4
|
|
6
5
|
module Dry
|
7
6
|
module Monitor
|
8
|
-
class Clock
|
9
|
-
def measure
|
10
|
-
start = current
|
11
|
-
result = yield
|
12
|
-
[result, current - start]
|
13
|
-
end
|
14
|
-
|
15
|
-
def current
|
16
|
-
Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
7
|
CLOCK = Clock.new
|
21
8
|
|
22
9
|
class Notifications
|
@@ -4,9 +4,9 @@ module Dry
|
|
4
4
|
module Monitor
|
5
5
|
module Rack
|
6
6
|
class Middleware
|
7
|
-
REQUEST_START = :
|
8
|
-
REQUEST_STOP = :
|
9
|
-
REQUEST_ERROR = :
|
7
|
+
REQUEST_START = :"rack.request.start"
|
8
|
+
REQUEST_STOP = :"rack.request.stop"
|
9
|
+
REQUEST_ERROR = :"rack.request.error"
|
10
10
|
|
11
11
|
Notifications.register_event(REQUEST_START)
|
12
12
|
Notifications.register_event(REQUEST_STOP)
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "dry-configurable"
|
4
|
-
require "dry/core/extensions"
|
5
|
-
|
6
3
|
module Dry
|
7
4
|
module Monitor
|
8
5
|
Notifications.register_event(:sql)
|
@@ -12,6 +9,7 @@ module Dry
|
|
12
9
|
extend Dry::Core::Extensions
|
13
10
|
extend Dry::Configurable
|
14
11
|
|
12
|
+
# rubocop:disable Lint/ConstantDefinitionInBlock
|
15
13
|
register_extension(:default_colorizer) do
|
16
14
|
require "dry/monitor/sql/colorizers/default"
|
17
15
|
|
@@ -35,6 +33,7 @@ module Dry
|
|
35
33
|
|
36
34
|
Logger.include(RougeColorizer)
|
37
35
|
end
|
36
|
+
# rubocop:enable Lint/ConstantDefinitionInBlock
|
38
37
|
|
39
38
|
setting :theme
|
40
39
|
setting :message_template, default: %( Loaded %s in %sms %s)
|
data/lib/dry/monitor/version.rb
CHANGED
data/lib/dry/monitor.rb
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
require "zeitwerk"
|
4
4
|
|
5
|
-
require "dry/core
|
6
|
-
require "dry/
|
5
|
+
require "dry/core"
|
6
|
+
require "dry/configurable"
|
7
7
|
require "dry/monitor/version"
|
8
8
|
|
9
9
|
module Dry
|
@@ -20,6 +20,7 @@ module Dry
|
|
20
20
|
require "dry/monitor/sql/logger"
|
21
21
|
end
|
22
22
|
|
23
|
+
# @api private
|
23
24
|
def self.loader
|
24
25
|
@loader ||= Zeitwerk::Loader.new.tap do |loader|
|
25
26
|
root = File.expand_path("..", __dir__)
|
@@ -30,12 +31,12 @@ module Dry
|
|
30
31
|
"#{root}/dry-monitor.rb",
|
31
32
|
"#{root}/dry/monitor/version.rb",
|
32
33
|
"#{root}/dry/monitor/rack/**/*.rb",
|
33
|
-
"#{root}/dry/monitor/sql/**/*.rb"
|
34
|
+
"#{root}/dry/monitor/sql/**/*.rb"
|
34
35
|
)
|
35
36
|
loader.inflector.inflect "sql" => "SQL"
|
36
37
|
end
|
37
38
|
end
|
39
|
+
|
40
|
+
loader.setup
|
38
41
|
end
|
39
42
|
end
|
40
|
-
|
41
|
-
Dry::Monitor.loader.setup
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Solnica
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|
@@ -16,84 +16,62 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
20
|
-
- - "
|
19
|
+
version: '1.0'
|
20
|
+
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: '2'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0
|
30
|
-
- - "
|
29
|
+
version: '1.0'
|
30
|
+
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
32
|
+
version: '2'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: dry-core
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '0
|
40
|
-
- - "
|
39
|
+
version: '1.0'
|
40
|
+
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
42
|
+
version: '2'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '0
|
50
|
-
- - "
|
49
|
+
version: '1.0'
|
50
|
+
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
52
|
+
version: '2'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: dry-events
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '0
|
60
|
-
|
61
|
-
prerelease: false
|
62
|
-
version_requirements: !ruby/object:Gem::Requirement
|
63
|
-
requirements:
|
64
|
-
- - "~>"
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: '0.2'
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: zeitwerk
|
69
|
-
requirement: !ruby/object:Gem::Requirement
|
70
|
-
requirements:
|
71
|
-
- - "~>"
|
59
|
+
version: '1.0'
|
60
|
+
- - "<"
|
72
61
|
- !ruby/object:Gem::Version
|
73
|
-
version: '2
|
62
|
+
version: '2'
|
74
63
|
type: :runtime
|
75
64
|
prerelease: false
|
76
65
|
version_requirements: !ruby/object:Gem::Requirement
|
77
66
|
requirements:
|
78
67
|
- - "~>"
|
79
68
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
81
|
-
-
|
82
|
-
name: bundler
|
83
|
-
requirement: !ruby/object:Gem::Requirement
|
84
|
-
requirements:
|
85
|
-
- - ">="
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: '0'
|
88
|
-
type: :development
|
89
|
-
prerelease: false
|
90
|
-
version_requirements: !ruby/object:Gem::Requirement
|
91
|
-
requirements:
|
92
|
-
- - ">="
|
69
|
+
version: '1.0'
|
70
|
+
- - "<"
|
93
71
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
72
|
+
version: '2'
|
95
73
|
- !ruby/object:Gem::Dependency
|
96
|
-
name:
|
74
|
+
name: bundler
|
97
75
|
requirement: !ruby/object:Gem::Requirement
|
98
76
|
requirements:
|
99
77
|
- - ">="
|
@@ -153,6 +131,7 @@ files:
|
|
153
131
|
- dry-monitor.gemspec
|
154
132
|
- lib/dry-monitor.rb
|
155
133
|
- lib/dry/monitor.rb
|
134
|
+
- lib/dry/monitor/clock.rb
|
156
135
|
- lib/dry/monitor/logger.rb
|
157
136
|
- lib/dry/monitor/notifications.rb
|
158
137
|
- lib/dry/monitor/rack/logger.rb
|