cronbeats-ruby 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8d8ee74cccecd5599e43dcd63934dcab16fb4ed0ba01043782e508c2021ba56
4
- data.tar.gz: 53fb8d18ad30d468a776202faa22dfe07f8782529766a23d28a97980c63b96f5
3
+ metadata.gz: 73de8dc811ce51da8e13fd1d048be2af027fdac872d5a4ea04b9ecef014ea3ee
4
+ data.tar.gz: 42db4cea4d0ed87870f0aca8330b890698e643dd097f97e96e5a7c4b10337d2d
5
5
  SHA512:
6
- metadata.gz: 5c848f4091f7547b0e87a65581326b887c318f79c70cacacab7db97e656db0fa6364e95f66d2008ff888347da43083120b7de0a5dbcef1214b1197d248e16020
7
- data.tar.gz: f1e08d351c94bb850b291d3a096df54c804a6cf8bf20d0b8470528f4302380c5f1688a0bf7ed09c45ccbbb380346b932f6e5646d55c897b4cfe241c3a6623e7d
6
+ metadata.gz: 70c1644cb34b2a4ae043cb07350521de9c4fc2d8ab34de93f2d65e25eed948a3c81626c51b192acb68381c4e51bb0ab31aba6a4be42806f51d9c1efc049e6b51
7
+ data.tar.gz: 12718ba33e14f95cd07984cf6d807e9417a0c3b842cd14a007f93429099f15d75421a5b228d9417a7e8046b9ba548d48e779e4cef5f29cce406833f983881a4a
data/README.md CHANGED
@@ -23,17 +23,76 @@ client.start
23
23
  client.success
24
24
  ```
25
25
 
26
- ## Progress Updates
26
+ ## Progress Tracking
27
+
28
+ Track your job's progress in real-time. CronBeats supports two distinct modes:
29
+
30
+ ### Mode 1: With Percentage (0-100)
31
+ Shows a **progress bar** and your status message on the dashboard.
32
+
33
+ ✓ **Use when**: You can calculate meaningful progress (e.g., processed 750 of 1000 records)
27
34
 
28
35
  ```ruby
29
- client.progress(50, "Processing batch 50/100")
36
+ # Percentage mode: 0-100 with message
37
+ client.progress(50, "Processing batch 500/1000")
30
38
 
39
+ # Or using hash
31
40
  client.progress({
32
41
  seq: 75,
33
- message: "Almost done"
42
+ message: "Almost done - 750/1000"
34
43
  })
35
44
  ```
36
45
 
46
+ ### Mode 2: Message Only
47
+ Shows **only your status message** (no percentage bar) on the dashboard.
48
+
49
+ ✓ **Use when**: Progress isn't measurable or you only want to send status updates
50
+
51
+ ```ruby
52
+ # Message-only mode: nil seq, just status updates
53
+ client.progress(nil, "Connecting to database...")
54
+ client.progress(nil, "Starting data sync...")
55
+ ```
56
+
57
+ ### What you see on the dashboard
58
+ - **Mode 1**: Progress bar (0-100%) + your message → "75% - Processing batch 750/1000"
59
+ - **Mode 2**: Only your status message → "Connecting to database..."
60
+
61
+ ### Complete Example
62
+
63
+ ```ruby
64
+ require "cronbeats_ruby"
65
+
66
+ client = CronBeatsRuby::PingClient.new("abc123de")
67
+ client.start
68
+
69
+ begin
70
+ # Message-only updates for non-measurable steps
71
+ client.progress(nil, "Connecting to database...")
72
+ db = connect_to_database
73
+
74
+ client.progress(nil, "Fetching records...")
75
+ total = db.count
76
+
77
+ # Percentage updates for measurable progress
78
+ (0...total).each do |i|
79
+ process_record(i)
80
+
81
+ if (i % 100).zero?
82
+ percent = (i * 100 / total).to_i
83
+ client.progress(percent, "Processed #{i} / #{total} records")
84
+ end
85
+ end
86
+
87
+ client.progress(100, "All records processed")
88
+ client.success
89
+
90
+ rescue => e
91
+ client.fail
92
+ raise
93
+ end
94
+ ```
95
+
37
96
  ## Notes
38
97
 
39
98
  - SDK uses `POST` for telemetry requests.
@@ -1,3 +1,3 @@
1
1
  module CronBeatsRuby
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cronbeats-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - CronBeats
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-02-25 00:00:00.000000000 Z
11
+ date: 2026-02-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Cron job monitoring and heartbeat monitoring SDK for Ruby. Monitor scheduled
14
14
  tasks, background jobs, and cron jobs with simple ping telemetry. Get alerts when