metrics 0.10.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -2
- data/bake/metrics/capture.rb +3 -3
- data/lib/metrics/backend/capture.rb +3 -3
- data/lib/metrics/backend/console.rb +3 -3
- data/lib/metrics/backend/test.rb +3 -3
- data/lib/metrics/backend.rb +7 -3
- data/lib/metrics/provider.rb +2 -2
- data/lib/metrics/tags.rb +1 -1
- data/lib/metrics/version.rb +2 -2
- data/lib/metrics.rb +4 -3
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37b89bbbe05396589b6625a7f6d71a9c0c7c5460369f6716650c8c2b00fc1bbb
|
4
|
+
data.tar.gz: 1845f2da366bb04f415c6ff5c788f68d432f7ef1beea69c30dc285d42ea6616b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 307a4929b1ebb27c14d6cc46dffc039b1e1a359616759a310050124f1597a5beadeae019eea8998b6bd49bceaef9834be99aff98388b8b657e59e09bf7779af0
|
7
|
+
data.tar.gz: efc7b8b89e08a018455c4cdc244af4a86bc1895a0eaa679e4a233f3d7633efc1ae75ef7f679ad5e1fb2c0045b4025e3209e1be2b9fc376c8ac80d20dd8b49af6
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
�|J�]�kr���U�<��������i��K(j�~�df��i���.ވm�dUcą�e�|�R�kt2b�<���# ߃���v,]��Zف�2@7:!�lؖ�#�0���*`��ۤ(����A4�_�w%<:��y�_*�Z�CCd��"ܠ�Y����1^�{̌�^��,��{�L`����g4�R�c"0���T������-m�CiA�Z�՞.��0�sL��11��4��nT���x�2���8�-50���{�
|
1
|
+
zx5����d��W�am�O��܈)�
|
data/bake/metrics/capture.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2023, by Samuel Williams.
|
4
|
+
# Copyright, 2023-2024, by Samuel Williams.
|
5
5
|
|
6
6
|
# Enable capturing metrics.
|
7
7
|
def capture
|
8
|
-
ENV[
|
9
|
-
require
|
8
|
+
ENV["METRICS_BACKEND"] = "metrics/backend/capture"
|
9
|
+
require "metrics"
|
10
10
|
end
|
11
11
|
|
12
12
|
# Generate a list of metrics that have been captured.
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2023, by Samuel Williams.
|
4
|
+
# Copyright, 2023-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require
|
7
|
-
require_relative
|
6
|
+
require "console"
|
7
|
+
require_relative "../metric"
|
8
8
|
|
9
9
|
module Metrics
|
10
10
|
module Backend
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require
|
7
|
-
require_relative
|
6
|
+
require "console"
|
7
|
+
require_relative "../metric"
|
8
8
|
|
9
9
|
module Metrics
|
10
10
|
module Backend
|
data/lib/metrics/backend/test.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require
|
7
|
-
require_relative
|
6
|
+
require "console"
|
7
|
+
require_relative "../metric"
|
8
8
|
|
9
9
|
module Metrics
|
10
10
|
module Backend
|
data/lib/metrics/backend.rb
CHANGED
@@ -1,22 +1,26 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require
|
6
|
+
require "console/event/failure"
|
7
7
|
|
8
8
|
module Metrics
|
9
9
|
module Backend
|
10
10
|
# Require a specific trace backend.
|
11
11
|
def self.require_backend(env = ENV)
|
12
|
-
if backend = env[
|
12
|
+
if backend = env["METRICS_BACKEND"]
|
13
13
|
begin
|
14
14
|
require(backend)
|
15
15
|
rescue LoadError => error
|
16
16
|
::Console::Event::Failure.for(error).emit(self, "Unable to load metrics backend!", backend: backend, severity: :warn)
|
17
|
+
|
18
|
+
return false
|
17
19
|
end
|
18
20
|
|
19
21
|
Metrics.extend(Backend::Interface)
|
22
|
+
|
23
|
+
return true
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|
data/lib/metrics/provider.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
6
|
+
require_relative "backend"
|
7
7
|
|
8
8
|
module Metrics
|
9
9
|
# @returns [Boolean] Whether there is an active backend.
|
data/lib/metrics/tags.rb
CHANGED
data/lib/metrics/version.rb
CHANGED
data/lib/metrics.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# Released under the MIT License.
|
4
|
-
# Copyright, 2021-
|
4
|
+
# Copyright, 2021-2024, by Samuel Williams.
|
5
5
|
|
6
|
-
require_relative
|
7
|
-
require_relative
|
6
|
+
require_relative "metrics/version"
|
7
|
+
require_relative "metrics/provider"
|
8
|
+
require_relative "metrics/tags"
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
@@ -37,7 +37,7 @@ cert_chain:
|
|
37
37
|
Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
|
38
38
|
voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
|
39
39
|
-----END CERTIFICATE-----
|
40
|
-
date: 2024-
|
40
|
+
date: 2024-10-12 00:00:00.000000000 Z
|
41
41
|
dependencies: []
|
42
42
|
description:
|
43
43
|
email:
|
metadata.gz.sig
CHANGED
Binary file
|