tj-scale 1.0.0 → 1.0.2

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: e070c5d82758136d8df85df78f7f6b021f7494cfa8a2b64ff417aff9ad386333
4
- data.tar.gz: d4cdd0e53528d48a634b8ee929c498cf63756ae7fd8be239ad6aaf277174052f
3
+ metadata.gz: bfa02cccd18ac22e845267ddac5835d60c620e793e65aa34b648d1cc7889eab3
4
+ data.tar.gz: 28a78e5c2643a400910aaca6d535f191f521c1633a8eaab48d28365aa40835e6
5
5
  SHA512:
6
- metadata.gz: 45b1804fc8ee06924b28d7230645fcb34d2d26fa4c37a412183cbfac6ff9bf82da108876d8012f275c774fc027e312ca0095b9bb6d0b89af6303023d0ae302fa
7
- data.tar.gz: 46758b912e0a3ede622ed4ceae6ddb0b78c74b6dfe2cc4022fdf484892320db56204eea15600285bd7cbb6a09286974030b5ba73f983250cf3c3194ebd24632c
6
+ metadata.gz: a269ea3a6087b6bdf54f40a6ac98960d7e70219049ec02dea5d7de592277fba106c5e77769277bd04b3623e356ad90a03926cb0bfcc7edef0867f37ef1bc11d3
7
+ data.tar.gz: e2ed378beb3196a9e9508132f04fea691a828ee6359650b8bb8e6daa96c8693199cbb091e06c8ee1d9aa31353596f7af305c23fbe7703ecbf8a35c9fceb78bb7
data/CHANGELOG.md CHANGED
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.0.2] (tj-scale) - 2026-06-12
11
+
12
+ ### Changed
13
+
14
+ - README fully updated for the `tj-scale` name: install/build/publish instructions,
15
+ repository URLs (`Untechnickle/tj-scale-gem`), and generic example app names.
16
+ - Supersedes 1.0.0 and 1.0.1, which are yanked (same code, stale docs/description).
17
+
18
+ ## [1.0.1] (tj-scale) - 2026-06-12
19
+
20
+ ### Changed
21
+
22
+ - Rewrote the RubyGems summary and description for the gem page (1.0.0 shipped the same code with the older description).
23
+
24
+ ## [1.0.0] (tj-scale) - 2026-06-12
25
+
26
+ First release under the new gem name **`tj-scale`** (continues `tj-scale-ruby`, versions below).
27
+
10
28
  ### Changed
11
29
 
12
30
  - **Gem renamed to `tj-scale`** (was `tj-scale-ruby`); require path is now `require "tj-scale"`. Internal `TjScaleRuby` module and `lib/tj_scale_ruby/` paths are unchanged.
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # TjScaleRuby
1
+ # tj-scale
2
2
 
