Loading
Remove unused method Postgresql::ReplicationSlot.slots_retained_bytes
Summary
Removes the unused method Postgresql::ReplicationSlot.slots_retained_bytes from app/models/postgresql/replication_slot.rb.
Related to #542966
Verification
This method was verified as unused by:
-
keela --type methodsflagged it as unused - Grep search found no callers (across
app/,lib/,ee/,spec/,config/,db/) - No metaprogramming patterns reference it (no
send/public_send/symbol/string dispatch) - Not a Rails convention method
- Not a callback
The only references anywhere were the method definition itself and its dedicated spec block. Sibling methods on the same model (count, used_slots_count, max_retained_wal, lag_too_great?) remain in use by ee/app/models/geo_node.rb and ee/app/workers/geo/prune_event_log_worker.rb; slots_retained_bytes is never called.
Cascade Removals
None - this was a standalone removal.
Metrics
Source File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| File flog total | 64.8 | 59.8 | -5.0 (7.7%) |
| Method flog score | 5.0 | N/A | -5.0 removed |
Spec File Complexity (flog)
| Metric | Before | After | Improvement |
|---|---|---|---|
| Spec file flog total | 278.6 | 255.5 | -23.1 (8.3%) |
| Spec block flog score | 23.1 | N/A | -23.1 removed |
Combined Flog Summary
| File | Flog Removed |
|---|---|
app/models/postgresql/replication_slot.rb |
5.0 |
spec/models/postgresql/replication_slot_spec.rb |
23.1 |
| Total | 28.1 |
Test Suite Impact
- Specs removed: 1 example
- Spec file:
spec/models/postgresql/replication_slot_spec.rb - Time saved per run: 0.176 seconds
Estimated CI Savings
| Estimate | Pipelines/Month | Time Saved | Cost Saved/Month | Cost Saved/Year |
|---|---|---|---|---|
| Pessimistic | 15,000 | 0.73 hrs/month | $1.32 | $15.84 |
| Moderate | 30,000 | 1.47 hrs/month | $2.64 | $31.68 |
| Optimistic | 50,000 | 2.44 hrs/month | $4.40 | $52.80 |
Based on 0.176 seconds saved per pipeline × $0.03/minute (large runners: 3x cost factor on $10/1000 base minutes)
Files Modified
app/models/postgresql/replication_slot.rb(method removed - 12 lines)spec/models/postgresql/replication_slot_spec.rb(specs removed - 9 lines, 1 example)scripts/lint/keela_baseline.yml(entry removed)
Related
- Related to #542966 (Improve unused helper methods workflow)
- Part of dead code cleanup effort
- Method was listed in
scripts/lint/keela_baseline.yml