fix usd metric
ci/woodpecker/push/tests Pipeline was successful

This commit is contained in:
2026-07-26 11:41:58 +00:00
parent 6ffd88927c
commit e1cb5d7d96
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ pub async fn exec_review(
review_result.cost = chat_result.cost;
if let Some(cost) = review_result.cost {
metrics::openrouter_cost_usd((cost / 100.0).round() as u64);
metrics::openrouter_cost_usd(cost);
}
let final_review_markdown = review_result_to_markdown(&review_result);
+3 -3
View File
@@ -35,8 +35,8 @@ pub fn task_failed(event_type: &str) {
.increment(1);
}
pub fn openrouter_cost_usd(cost: u64) {
counter!("herald_openrouter_cost_usd_total").increment(cost);
pub fn openrouter_cost_usd(cost: f64) {
counter!("herald_openrouter_cost_cents_total").increment((cost * 100.0).round() as u64);
}
pub fn describe() {
@@ -46,7 +46,7 @@ pub fn describe() {
describe_gauge!("herald_bot_tasks_active", Unit::Count, "Bot tasks currently in progress");
describe_counter!("herald_bot_tasks_completed_total", Unit::Count, "Bot tasks completed successfully");
describe_counter!("herald_bot_tasks_failed_total", Unit::Count, "Bot tasks that failed");
describe_counter!("herald_openrouter_cost_usd_total", Unit::Count, "Total OpenRouter cost in USD");
describe_counter!("herald_openrouter_cost_cents_total", Unit::Count, "Total OpenRouter cost in cents (divide by 100 for USD)");
}
pub fn install(bind_addr: &str) -> anyhow::Result<()> {