3
3
  [![Ruby Version](https://img.shields.io/badge/ruby-%3E%3D%203.0.0-red.svg)](https://www.ruby-lang.org/)
4
4
  [![Rails Version](https://img.shields.io/badge/rails-%3E%3D%206.1-red.svg)](https://rubyonrails.org/)
5
5
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE.txt)
6
6
 
7
- TjScaleRuby is a Ruby gem that automatically monitors your background job queues — **Delayed Job or Sidekiq** — and your web traffic, and sends metrics to a remote monitoring service for auto-scaling purposes. It integrates seamlessly with Rails applications and Heroku deployments.
7
+ TJ Scale (`tj-scale`) is a Ruby gem that automatically monitors your background job queues — **Delayed Job or Sidekiq** — and your web traffic, and sends metrics to a remote monitoring service for auto-scaling purposes. It integrates seamlessly with Rails applications and Heroku deployments.
8
8
 
9
9
  ## Features
10
10
 
@@ -28,7 +28,7 @@ The control plane lives in its own project, **`tj-scale-dashboard`** (a sibling
28
28
  Add this line to your application's Gemfile:
29
29
 
30
30
  ```ruby
31
- gem "tj-scale-ruby", "~> 1.2"
31
+ gem "tj-scale", "~> 1.0"
32
32
  ```
33
33
 
34
34
  And then execute:
@@ -40,7 +40,7 @@ $ bundle install
40
40
  Or install it yourself as:
41
41
 
42
42
  ```bash
43
- $ gem install tj-scale-ruby
43
+ $ gem install tj-scale
44
44
  ```
45
45
 
46
46
  ### From Source
@@ -48,8 +48,8 @@ $ gem install tj-scale-ruby
48
48
  1. Clone the repository:
49
49
 
50
50
  ```bash
51
- git clone https://github.com/untechnickle/tj-scale-ruby.git
52
- cd tj-scale-ruby
51
+ git clone https://github.com/Untechnickle/tj-scale-gem.git
52
+ cd tj-scale-gem
53
53
  ```
54
54
 
55
55
  2. Install dependencies:
@@ -85,7 +85,7 @@ Build the gem, publish or reference it, add it to your Rails app, and set config
85
85
  cd /path/to/tj-scale
86
86
  git init # if needed
87
87
  git add .
88
- git commit -m "Release tj-scale-ruby"
88
+ git commit -m "Release tj-scale"
89
89
  ```
90
90
 
91
91
  2. **Install dependencies and verify quality**:
@@ -101,10 +101,10 @@ Build the gem, publish or reference it, add it to your Rails app, and set config
101
101
  4. **Build the package**:
102
102
 
103
103
  ```bash
104
- gem build tj-scale-ruby.gemspec
104
+ gem build tj-scale.gemspec
105
105
  ```
106
106
 
107
- This produces `tj-scale-ruby-<version>.gem` in the current directory.
107
+ This produces `tj-scale-<version>.gem` in the current directory.
108
108
 
109
109
  ### 3. Publish the gem (choose one)
110
110
 
@@ -114,13 +114,13 @@ Build the gem, publish or reference it, add it to your Rails app, and set config
114
114
  2. Push the file you built (version must match `VERSION`):
115
115
 
116
116
  ```bash
117
- gem push tj-scale-ruby-1.0.0.gem
117
+ gem push tj-scale-1.0.1.gem
118
118
  ```
119
119
 
120
120
  **Private gem host**
121
121
 
122
122
  ```bash
123
- gem push tj-scale-ruby-1.0.0.gem --host https://your-gem-server.com
123
+ gem push tj-scale-1.0.1.gem --host https://your-gem-server.com
124
124
  ```
125
125
 
126
126
  Configure Bundler in the app if your host needs authentication (see your provider’s docs).
@@ -130,9 +130,9 @@ Configure Bundler in the app if your host needs authentication (see your provide
130
130
  In the app’s `Gemfile`:
131
131
 
132
132
  ```ruby
133
- gem "tj-scale-ruby", git: "https://github.com/untechnickle/tj-scale-ruby.git", branch: "main"
133
+ gem "tj-scale", git: "https://github.com/Untechnickle/tj-scale-gem.git", branch: "main"
134
134
  # or path for local development:
135
- # gem "tj-scale-ruby", path: "../tj-scale"
135
+ # gem "tj-scale", path: "../tj-scale"
136
136
  ```
137
137
 
138
138
  Then `bundle install`.
@@ -142,7 +142,7 @@ Then `bundle install`.
142
142
  1. Open the app’s **`Gemfile`** and add (adjust version or source as above):
143
143
 
144
144
  ```ruby
145
- gem "tj-scale-ruby", "~> 1.2"
145
+ gem "tj-scale", "~> 1.0"
146
146
  ```
147
147
 
148
148
  2. Run:
@@ -177,26 +177,26 @@ Configuration is **entirely via environment variables** (and Heroku **config var
177
177
 
178
178
  Heroku sets **`DYNO`** (for example `web.1`, `worker.1`) and typically **`HEROKU_APP_NAME`**; do not set **`DYNO`** manually in production.
179
179
 
180
- **Example: `revize-prod` (web) and `revize-prod-mirror` (workers)**
180
+ **Example: `my-app-web` (web) and `my-app-workers` (workers)**
181
181
 
182
182
  Use the same token on both apps if one backend handles scaling.
183
183
 
184
184
  ```bash
185
- # revize-prod — reporter on web.1, scale web dynos
185
+ # my-app-web — reporter on web.1, scale web dynos
186
186
  heroku config:set TJ_SCALE_API_TOKEN=your_token \
187
187
  TJ_SCALE_API_URL=https://your-control-plane.example.com/api/v1/metrics \
188
- TJ_SCALE_TARGET_APP=revize-prod \
188
+ TJ_SCALE_TARGET_APP=my-app-web \
189
189
  TJ_SCALE_TARGET_PROCESS=web \
190
190
  TJ_SCALE_MONITOR_PROCESS=web \
191
- -a revize-prod
191
+ -a my-app-web
192
192
 
193
- # revize-prod-mirror — reporter on worker.1, scale worker dynos
193
+ # my-app-workers — reporter on worker.1, scale worker dynos
194
194
  heroku config:set TJ_SCALE_API_TOKEN=your_token \
195
195
  TJ_SCALE_API_URL=https://your-control-plane.example.com/api/v1/metrics \
196
- TJ_SCALE_TARGET_APP=revize-prod-mirror \
196
+ TJ_SCALE_TARGET_APP=my-app-workers \
197
197
  TJ_SCALE_TARGET_PROCESS=worker \
198
198
  TJ_SCALE_MONITOR_PROCESS=worker \
199
- -a revize-prod-mirror
199
+ -a my-app-workers
200
200
  ```
201
201
 
202
202
  On the **web** app, enable **`TJ_SCALE_ENABLE_QUEUE_TIME_MIDDLEWARE=1`** (and restart) so `queue_time_ms` is populated from Heroku’s router; the web dyno does not need a shared Delayed Job DB for that path.
@@ -214,7 +214,7 @@ The gem POSTs JSON with **`timestamp`**, **`heroku_app`**, **`target_process`**,
214
214
 
215
215
  ### 7. Verify
216
216
 
217
- - At least one **web** dyno on `revize-prod` and one **worker** dyno on `revize-prod-mirror` so **`web.1`** and **`worker.1`** exist.
217
+ - At least one **web** dyno on `my-app-web` and one **worker** dyno on `my-app-workers` so **`web.1`** and **`worker.1`** exist.
218
218
  - Check **Rails logs** for `TjScaleRuby` lines (debug/warn/error).
219
219
  - Confirm your API receives periodic requests with the expected payload.
220
220
 
@@ -274,29 +274,29 @@ heroku config:set TJ_SCALE_API_URL=https://your-control-plane.example.com/api/v1
274
274
 
275
275
  The `DYNO` environment variable is automatically set by Heroku and is used to determine which dyno should run the monitoring loop (only `web.1` or `worker.1`, depending on `TJ_SCALE_MONITOR_PROCESS`).
276
276
 
277
- ### Example: web on `revize-prod`, workers on `revize-prod-mirror`
277
+ ### Example: web on `my-app-web`, workers on `my-app-workers`
278
278
 
279
279
  Use two Heroku apps (or one app with both process types—same idea). Configure each app’s config vars so the **monitoring service** receives `heroku_app`, `target_process`, and `job_count` on each POST. Scaling bounds (min/max dynos) are set in the control plane's dashboard.
280
280
 
281
- **App `revize-prod` (web dynos)** — run the reporter on the first web dyno and scale `web` dynos:
281
+ **App `my-app-web` (web dynos)** — run the reporter on the first web dyno and scale `web` dynos:
282
282
 
283
283
  ```bash
284
- heroku config:set TJ_SCALE_API_TOKEN=your_token -a revize-prod
285
- heroku config:set TJ_SCALE_MONITOR_PROCESS=web -a revize-prod
286
- heroku config:set TJ_SCALE_TARGET_APP=revize-prod -a revize-prod
287
- heroku config:set TJ_SCALE_TARGET_PROCESS=web -a revize-prod
288
- heroku config:set TJ_SCALE_API_URL=https://your-control-plane.example.com/api/v1/metrics -a revize-prod
289
- heroku config:set TJ_SCALE_ENABLE_QUEUE_TIME_MIDDLEWARE=1 -a revize-prod
284
+ heroku config:set TJ_SCALE_API_TOKEN=your_token -a my-app-web
285
+ heroku config:set TJ_SCALE_MONITOR_PROCESS=web -a my-app-web
286
+ heroku config:set TJ_SCALE_TARGET_APP=my-app-web -a my-app-web
287
+ heroku config:set TJ_SCALE_TARGET_PROCESS=web -a my-app-web
288
+ heroku config:set TJ_SCALE_API_URL=https://your-control-plane.example.com/api/v1/metrics -a my-app-web
289
+ heroku config:set TJ_SCALE_ENABLE_QUEUE_TIME_MIDDLEWARE=1 -a my-app-web
290
290
  ```
291
291
 
292
- **App `revize-prod-mirror` (worker dynos)** — run the reporter on `worker.1` and scale `worker` dynos:
292
+ **App `my-app-workers` (worker dynos)** — run the reporter on `worker.1` and scale `worker` dynos:
293
293
 
294
294
  ```bash
295
- heroku config:set TJ_SCALE_API_TOKEN=your_token -a revize-prod-mirror
296
- heroku config:set TJ_SCALE_MONITOR_PROCESS=worker -a revize-prod-mirror
297
- heroku config:set TJ_SCALE_TARGET_APP=revize-prod-mirror -a revize-prod-mirror
298
- heroku config:set TJ_SCALE_TARGET_PROCESS=worker -a revize-prod-mirror
299
- heroku config:set TJ_SCALE_API_URL=https://your-control-plane.example.com/api/v1/metrics -a revize-prod-mirror
295
+ heroku config:set TJ_SCALE_API_TOKEN=your_token -a my-app-workers
296
+ heroku config:set TJ_SCALE_MONITOR_PROCESS=worker -a my-app-workers
297
+ heroku config:set TJ_SCALE_TARGET_APP=my-app-workers -a my-app-workers
298
+ heroku config:set TJ_SCALE_TARGET_PROCESS=worker -a my-app-workers
299
+ heroku config:set TJ_SCALE_API_URL=https://your-control-plane.example.com/api/v1/metrics -a my-app-workers
300
300
  ```
301
301
 
302
302
  Ensure both apps have the `web` / `worker` process types in the `Procfile` as needed, deploy, and scale at least one dyno of each monitored type so `web.1` / `worker.1` exist.
@@ -388,7 +388,7 @@ For a full checklist (git, tests, version, integrate in the app, Heroku), see **
388
388
  3. Build the gem:
389
389
 
390
390
  ```bash
391
- gem build tj-scale-ruby.gemspec
391
+ gem build tj-scale.gemspec
392
392
  ```
393
393
 
394
394
  This will create a `.gem` file in the current directory.
@@ -400,7 +400,7 @@ This will create a `.gem` file in the current directory.
400
400
  3. Configure your credentials:
401
401
 
402
402
  ```bash
403
- gem push --key your_api_key tj-scale-ruby-1.0.0.gem
403
+ gem push --key your_api_key tj-scale-1.0.1.gem
404
404
  ```
405
405
 
406
406
  Or use the credentials file:
@@ -411,7 +411,7 @@ Or use the credentials file:
411
411
  # ---
412
412
  # :rubygems_api_key: your_api_key_here
413
413
 
414
- gem push tj-scale-ruby-1.0.0.gem
414
+ gem push tj-scale-1.0.1.gem
415
415
  ```
416
416
 
417
417
  ### Publishing to a Private Gem Server
@@ -419,7 +419,7 @@ gem push tj-scale-ruby-1.0.0.gem
419
419
  If you're using a private gem server:
420
420
 
421
421
  ```bash
422
- gem push tj-scale-ruby-1.0.0.gem --host https://your-gem-server.com
422
+ gem push tj-scale-1.0.1.gem --host https://your-gem-server.com
423
423
  ```
424
424
 
425
425
  ## Deployment
@@ -429,7 +429,7 @@ gem push tj-scale-ruby-1.0.0.gem --host https://your-gem-server.com
429
429
  1. Add the gem to your `Gemfile`:
430
430
 
431
431
  ```ruby
432
- gem "tj-scale-ruby", "~> 1.2"
432
+ gem "tj-scale", "~> 1.0"
433
433
  ```
434
434
 
435
435
  2. Set the required environment variables:
@@ -469,7 +469,7 @@ The gem works with any Rails application. Just ensure:
469
469
 
470
470
  ## Contributing
471
471
 
472
- Bug reports and pull requests are welcome on GitHub at https://github.com/untechnickle/tj-scale-ruby.
472
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Untechnickle/tj-scale-gem.
473
473
 
474
474
  1. Fork the repository
475
475
  2. Create your feature branch (`git checkout -b feature/amazing-feature`)
@@ -491,7 +491,7 @@ See [CHANGELOG.md](CHANGELOG.md) for a list of changes and version history.
491
491
 
492
492
  ## Support
493
493
 
494
- For issues, questions, or contributions, please open an issue on the [GitHub repository](https://github.com/untechnickle/tj-scale-ruby/issues).
494
+ For issues, questions, or contributions, please open an issue on the [GitHub repository](https://github.com/Untechnickle/tj-scale-gem/issues).
495
495
 
496
496
  ## Authors
497
497
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  # Version module for TjScaleRuby gem
4
4
  module TjScaleRuby
5
- VERSION = "1.0.0"
5
+ VERSION = "1.0.2"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tj-scale
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanuj
@@ -148,21 +148,23 @@ dependencies:
148
148
  - !ruby/object:Gem::Version
149
149
  version: '0.14'
150
150
  description: |
151
- TjScaleRuby reports metrics from your Rails app to an TJ Scale (or compatible)
152
- control plane so it can autoscale Heroku formation from rules you configure there.
151
+ TJ Scale is a lightweight metrics agent that lets a TJ Scale dashboard autoscale
152
+ your Heroku dynos based on real queue pressure instead of CPU or memory.
153
153
 
154
- Behavior at a glance:
155
- - Runs a background loop on exactly one dyno: web.1 or worker.1 (configurable).
156
- - Worker reporter: waiting job count and oldest-job age (queue_time_s) from Delayed Job
157
- or Sidekiq pick with TJ_SCALE_JOB_BACKEND (auto-detected by default).
158
- - Web reporter: router queue_time_ms (Rack middleware + X-Request-Start), request volume,
159
- and average response time per reporting interval.
160
- - Sends target Heroku app and process type on every POST; scaling limits
161
- (min/max dynos) are configured in the control plane's dashboard settings.
162
- - Configure with environment variables; no Rails initializer required.
154
+ Add the gem, set a few environment variables, and a background reporter starts on
155
+ exactly one dyno (web.1 or worker.1 — your choice). Every few seconds it POSTs a
156
+ small JSON payload to your dashboard, which applies the scaling rules, limits, and
157
+ cooldowns you configure there and calls the Heroku Platform API. The gem itself
158
+ never scales anything, keeping your app free of Heroku credentials.
163
159
 
164
- Requires Rails 6.1+ and Ruby 3.0+. Bring your own queue gem: delayed_job_active_record
165
- or sidekiq (worker reporters only).
160
+ Worker mode reports the number of waiting jobs and the age of the oldest one, from
161
+ either Delayed Job or Sidekiq (auto-detected). Web mode reports router queue time
162
+ (via Rack middleware and the X-Request-Start header), request volume, and average
163
+ response time.
164
+
165
+ Zero-config inside Rails: no initializer needed, everything is driven by
166
+ environment variables. Requires Rails 6.1+ and Ruby 3.0+. For worker metrics,
167
+ bring your own queue gem (delayed_job_active_record or sidekiq).
166
168
  email:
167
169
  - tanuj@untechnickle.com
168
170
  executables: []
@@ -204,6 +206,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
206
  requirements: []
205
207
  rubygems_version: 3.6.2
206
208
  specification_version: 4
207
- summary: 'Rails gem: Delayed Job / Sidekiq queue metrics for Heroku auto-scaling (web
208
- or worker dynos)'
209
+ summary: Heroku autoscaling agent for Rails reports web and worker queue metrics
210
+ (Delayed Job or Sidekiq) to your TJ Scale dashboard
209
211
  test_files: []