# SPDX-License-Identifier: Apache-2.0## The OpenSearch Contributors require contributions made to# this file be licensed under the Apache-2.0 license or a# compatible open source license.## Modifications Copyright OpenSearch Contributors. See# GitHub history for details.fromabcimportABC,abstractmethodfromtypingimportOptional
[docs]classMetrics(ABC):""" The Metrics class defines methods and properties for managing request metrics, including start time, end time, and service time, serving as a blueprint for concrete implementations. """@abstractmethoddefrequest_start(self)->None:pass@abstractmethoddefrequest_end(self)->None:pass@property@abstractmethoddefstart_time(self)->Optional[float]:pass@property@abstractmethoddefend_time(self)->Optional[float]:pass@property@abstractmethoddefservice_time(self)->Optional[float]:pass