Skip to content

Commit

Permalink
storage: remove double check of granularity
Browse files Browse the repository at this point in the history
The storage engine check twice that the granularity matches. Do it once only.
  • Loading branch information
jd authored and pastamaker[bot] committed Dec 14, 2017
1 parent 30d865e commit 572f015
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions gnocchi/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,14 @@ def _get_measures_timeserie(self, metric,
else:
raise GranularityDoesNotExist(metric, granularity)

all_keys = None
try:
all_keys = self._list_split_keys_for_metric(
metric, aggregation, granularity)
except MetricDoesNotExist:
for d in metric.archive_policy.definition:
if d.granularity == granularity:
return carbonara.AggregatedTimeSerie(
sampling=granularity,
aggregation_method=aggregation,
max_size=d.points)
raise GranularityDoesNotExist(metric, granularity)
return carbonara.AggregatedTimeSerie(
sampling=granularity,
aggregation_method=aggregation,
max_size=points)

if from_timestamp:
from_timestamp = carbonara.SplitKey.from_timestamp_and_sampling(
Expand Down

0 comments on commit 572f015

Please sign in to comment.