Skip to content

Commit 496c0a0

Browse files
committed
refactor: enhance logging for credential retrieval in Gemini client and credentials actor
1 parent b86852f commit 496c0a0

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

‎src/api/gemini_client.rs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::router::NexusState;
55
use axum::http::StatusCode;
66
use backon::{ExponentialBuilder, Retryable};
77
use serde::Serialize;
8-
use std::time::Duration;
8+
use std::time::{Duration, Instant};
99
use tracing::{error, info, warn};
1010

1111
use super::gemini_api::GeminiApi;
@@ -59,14 +59,17 @@ impl GeminiClient {
5959
let client = client.clone();
6060
let base_payload = base_payload.clone();
6161
async move {
62+
let start = Instant::now();
6263
let assigned = handle
6364
.get_credential(&ctx.model)
6465
.await?
6566
.ok_or(NexusError::NoAvailableCredential)?;
6667

6768
info!(
68-
"Using credential ID: {} Project: {}",
69-
assigned.id, assigned.project_id
69+
"Using credential ID: {}, Project: {}, Actor took {:?}",
70+
assigned.id,
71+
assigned.project_id,
72+
start.elapsed()
7073
);
7174

7275
let mut payload = base_payload.clone();

‎src/service/credentials_actor.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ impl CredentialsActor {
244244
}
245245

246246
if let Some(assigned) = assignment.assigned {
247-
debug!(
248-
"ID: {}, Project: {}, queue: {}, get credential",
247+
info!(
248+
"Get credential: ID: {}, Project: {}, queue: {}",
249249
assigned.id, assigned.project_id, query_key
250250
);
251251
let _ = reply_port.send(Some(assigned));

0 commit comments

Comments
 (0)