From 8a0dcecdfe191ff476059c121fd088e99f54d678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Weing=C3=A4rtner?= Date: Mon, 13 May 2024 08:20:10 -0300 Subject: [PATCH] Address Chungg reviews --- gnocchi/storage/ceph.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gnocchi/storage/ceph.py b/gnocchi/storage/ceph.py index 0b525a41f..69a0f223a 100644 --- a/gnocchi/storage/ceph.py +++ b/gnocchi/storage/ceph.py @@ -96,9 +96,11 @@ def _store_metric_splits(self, metrics_keys_aggregations_data_offset, metric, key, agg.method, version) metric_size = len(data) - MAP_UNAGGREGATED_METRIC_NAME_BY_SIZE[name] = metric_size - LOG.debug("Storing time series size [%s] for metric [%s].", - metric_size, name) + if metric_size > DEFAULT_RADOS_BUFFER_SIZE: + MAP_UNAGGREGATED_METRIC_NAME_BY_SIZE[name] = metric_size + LOG.debug( + "Storing time series size [%s] for metric [%s].", + metric_size, name) if offset is None: self.ioctx.write_full(name, data) else: @@ -247,9 +249,11 @@ def _store_unaggregated_timeseries_unbatched( metric_name = self._build_unaggregated_timeserie_path(metric, version) metric_size = len(data) - MAP_UNAGGREGATED_METRIC_NAME_BY_SIZE[metric_name] = metric_size - LOG.debug("Storing unaggregated time series size [%s] for metric [%s]", - metric_size, metric_name) + if metric_size > DEFAULT_RADOS_BUFFER_SIZE: + MAP_UNAGGREGATED_METRIC_NAME_BY_SIZE[metric_name] = metric_size + LOG.debug( + "Storing unaggregated time series size [%s] for metric [%s]", + metric_size, metric_name) self.ioctx.write_full(metric_name, data) def _get_object_content(self, name, buffer_size=DEFAULT_RADOS_BUFFER_SIZE):