boringmetrics-rails 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/lib/boringmetrics-rails/middleware.rb +3 -3
- data/lib/boringmetrics-rails/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9aacbd679661d2bc527ae2139063306d4b91635a93ba142bc3fed8db2ec71385
|
4
|
+
data.tar.gz: d7635d681e6ff91d1ec675b0277a7d56f13199188cd3ee8a21a42e3e164174db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ff959e36eace83a373e95a5d3de59f0633b4818f1fbfe52410611e210ab0d8db137515a76e328dffabd18f9811457d4d57f4fc1a92c18c1fa889429bf1b624b
|
7
|
+
data.tar.gz: 8d7b32d270e94c09fce385021f5e9c6a5fc3422fa91a073fbd2bcaa8f7cd6a4c98c8137456cc292a55f50225bceb39b0d8bd475e186a60470a675adc51996659
|
data/README.md
CHANGED
@@ -47,7 +47,7 @@ BoringMetrics.logs.send(
|
|
47
47
|
type: "log",
|
48
48
|
level: "info",
|
49
49
|
message: "User signed in",
|
50
|
-
data: {
|
50
|
+
data: { userId: "123" },
|
51
51
|
)
|
52
52
|
|
53
53
|
# Send multiple logs
|
@@ -58,14 +58,14 @@ BoringMetrics.logs.send_batch([
|
|
58
58
|
|
59
59
|
# Set a live metric value
|
60
60
|
BoringMetrics.lives.update(
|
61
|
-
|
61
|
+
liveId: "metric-123",
|
62
62
|
value: 42,
|
63
63
|
operation: "set",
|
64
64
|
)
|
65
65
|
|
66
66
|
# Increment a live metric value
|
67
67
|
BoringMetrics.lives.update(
|
68
|
-
|
68
|
+
liveId: "metric-123",
|
69
69
|
value: 5,
|
70
70
|
operation: "increment",
|
71
71
|
)
|
@@ -78,8 +78,8 @@ In a Rails application, you can initialize the SDK in an initializer:
|
|
78
78
|
```ruby
|
79
79
|
# config/initializers/boringmetrics.rb
|
80
80
|
BoringMetrics::Rails.initialize("YOUR_API_TOKEN", {
|
81
|
-
|
82
|
-
|
81
|
+
logsMaxBatchSize: 50,
|
82
|
+
logsSendInterval: 10
|
83
83
|
})
|
84
84
|
```
|
85
85
|
|
@@ -10,7 +10,7 @@ module BoringMetrics
|
|
10
10
|
|
11
11
|
def call(env)
|
12
12
|
start_time = Time.now
|
13
|
-
|
13
|
+
|
14
14
|
# Process the request
|
15
15
|
begin
|
16
16
|
status, headers, response = @app.call(env)
|
@@ -35,10 +35,10 @@ module BoringMetrics
|
|
35
35
|
# Log request metrics if BoringMetrics is initialized
|
36
36
|
if defined?(BoringMetrics.client) && BoringMetrics.client
|
37
37
|
duration = ((Time.now - start_time) * 1000).round(2) # in milliseconds
|
38
|
-
|
38
|
+
|
39
39
|
# Update live metric for request duration
|
40
40
|
BoringMetrics.lives.update(
|
41
|
-
|
41
|
+
liveId: "request_duration",
|
42
42
|
value: duration,
|
43
43
|
operation: "set"
|
44
44
|
)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boringmetrics-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aymeric Chauvin
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - '='
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 0.1.
|
18
|
+
version: 0.1.1
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - '='
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 0.1.
|
25
|
+
version: 0.1.1
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: railties
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|