From f59a1ccbd61d638619deec9e7293cba207aa5d5f Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Mon, 11 Apr 2016 14:55:30 +0200 Subject: [PATCH] doc/ap: document default archive policies and tweak them Medium default archive policy go for one minute resolution over a day. High was way too big, reduce it a bit. Change-Id: I4ac19fdb9c85a3a14232353b4f2535153a6ded74 --- doc/source/architecture.rst | 29 ++++++++++++++++++++-- gnocchi/archive_policy.py | 12 ++++----- gnocchi/tests/gabbi/gabbits-live/live.yaml | 4 +-- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/doc/source/architecture.rst b/doc/source/architecture.rst index aa4aee3ad..151b0ffaf 100644 --- a/doc/source/architecture.rst +++ b/doc/source/architecture.rst @@ -54,7 +54,7 @@ largely more scalable. Ceph also offers better consistency, and hence is the recommended driver. How to plan for Gnocchi’s storage -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------------------------------- Gnocchi uses a custom file format based on its library *Carbonara*. In Gnocchi, a time series is a collection of points, where a point is a given measure, or @@ -84,7 +84,7 @@ the 8 default aggregation methods (mean, min, max, sum, std, median, count, used will go up to a maximum of 8 × 4.5 MiB = 36 MiB. How to set the archive policy and granularity -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +--------------------------------------------- In Gnocchi, the archive policy is expressed in number of points. If your archive policy defines a policy of 10 points with a granularity of 1 second, @@ -109,3 +109,28 @@ policies. A typical low grained use case could be:: This would represent 7205 points × 17.92 = 126 KiB per aggregation method. If you use the 8 standard aggregation method, your metric will take up to 8 × 126 KiB = 0.98 MiB of disk space. + +Default archive policies +------------------------ + +By default, 3 archive policies are created using the default archive policy +list (listed in `default_aggregation_methods`, i.e. mean, min, max, sum, std, +median, count, 95pct): + +- low (maximum estimated size per metric: 5 KiB) + + * 5 minutes granularity over 1 hour + * 1 hour granularity over 1 day + * 1 day granularity over 1 month + +- medium (maximum estimated size per metric: 139 KiB) + + * 1 minute granularity over 1 day + * 1 hour granularity over 1 week + * 1 day granularity over 1 year + +- high (maximum estimated size per metric: 1 578 KiB) + + * 1 second granularity over 1 hour + * 1 minute granularity over 1 week + * 1 hour granularity over 1 year diff --git a/gnocchi/archive_policy.py b/gnocchi/archive_policy.py index e9cb723c1..792173918 100644 --- a/gnocchi/archive_policy.py +++ b/gnocchi/archive_policy.py @@ -222,8 +222,8 @@ DEFAULT_ARCHIVE_POLICIES = { ), 'medium': ArchivePolicy( "medium", 0, [ - # 1 minute resolution for an hour - ArchivePolicyItem(granularity=60, points=60), + # 1 minute resolution for an day + ArchivePolicyItem(granularity=60, points=60 * 24), # 1 hour resolution for a week ArchivePolicyItem(granularity=3600, points=7 * 24), # 1 day resolution for a year @@ -232,10 +232,10 @@ DEFAULT_ARCHIVE_POLICIES = { ), 'high': ArchivePolicy( "high", 0, [ - # 1 second resolution for a day - ArchivePolicyItem(granularity=1, points=3600 * 24), - # 1 minute resolution for a month - ArchivePolicyItem(granularity=60, points=60 * 24 * 30), + # 1 second resolution for an hour + ArchivePolicyItem(granularity=1, points=3600), + # 1 minute resolution for a week + ArchivePolicyItem(granularity=60, points=60 * 24 * 7), # 1 hour resolution for a year ArchivePolicyItem(granularity=3600, points=365 * 24), ], diff --git a/gnocchi/tests/gabbi/gabbits-live/live.yaml b/gnocchi/tests/gabbi/gabbits-live/live.yaml index bca36cdff..3f4ef0100 100644 --- a/gnocchi/tests/gabbi/gabbits-live/live.yaml +++ b/gnocchi/tests/gabbi/gabbits-live/live.yaml @@ -17,9 +17,9 @@ tests: response_headers: content-type: /application/json/ response_strings: - - '{"definition": [{"points": 86400, "timespan": "1 day, 0:00:00", "granularity": "0:00:01"}, {"points": 43200, "timespan": "30 days, 0:00:00", "granularity": "0:01:00"}, {"points": 8760, "timespan": "365 days, 0:00:00", "granularity": "1:00:00"}], "back_window": 0, "name": "high", "aggregation_methods": ["std", "count", "95pct", "min", "max", "sum", "median", "mean"]}' + - '{"definition": [{"points": 3600, "timespan": "1:00:00", "granularity": "0:00:01"}, {"points": 10080, "timespan": "7 days, 0:00:00", "granularity": "0:01:00"}, {"points": 8760, "timespan": "365 days, 0:00:00", "granularity": "1:00:00"}], "back_window": 0, "name": "high", "aggregation_methods": ["std", "count", "95pct", "min", "max", "sum", "median", "mean"]}' - '{"definition": [{"points": 12, "timespan": "1:00:00", "granularity": "0:05:00"}, {"points": 24, "timespan": "1 day, 0:00:00", "granularity": "1:00:00"}, {"points": 30, "timespan": "30 days, 0:00:00", "granularity": "1 day, 0:00:00"}], "back_window": 0, "name": "low", "aggregation_methods": ["std", "count", "95pct", "min", "max", "sum", "median", "mean"]}' - - '{"definition": [{"points": 60, "timespan": "1:00:00", "granularity": "0:01:00"}, {"points": 168, "timespan": "7 days, 0:00:00", "granularity": "1:00:00"}, {"points": 365, "timespan": "365 days, 0:00:00", "granularity": "1 day, 0:00:00"}], "back_window": 0, "name": "medium", "aggregation_methods": ["std", "count", "95pct", "min", "max", "sum", "median", "mean"]}' + - '{"definition": [{"points": 1440, "timespan": "1 day, 0:00:00", "granularity": "0:01:00"}, {"points": 168, "timespan": "7 days, 0:00:00", "granularity": "1:00:00"}, {"points": 365, "timespan": "365 days, 0:00:00", "granularity": "1 day, 0:00:00"}], "back_window": 0, "name": "medium", "aggregation_methods": ["std", "count", "95pct", "min", "max", "sum", "median", "mean"]}' - name: check generic resources with the default one for statsd url: /v1/resource/generic