Skip to content

Commit ae8dd5a

Browse files
committed
fix
1 parent ff2fa6b commit ae8dd5a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: docs/metrics.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ For [MediaPipe Graphs](./mediapipe.md) execution there are 4 generic metrics whi
241241
| counter | ovms_responses | Useful to track number of packets generated by MediaPipe graph. Keep in mind that single request may trigger production of multiple (or zero) packets, therefore tracking number of responses is complementary to tracking accepted requests. For example tracking streaming partial responses of LLM text generation graphs. |
242242
| gauge | ovms_current_graphs | Number of graphs currently in-process. For unary communication it is equal to number of currently processing requests (each request initializes separate MediaPipe graph). For streaming communication it is equal to number of active client connections. Each connection is able to reuse the graph and decide when to delete it when the connection is closed. |
243243
| counter | ovms_graph_error | Counts errors in MediaPipe graph execution phase. For example V3 LLM text generation fails in LLMCalculator due to missing prompt - calculator returns an error and graph cancels. |
244-
| histogram | ovms_graph_processing_time_us | Time for which mediapipe graph was opened. |
244+
| histogram | ovms_graph_processing_time_us | Time for which mediapipe graph was opened and been successfully closed. |
245245

246246
Exposing custom metrics in calculator implementations (MediaPipe graph nodes) is not supported yet.
247247

Diff for: src/mediapipe_internal/mediapipegraphexecutor.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ class MediapipeGraphExecutor {
203203
INCREMENT_IF_ENABLED(this->mediapipeServableMetricReporter->getGraphErrorMetric(executionContext));
204204
}
205205
MP_RETURN_ON_FAIL(status, "graph wait until done", mediapipeAbslToOvmsStatus(status.code()));
206-
timer.stop(PROCESS);
207-
double processTime = timer.template elapsed<std::chrono::microseconds>(PROCESS);
208-
OBSERVE_IF_ENABLED(this->mediapipeServableMetricReporter->getProcessingTimeMetric(executionContext), processTime);
209206
if (outputPollers.size() != outputPollersWithReceivedPacket.size()) {
210207
SPDLOG_DEBUG("Mediapipe failed to execute. Failed to receive all output packets");
211208
return Status(StatusCode::MEDIAPIPE_EXECUTION_ERROR, "Unknown error during mediapipe execution");
212209
}
210+
timer.stop(PROCESS);
211+
double processTime = timer.template elapsed<std::chrono::microseconds>(PROCESS);
212+
OBSERVE_IF_ENABLED(this->mediapipeServableMetricReporter->getProcessingTimeMetric(executionContext), processTime);
213213
INCREMENT_IF_ENABLED(this->mediapipeServableMetricReporter->getResponsesMetric(executionContext));
214214
SPDLOG_DEBUG("Received all output stream packets for graph: {}", this->name);
215215
return StatusCode::OK;

0 commit comments

Comments
 (0)