app_pulse 0.1.1 → 0.2.0
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/CHANGELOG.md +13 -0
- data/README.md +118 -20
- data/lib/app_pulse/collectors/request_collector.rb +7 -0
- data/lib/app_pulse/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6888fe36e5d524ac66e2271ce7ec98616d288ecb5ab9063757bf855eb46442fe
|
|
4
|
+
data.tar.gz: 51510fc7a1b30b64c225fd52d0d9493303ac49e7ba2af9e6380876cbeabfde50
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a9e261eee9d6f4b6852a350db3f9b9d76b0fbc79b6713004685a508fcd238d6aafade804a970e310b23f14af7a190a41e536f800cec471cf0439afa09cc22737
|
|
7
|
+
data.tar.gz: 5a9220e56f30d779356dc9ed496396eda00c98b9fcf2ad1fba9be7437cb42b5f9bcc2da34ea62a04b963d7753a0a99ec8d63c667a944d9f8ec3bba1d036ec398
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
## [0.2.0] – Signal Filtering
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- Configurable slow request threshold (`slow_threshold_ms`)
|
|
7
|
+
- Ability to collect only slow requests without changing signal semantics
|
|
8
|
+
|
|
9
|
+
### Notes
|
|
10
|
+
- Filtering is applied after sampling
|
|
11
|
+
- Default behavior is unchanged when the threshold is not set
|
|
12
|
+
- No insights, rankings, or opinions are introduced
|
|
13
|
+
- Backward compatible and opt-in
|
|
14
|
+
|
|
2
15
|
## [0.1.1] – Packaging Fix
|
|
3
16
|
|
|
4
17
|
### Fixed
|
data/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
[](https://rubygems.org/gems/app_pulse)
|
|
2
|
+
|
|
1
3
|
# app_pulse
|
|
2
4
|
|
|
3
5
|
> **Lightweight request signal collection for Ruby applications**
|
|
@@ -76,6 +78,7 @@ AppPulse.configure do |config|
|
|
|
76
78
|
config.output_path = "log/app_pulse"
|
|
77
79
|
config.output_format = :csv
|
|
78
80
|
config.sampling_rate = 1.0
|
|
81
|
+
config.slow_threshold_ms = 500
|
|
79
82
|
end
|
|
80
83
|
```
|
|
81
84
|
|
|
@@ -85,6 +88,7 @@ require "app_pulse"
|
|
|
85
88
|
|
|
86
89
|
AppPulse.configure do |config|
|
|
87
90
|
config.output_path = "log/app_pulse"
|
|
91
|
+
config.slow_threshold_ms = 500
|
|
88
92
|
end
|
|
89
93
|
|
|
90
94
|
use AppPulse::Middleware::Request
|
|
@@ -161,7 +165,36 @@ Sampling is:
|
|
|
161
165
|
|
|
162
166
|
- Industry standard
|
|
163
167
|
|
|
164
|
-
|
|
168
|
+
## Slow Request Threshold
|
|
169
|
+
|
|
170
|
+
By default, app_pulse collects all sampled requests.
|
|
171
|
+
|
|
172
|
+
You can optionally configure a slow request threshold to collect
|
|
173
|
+
only requests that exceed a given duration.
|
|
174
|
+
|
|
175
|
+
```ruby
|
|
176
|
+
config.slow_threshold_ms = 500
|
|
177
|
+
```
|
|
178
|
+
**Behavior:**
|
|
179
|
+
|
|
180
|
+
- `nil` (default) → collect all requests
|
|
181
|
+
|
|
182
|
+
- `500` → collect only requests taking 500ms or longer
|
|
183
|
+
|
|
184
|
+
This helps reduce noise in high-traffic applications
|
|
185
|
+
without changing the meaning of collected signals.
|
|
186
|
+
|
|
187
|
+
**Notes:**
|
|
188
|
+
|
|
189
|
+
- The threshold is applied after sampling
|
|
190
|
+
|
|
191
|
+
- No errors or insights are inferred
|
|
192
|
+
|
|
193
|
+
- This is a filtering mechanism, not an optimization
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Fault Tolerance
|
|
165
198
|
|
|
166
199
|
- Errors inside app_pulse never break your app
|
|
167
200
|
|
|
@@ -171,7 +204,9 @@ Sampling is:
|
|
|
171
204
|
|
|
172
205
|
- Observability must never affect availability.
|
|
173
206
|
|
|
174
|
-
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
## Compatibility
|
|
175
210
|
**Ruby**
|
|
176
211
|
|
|
177
212
|
- Ruby 2.3+ (tested on 2.3.8 and modern Ruby)
|
|
@@ -196,53 +231,116 @@ Sampling is:
|
|
|
196
231
|
|
|
197
232
|
- No ActiveSupport
|
|
198
233
|
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
# Versioning
|
|
237
|
+
|
|
238
|
+
`app_pulse` follows Semantic Versioning with a deliberately conservative approach.
|
|
239
|
+
|
|
240
|
+
- **v0.x**
|
|
241
|
+
|
|
242
|
+
- Core behavior is stable
|
|
243
|
+
|
|
244
|
+
- Internal structure may evolve
|
|
245
|
+
|
|
246
|
+
- New features are additive and opt-in
|
|
247
|
+
|
|
248
|
+
- Breaking changes (if any) are documented clearly
|
|
249
|
+
|
|
250
|
+
- **v1.0**
|
|
251
|
+
|
|
252
|
+
- Core APIs are frozen
|
|
253
|
+
|
|
254
|
+
- Extension points are finalized
|
|
255
|
+
|
|
256
|
+
- Intended for long-term production use
|
|
257
|
+
|
|
258
|
+
Version bumps are intentional and documented in the changelog.
|
|
259
|
+
|
|
260
|
+
---
|
|
199
261
|
# Roadmap
|
|
200
|
-
**v0.1.0 (current)**
|
|
201
262
|
|
|
202
|
-
-
|
|
263
|
+
- **v0.1.x**
|
|
264
|
+
|
|
265
|
+
- Request lifecycle signal collection
|
|
266
|
+
|
|
267
|
+
- Rack middleware
|
|
268
|
+
|
|
269
|
+
- CSV / JSON / Text writers
|
|
270
|
+
|
|
271
|
+
- File-based storage
|
|
272
|
+
|
|
273
|
+
- Configurable sampling
|
|
274
|
+
|
|
275
|
+
- Production-safe, fault-tolerant design
|
|
203
276
|
|
|
204
|
-
-
|
|
277
|
+
- **v0.2.x**
|
|
205
278
|
|
|
206
|
-
-
|
|
279
|
+
- Configurable signal filtering
|
|
207
280
|
|
|
208
|
-
-
|
|
281
|
+
- Slow request thresholds
|
|
209
282
|
|
|
210
|
-
**
|
|
283
|
+
- **v0.3.x**
|
|
211
284
|
|
|
212
|
-
-
|
|
285
|
+
- Aggregation helpers
|
|
213
286
|
|
|
214
|
-
-
|
|
287
|
+
- Slow endpoint identification
|
|
215
288
|
|
|
216
|
-
-
|
|
289
|
+
- Error frequency summaries
|
|
217
290
|
|
|
218
|
-
|
|
291
|
+
- Structured data preparation for reports
|
|
219
292
|
|
|
220
|
-
-
|
|
293
|
+
- **v1.0**
|
|
221
294
|
|
|
222
|
-
-
|
|
295
|
+
- Stable observability core
|
|
223
296
|
|
|
224
|
-
-
|
|
297
|
+
- Frozen public APIs
|
|
225
298
|
|
|
226
|
-
-
|
|
299
|
+
- Extension-ready architecture
|
|
227
300
|
|
|
228
|
-
**
|
|
301
|
+
- **Future Extensions (separate projects)**
|
|
302
|
+
|
|
303
|
+
- `app_pulse-sql` → database query timing
|
|
304
|
+
|
|
305
|
+
- `app_pulse-jobs` → background job tracking
|
|
306
|
+
|
|
307
|
+
- `app_pulse-exporter` → external systems
|
|
308
|
+
|
|
309
|
+
- `app_pulse-dashboard` → UI & reports
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Development & Testing
|
|
229
314
|
|
|
230
315
|
- RSpec for unit tests
|
|
231
316
|
|
|
232
317
|
- Tested with:
|
|
233
318
|
|
|
234
|
-
-
|
|
319
|
+
- Rails (modern Ruby)
|
|
235
320
|
|
|
236
|
-
-
|
|
321
|
+
- Rack (Ruby 2.3)
|
|
237
322
|
|
|
238
323
|
- RuboCop compatible
|
|
239
324
|
|
|
240
325
|
- No CI lock-in
|
|
241
326
|
|
|
242
|
-
#License
|
|
327
|
+
# License
|
|
243
328
|
|
|
244
329
|
MIT License © Virendra Jadhav
|
|
245
330
|
|
|
331
|
+
## Feedback & Roadmap
|
|
332
|
+
|
|
333
|
+
app_pulse is intentionally minimal in its early versions.
|
|
334
|
+
|
|
335
|
+
Feedback, real-world use cases, and design discussions are welcome.
|
|
336
|
+
Please open an issue for:
|
|
337
|
+
- feature requests
|
|
338
|
+
- design questions
|
|
339
|
+
- integration ideas
|
|
340
|
+
|
|
341
|
+
Dashboards and insights are planned as separate projects.
|
|
342
|
+
|
|
343
|
+
|
|
246
344
|
**Final Notes**
|
|
247
345
|
|
|
248
346
|
`app_pulse` is intentionally boring.
|
|
@@ -9,6 +9,7 @@ module AppPulse
|
|
|
9
9
|
class << self
|
|
10
10
|
def collect(env:, status:, duration:, error: nil)
|
|
11
11
|
return unless sample?
|
|
12
|
+
return unless slow_enough?(duration)
|
|
12
13
|
|
|
13
14
|
data = build_payload(env, status, duration, error)
|
|
14
15
|
writer.write(data)
|
|
@@ -37,6 +38,12 @@ module AppPulse
|
|
|
37
38
|
def sample?
|
|
38
39
|
rand <= AppPulse.config.sampling_rate
|
|
39
40
|
end
|
|
41
|
+
def slow_enough?(duration)
|
|
42
|
+
threshold = AppPulse.config.slow_threshold_ms
|
|
43
|
+
return true unless threshold
|
|
44
|
+
|
|
45
|
+
duration >= threshold
|
|
46
|
+
end
|
|
40
47
|
end
|
|
41
48
|
end
|
|
42
49
|
end
|
data/lib/app_pulse/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: app_pulse
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Virendra Jadhav
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rspec
|