RunningRequestInfo
This class describes one Search, HybridSearch, or Query request that a proxy is executing, as returned by ListRunningRequests() and CancelRequests().
The RunningRequestInfos alias is std::vector<RunningRequestInfo>.
METHODS:
const std::string& RequestId() constThe request id, an opaque string such as
25-to03zu-rs; pass it toCancelRequests()unchanged.int64_t ProxyId() constThe node id of the proxy that holds the request.
const std::string& Type() constThe request type:
Search,HybridSearch, orQuery.const std::string& DatabaseName() constThe database name.
const std::string& CollectionName() constThe collection name.
const std::string& User() constThe user who issued the request.
const std::string& ClientAddr() constThe client address seen by the proxy.
int64_t Nq() constThe number of query vectors.
int64_t TopK() constThe top-k of the request.
const std::string& Expr() constThe leading part (at most 256 bytes) of the filter expression.
int64_t StartTimeMs() constThe time the request started, in milliseconds since the Unix epoch.
int64_t QueuedMs() constHow long the request’s first task waited in the proxy queue, in milliseconds;
0until that task starts.int64_t ElapsedMs() constHow long the request has been running, in milliseconds. In a
CancelRequests()answer it is how long the request had been running when it was canceled.const std::string& State() constThe request state:
Queued,Running, orCanceling. In aCancelRequests()answer it is the state before the cancel, orCancelingwhen the call repeated an earlier cancel.const std::vector<int64_t>& TaskIds() constThe ids of the proxy tasks the request has created.
const std::string& TraceId() constThe trace id of the request.
bool Cancellable() constWhether the request can be canceled.
Example
#include "milvus/MilvusClientV2.h"
#include <iostream>
using namespace milvus;
// ListRunningRequests() returns one RunningRequestInfo per running request
auto client = MilvusClientV2::Create();
client->Connect(ConnectParam("http://localhost:19530").WithToken("root:Milvus"));
ListRunningRequestsResponse response;
auto status = client->ListRunningRequests(
ListRunningRequestsRequest().WithMinElapsedMs(1000),
response);
if (!status.IsOk()) {
std::cout << status.Message() << std::endl;
}
for (const auto& info : response.Requests()) {
std::cout << "request " << info.RequestId()
<< " type=" << info.Type()
<< " state=" << info.State()
<< " elapsed=" << info.ElapsedMs() << std::endl;
}