RunningRequestInfo
One Search, HybridSearch or Query request that a proxy is executing.
pub struct RunningRequestInfo
PARAMETERS:
request_id: StringOpaque request id, such as
"25-to03zu-rs", passed tocancel_requestsunchanged.proxy_id: i64The node id of the proxy that holds the request.
request_type: StringThe request type:
Search,HybridSearchorQuery.database_name: StringThe database the request targets.
collection_name: StringThe collection the request targets.
user: StringThe user who issued the request.
client_addr: StringThe client address seen by the proxy.
nq: i64The number of query vectors.
top_k: i64The top-k of the request.
expr: StringThe leading part (at most 256 bytes) of the filter expression.
start_time_ms: i64The time the request started, in milliseconds since the Unix epoch.
queued_ms: i64How long the request’s first task waited in the proxy queue, in milliseconds;
0until that task starts.elapsed_ms: i64How long the request has been running, in milliseconds. In a
cancel_requestsanswer it is how long the request had been running when it was canceled.state: StringThe request state:
Queued,RunningorCanceling. In acancel_requestsanswer it is the state before the cancel, orCancelingwhen the call repeated an earlier cancel.task_ids: Vec<i64>The ids of the proxy tasks the request has created.
trace_id: StringThe trace id of the request.
cancellable: boolWhether the request can be canceled.
METHODS:
new()- Creates a value initialized with its SDK defaults.request_id(value)/set_request_id(value)/get_request_id()- Sets or returns the request id.proxy_id(value)/set_proxy_id(value)/get_proxy_id()- Sets or returns the node id of the proxy that holds the request.request_type(value)/set_request_type(value)/get_type()- Sets the request type or returns it (Search,HybridSearchorQuery).database_name(value)/set_database_name(value)/get_database_name()- Sets or returns the database name.collection_name(value)/set_collection_name(value)/get_collection_name()- Sets or returns the collection name.user(value)/set_user(value)/get_user()- Sets or returns the user who issued the request.client_addr(value)/set_client_addr(value)/get_client_addr()- Sets or returns the client address.nq(value)/set_nq(value)/get_nq()- Sets or returns the number of query vectors.top_k(value)/set_top_k(value)/get_top_k()- Sets or returns the top-k.expr(value)/set_expr(value)/get_expr()- Sets or returns the leading part of the filter expression.start_time_ms(value)/set_start_time_ms(value)/get_start_time_ms()- Sets or returns the start time.queued_ms(value)/set_queued_ms(value)/get_queued_ms()- Sets or returns the queued time.elapsed_ms(value)/set_elapsed_ms(value)/get_elapsed_ms()- Sets or returns the elapsed time.state(value)/set_state(value)/get_state()- Sets or returns the request state.task_ids(values)/set_task_ids(values)/get_task_ids()- Sets or returns the task ids.add_task_id(value)- Adds one task id.trace_id(value)/set_trace_id(value)/get_trace_id()- Sets or returns the trace id.cancellable(value)/set_cancellable(value)/is_cancellable()- Sets or returns whether the request can be canceled.
Example
let resp = client
.list_running_requests(ListRunningRequestsRequest::builder().build()?)
.await?;
for info in resp.requests() {
println!(
"{} {}: user={} nq={} state={} elapsed={}ms",
info.get_type(),
info.get_request_id(),
info.get_user(),
info.get_nq(),
info.get_state(),
info.get_elapsed_ms()
);
}