Skip to content

Commit 304e47f

Browse files
authored
refactor(census): rename Broadcaster metrics to Gateway (#3055)
* refactor(census): rename Broadcaster metrics to Gateway This commit renames the metrics related to Broadcaster to Gateway, following a team decision. More details can be found in the discussion here: [Team Discussion Link](.com/channels/423160867534929930/1051963444598943784/1210356864643109004). * chore: update pending changelog
1 parent 19f1cf6 commit 304e47f

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

CHANGELOG_PENDING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## vX.X
44

5-
- [#3053](https://github.com/livepeer/go-livepeer/pull/3053) cli: add `-gateway` flag and deprecate `-broadcaster` flag.
5+
- [#3055](https://github.com/livepeer/go-livepeer/pull/3055) census: Rename broadcaster metrics to gateway metrics
6+
- [#3053](https://github.com/livepeer/go-livepeer/pull/3053) cli: add `-gateway` flag and deprecate `-broadcaster` flag.
67

78
### Breaking Changes 🚨🚨
89

monitor/census.go

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ func InitCensus(nodeType NodeType, version string) {
306306
census.mTicketValueSent = stats.Float64("ticket_value_sent", "TicketValueSent", "gwei")
307307
census.mTicketsSent = stats.Int64("tickets_sent", "TicketsSent", "tot")
308308
census.mPaymentCreateError = stats.Int64("payment_create_errors", "PaymentCreateError", "tot")
309-
census.mDeposit = stats.Float64("broadcaster_deposit", "Current remaining deposit for the broadcaster node", "gwei")
310-
census.mReserve = stats.Float64("broadcaster_reserve", "Current remaining reserve for the broadcaster node", "gwei")
309+
census.mDeposit = stats.Float64("gateway_deposit", "Current remaining deposit for the gateway node", "gwei")
310+
census.mReserve = stats.Float64("gateway_reserve", "Current remaining reserve for the gateway node", "gwei")
311311

312312
// Metrics for receiving payments
313313
census.mTicketValueRecv = stats.Float64("ticket_value_recv", "TicketValueRecv", "gwei")
@@ -690,17 +690,32 @@ func InitCensus(nodeType NodeType, version string) {
690690
TagKeys: baseTagsWithManifestID,
691691
Aggregation: view.Sum(),
692692
},
693+
{
694+
Name: "gateway_deposit",
695+
Measure: census.mDeposit,
696+
Description: "Current remaining deposit for the gateway node",
697+
TagKeys: baseTagsWithEthAddr,
698+
Aggregation: view.LastValue(),
699+
},
700+
{
701+
Name: "gateway_reserve",
702+
Measure: census.mReserve,
703+
Description: "Current remaining reserve for the gateway node",
704+
TagKeys: baseTagsWithEthAddr,
705+
Aggregation: view.LastValue(),
706+
},
707+
// TODO: Keep the old names for backwards compatibility, remove in the future
693708
{
694709
Name: "broadcaster_deposit",
695710
Measure: census.mDeposit,
696-
Description: "Current remaining deposit for the broadcaster node",
711+
Description: "Current remaining deposit for the gateway node",
697712
TagKeys: baseTagsWithEthAddr,
698713
Aggregation: view.LastValue(),
699714
},
700715
{
701716
Name: "broadcaster_reserve",
702717
Measure: census.mReserve,
703-
Description: "Current remaining reserve for the broadcaster node",
718+
Description: "Current remaining reserve for the gateway node",
704719
TagKeys: baseTagsWithEthAddr,
705720
Aggregation: view.LastValue(),
706721
},
@@ -1533,7 +1548,7 @@ func PaymentCreateError(ctx context.Context) {
15331548
}
15341549
}
15351550

1536-
// Deposit records the current deposit for the broadcaster
1551+
// Deposit records the current deposit for the gateway
15371552
func Deposit(sender string, deposit *big.Int) {
15381553
if err := stats.RecordWithTags(census.ctx,
15391554
[]tag.Mutator{tag.Insert(census.kSender, sender)}, census.mDeposit.M(wei2gwei(deposit))); err != nil {

0 commit comments

Comments
 (0)