X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_mon%2Fplugins%2FOpenStack%2FGnocchi%2Fmetric_handler.py;h=9736da87637345edfa24e169b35a3af6da1dcfc9;hb=0e34244e420bd68e6acb0cf6bb4383fedb662070;hp=91dc402b7e27b5e529d6c589574ce0f17999968d;hpb=cca77765cc8d43a0a5524e3754b7587b149300b4;p=osm%2FMON.git diff --git a/osm_mon/plugins/OpenStack/Gnocchi/metric_handler.py b/osm_mon/plugins/OpenStack/Gnocchi/metric_handler.py index 91dc402..9736da8 100644 --- a/osm_mon/plugins/OpenStack/Gnocchi/metric_handler.py +++ b/osm_mon/plugins/OpenStack/Gnocchi/metric_handler.py @@ -384,10 +384,7 @@ class OpenstackMetricHandler(object): # FIXME: Local timezone may differ from timezone set in Gnocchi, causing discrepancies in measures stop_time = time.strftime("%Y-%m-%d") + "T" + time.strftime("%X") end_time = int(round(time.time() * 1000)) - if collection_unit == 'YEAR': - diff = PERIOD_MS[collection_unit] - else: - diff = collection_period * PERIOD_MS[collection_unit] + diff = collection_period * PERIOD_MS[collection_unit] s_time = (end_time - diff) / 1000.0 start_time = datetime.datetime.fromtimestamp(s_time).strftime( '%Y-%m-%dT%H:%M:%S.%f')