Skip to content

Commit

Permalink
history: replace remaining "query" mentions with "request"
Browse files Browse the repository at this point in the history
  • Loading branch information
muzarski committed Jan 13, 2025
1 parent 4c9fbf8 commit 4311591
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 79 deletions.
20 changes: 10 additions & 10 deletions scylla/src/client/pager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ where
let mut last_error: UserRequestError = UserRequestError::EmptyPlan;
let mut current_consistency: Consistency = self.query_consistency;

self.log_query_start();
self.log_request_start();

'nodes_in_plan: for (node, shard) in query_plan {
let span =
Expand Down Expand Up @@ -267,7 +267,7 @@ where
}

let error: TimeoutableRequestError = last_error.into();
self.log_query_error(&error);
self.log_request_error(&error);
let (proof, _) = self.sender.send(Err(error.into_query_error())).await;
proof
}
Expand Down Expand Up @@ -330,7 +330,7 @@ where
}) => {
let _ = self.metrics.log_query_latency(elapsed.as_millis() as u64);
self.log_attempt_success();
self.log_query_success();
self.log_request_success();
self.execution_profile
.load_balancing_policy
.on_request_success(&self.statement_info, elapsed, node);
Expand Down Expand Up @@ -358,7 +358,7 @@ where

// Query succeeded, reset retry policy for future retries
self.retry_session.reset();
self.log_query_start();
self.log_request_start();

Ok(ControlFlow::Continue(()))
}
Expand Down Expand Up @@ -394,16 +394,16 @@ where
}
}

fn log_query_start(&mut self) {
fn log_request_start(&mut self) {
let history_listener: &dyn HistoryListener = match &self.history_listener {
Some(hl) => &**hl,
None => return,
};

self.current_request_id = Some(history_listener.log_query_start());
self.current_request_id = Some(history_listener.log_request_start());
}

fn log_query_success(&mut self) {
fn log_request_success(&mut self) {
let history_listener: &dyn HistoryListener = match &self.history_listener {
Some(hl) => &**hl,
None => return,
Expand All @@ -414,10 +414,10 @@ where
None => return,
};

history_listener.log_query_success(request_id);
history_listener.log_request_success(request_id);
}

fn log_query_error(&mut self, error: &TimeoutableRequestError) {
fn log_request_error(&mut self, error: &TimeoutableRequestError) {
let history_listener: &dyn HistoryListener = match &self.history_listener {
Some(hl) => &**hl,
None => return,
Expand All @@ -428,7 +428,7 @@ where
None => return,
};

history_listener.log_query_error(request_id, error);
history_listener.log_request_error(request_id, error);
}

fn log_attempt_start(&mut self, node_addr: SocketAddr) {
Expand Down
6 changes: 3 additions & 3 deletions scylla/src/client/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ where
statement_config
.history_listener
.as_ref()
.map(|hl| (&**hl, hl.log_query_start()));
.map(|hl| (&**hl, hl.log_request_start()));

let load_balancer = &execution_profile.load_balancing_policy;

Expand Down Expand Up @@ -1988,8 +1988,8 @@ where

if let Some((history_listener, request_id)) = history_listener_and_id {
match &result {
Ok(_) => history_listener.log_query_success(request_id),
Err(e) => history_listener.log_query_error(request_id, e),
Ok(_) => history_listener.log_request_success(request_id),
Err(e) => history_listener.log_request_error(request_id, e),
}
}

Expand Down
Loading

0 comments on commit 4311591

Please sign in to comment.