Skip to content

Commit

Permalink
fix(tap-agent): unaggregated_fees metric last RAV
Browse files Browse the repository at this point in the history
The Unaggregated fees metric was not updating on last RAV.
  • Loading branch information
aasseman committed Jun 28, 2024
1 parent ad1605b commit c166626
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tap-agent/src/agent/sender_allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,13 @@ impl Actor for SenderAllocation {
unaggreated_fees.clone(),
))?;
}

UNAGGREGATED_FEES
.with_label_values(&[
&state.sender.to_string(),
&state.allocation_id.to_string(),
])
.set(state.unaggregated_fees.value as f64);
}
// we use a blocking call here to ensure that only one RAV request is running at a time.
SenderAllocationMessage::TriggerRAVRequest(reply) => {
Expand All @@ -279,11 +286,6 @@ impl Actor for SenderAllocation {
}
}

// We expect the value to change for every received receipt, and after every RAV request.
UNAGGREGATED_FEES
.with_label_values(&[&state.sender.to_string(), &state.allocation_id.to_string()])
.set(state.unaggregated_fees.value as f64);

Ok(())
}
}
Expand Down Expand Up @@ -575,6 +577,9 @@ impl SenderAllocationState {
RAVS_CREATED
.with_label_values(&[&self.sender.to_string(), &self.allocation_id.to_string()])
.inc();
UNAGGREGATED_FEES
.with_label_values(&[&self.sender.to_string(), &self.allocation_id.to_string()])
.set(self.unaggregated_fees.value as f64);

Ok(response.data)
}
Expand Down

0 comments on commit c166626

Please sign in to comment.