MCPcopy Create free account
hub / github.com/feast-dev/feast / RequestMetricsContext

Class RequestMetricsContext

sdk/python/feast/metrics.py:302–315  ·  view source on GitHub ↗

Mutable label holder yielded by :func:`track_request_latency`. Callers that need to resolve labels *inside* the ``with`` block (e.g. ``/get-online-features`` where the feature count is only known after ``_get_features`` succeeds) can set the attributes on the yielded object and they

Source from the content-addressed store, hash-verified

300
301
302class RequestMetricsContext:
303 """Mutable label holder yielded by :func:`track_request_latency`.
304
305 Callers that need to resolve labels *inside* the ``with`` block
306 (e.g. ``/get-online-features`` where the feature count is only
307 known after ``_get_features`` succeeds) can set the attributes
308 on the yielded object and they will be picked up in ``finally``.
309 """
310
311 __slots__ = ("feature_count", "feature_view_count")
312
313 def __init__(self, feature_count: str = "", feature_view_count: str = ""):
314 self.feature_count = feature_count
315 self.feature_view_count = feature_view_count
316
317
318@contextmanager

Callers 1

track_request_latencyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected