metrics 0.10.2 → 0.12.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 +0 -0
- 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 +8 -6
- data/lib/metrics/backend.rb +3 -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: 68f3f47929348e39fb0b1989c529211aeca2e77a11d89cc74eb5156517413920
|
4
|
+
data.tar.gz: 23d3a1efe32f6de6a69f63401ad777e5ccd42d9386bb02dfa8039c0bfa84e7b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 266cbaef3d8f81ba42de551bf2119ec6f93004a68cc373046726aec26129a949e01b3548362d6f155bd9fbc48144d06483fcc83db62c9eab34bfe340c4681df7
|
7
|
+
data.tar.gz: 50fe49335a1fadc4362d1dac69c084867eb47b358de9197d7f77276033a9c55176db64464bf422ef55da3e52ffef2263bd0baae741a0f0027e98182e8aa4d588
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
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
|
@@ -21,9 +21,11 @@ module Metrics
|
|
21
21
|
tags&.each do |tag|
|
22
22
|
raise ArgumentError, "Invalid tag (must be String): #{tag.inspect}!" unless tag.is_a?(String)
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
# We should let the underlying backend handle any tag limitations, e.g. converting invalid characters to underscores, etc.
|
25
|
+
#
|
26
|
+
# unless tag =~ VALID_TAG
|
27
|
+
# raise ArgumentError, "Invalid tag (must match #{VALID_TAG}): #{tag.inspect}!"
|
28
|
+
# end
|
27
29
|
end
|
28
30
|
end
|
29
31
|
end
|
data/lib/metrics/backend.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
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
|
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.12.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
|