MCPcopy Create free account
hub / github.com/Qv2ray/Qv2ray / CallStatsAPIByName

Method CallStatsAPIByName

src/core/kernel/APIBackend.cpp:124–142  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 qint64 APIWorker::CallStatsAPIByName(const QString &name)
125 {
126 ClientContext context;
127 GetStatsRequest request;
128 GetStatsResponse response;
129 request.set_name(name.toStdString());
130 request.set_reset(true);
131
132 const auto status = stats_service_stub->GetStats(&context, request, &response);
133 if (!status.ok())
134 {
135 LOG("API call returns: " + QSTRN(status.error_code()) + " (" + QString::fromStdString(status.error_message()) + ")");
136 return Qv2ray_GRPC_ERROR_RETCODE;
137 }
138 else
139 {
140 return response.stat().value();
141 }
142 }
143} // namespace Qv2ray::core::kernel

Callers

nothing calls this directly

Calls 2

okMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected