# 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.fromtypingimportOptionalfromopensearchpy.metrics.metricsimportMetrics
[docs]classMetricsNone(Metrics):""" Default metrics class. It sets the start time, end time, and service time to None. """@propertydefstart_time(self)->Optional[float]:returnself._start_time@propertydefend_time(self)->Optional[float]:returnself._end_time@propertydefservice_time(self)->Optional[float]:returnself._service_timedef__init__(self)->None:self._start_time:Optional[float]=Noneself._end_time:Optional[float]=Noneself._service_time:Optional[float]=None# request_start and request_end are placeholders,# not implementing actual metrics collection in this subclass.defrequest_start(self)->None:self._start_time=Noneself._end_time=Noneself._service_time=Nonedefrequest_end(self)->None:self._end_time=Noneself._service_time=None