From 0e798b564712e1650daa6a13ddda687ed1cedd11 Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Thu, 20 Apr 2023 13:06:12 +0000 Subject: [PATCH] Device component - Emulated Driver: - Removed hardcoded histogram buckets --- .../service/drivers/emulated/EmulatedDriver.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/device/service/drivers/emulated/EmulatedDriver.py b/src/device/service/drivers/emulated/EmulatedDriver.py index 14925f9f7..2acb28878 100644 --- a/src/device/service/drivers/emulated/EmulatedDriver.py +++ b/src/device/service/drivers/emulated/EmulatedDriver.py @@ -19,7 +19,7 @@ from apscheduler.executors.pool import ThreadPoolExecutor from apscheduler.job import Job from apscheduler.jobstores.memory import MemoryJobStore from apscheduler.schedulers.background import BackgroundScheduler -from common.method_wrappers.Decorator import MetricTypeEnum, MetricsPool, metered_subclass_method, INF +from common.method_wrappers.Decorator import MetricsPool, metered_subclass_method from common.type_checkers.Checkers import chk_float, chk_length, chk_string, chk_type from device.service.driver_api._Driver import _Driver from device.service.driver_api.AnyTreeTools import TreeNode, dump_subtree, get_subnode, set_subnode_value @@ -31,23 +31,7 @@ LOGGER = logging.getLogger(__name__) RE_GET_ENDPOINT_FROM_INTERFACE = re.compile(r'^\/interface\[([^\]]+)\].*') -HISTOGRAM_BUCKETS = ( - # .005, .01, .025, .05, .075, .1, .25, .5, .75, 1.0, INF - 0.0001, 0.00025, 0.00050, 0.00075, - 0.0010, 0.0025, 0.0050, 0.0075, - 0.0100, 0.0250, 0.0500, 0.0750, - 0.1000, 0.2500, 0.5000, 0.7500, - 1.0000, 2.5000, 5.0000, 7.5000, - 10.0, 25.0, 50.0, 75.0, - 100.0, INF -) METRICS_POOL = MetricsPool('Device', 'Driver', labels={'driver': 'emulated'}) -METRICS_POOL.get_or_create('GetInitialConfig', MetricTypeEnum.HISTOGRAM_DURATION, buckets=HISTOGRAM_BUCKETS) -METRICS_POOL.get_or_create('GetConfig', MetricTypeEnum.HISTOGRAM_DURATION, buckets=HISTOGRAM_BUCKETS) -METRICS_POOL.get_or_create('SetConfig', MetricTypeEnum.HISTOGRAM_DURATION, buckets=HISTOGRAM_BUCKETS) -METRICS_POOL.get_or_create('DeleteConfig', MetricTypeEnum.HISTOGRAM_DURATION, buckets=HISTOGRAM_BUCKETS) -METRICS_POOL.get_or_create('SubscribeState', MetricTypeEnum.HISTOGRAM_DURATION, buckets=HISTOGRAM_BUCKETS) -METRICS_POOL.get_or_create('UnsubscribeState', MetricTypeEnum.HISTOGRAM_DURATION, buckets=HISTOGRAM_BUCKETS) class EmulatedDriver(_Driver): def __init__(self, address : str, port : int, **settings) -> None: # pylint: disable=super-init-not-called -- GitLab