Skip to content

Commit

Permalink
refactor(census): rename Broadcaster metrics to Gateway (#3055)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rickstaa committed May 20, 2024
1 parent 9584c3c commit add7368
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions monitor/census.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ func InitCensus(nodeType NodeType, version string) {
census.mTicketValueSent = stats.Float64("ticket_value_sent", "TicketValueSent", "gwei")
census.mTicketsSent = stats.Int64("tickets_sent", "TicketsSent", "tot")
census.mPaymentCreateError = stats.Int64("payment_create_errors", "PaymentCreateError", "tot")
census.mDeposit = stats.Float64("broadcaster_deposit", "Current remaining deposit for the broadcaster node", "gwei")
census.mReserve = stats.Float64("broadcaster_reserve", "Current remaining reserve for the broadcaster node", "gwei")
census.mDeposit = stats.Float64("gateway_deposit", "Current remaining deposit for the gateway node", "gwei")
census.mReserve = stats.Float64("gateway_reserve", "Current remaining reserve for the gateway node", "gwei")

// Metrics for receiving payments
census.mTicketValueRecv = stats.Float64("ticket_value_recv", "TicketValueRecv", "gwei")
Expand Down Expand Up @@ -690,17 +690,32 @@ func InitCensus(nodeType NodeType, version string) {
TagKeys: baseTagsWithManifestID,
Aggregation: view.Sum(),
},
{
Name: "gateway_deposit",
Measure: census.mDeposit,
Description: "Current remaining deposit for the gateway node",
TagKeys: baseTagsWithEthAddr,
Aggregation: view.LastValue(),
},
{
Name: "gateway_reserve",
Measure: census.mReserve,
Description: "Current remaining reserve for the gateway node",
TagKeys: baseTagsWithEthAddr,
Aggregation: view.LastValue(),
},
// TODO: Keep the old names for backwards compatibility, remove in the future
{
Name: "broadcaster_deposit",
Measure: census.mDeposit,
Description: "Current remaining deposit for the broadcaster node",
Description: "Current remaining deposit for the gateway node",
TagKeys: baseTagsWithEthAddr,
Aggregation: view.LastValue(),
},
{
Name: "broadcaster_reserve",
Measure: census.mReserve,
Description: "Current remaining reserve for the broadcaster node",
Description: "Current remaining reserve for the gateway node",
TagKeys: baseTagsWithEthAddr,
Aggregation: view.LastValue(),
},
Expand Down Expand Up @@ -1533,7 +1548,7 @@ func PaymentCreateError(ctx context.Context) {
}
}

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

0 comments on commit add7368

Please sign in to comment.