This engine is designed for rollup (thinning and aggregating/averaging) [Graphite](http://graphite.readthedocs.io/en/latest/index.html) data. It may be helpful to developers who want to use ClickHouse as a data store for Graphite.
You can use any ClickHouse table engine to store the Graphite data if you don't need rollup, but if you need a rollup use `GraphiteMergeTree`. The engine reduces the volume of storage and increases the efficiency of queries from Graphite.
A table for the Graphite date should have the following columns:
- Column with the metric name (Graphite sensor). Data type: `String`.
- Column with the time for measuring the metric. Data type: `DateTime`.
- Column with the value of the metric. Data type: any numeric.
- Column with the version of the metric with the same name and time of measurement. Data type: any numeric.
ClickHouse saves the rows with the highest version or the last written if versions are the same. Other rows are deleted during the merge of data parts.
The names of these columns should be set in the rollup configuration.
**GraphiteMergeTree parameters**
-`config_section` — Name of the section in the configuration file, where are the rules of rollup set.
The settings for rollup are defined by the [graphite_rollup](../server_settings/settings.md) parameter in the server configuration. The name of the parameter could be any. You can create several configurations and use them for different tables.
When processing a row, ClickHouse checks the rules in the `pattern` section. If the metric name matches the `regexp`, the rules from the `pattern`section are applied; otherwise, the rules from the `default` section are used.
The rules are defined with fields `function` and `age + precision`.
Fields for `pattern` and `default` sections:
-`regexp`– A pattern for the metric name.
-`age`– The minimum age of the data in seconds.
-`precision`– How precisely to define the age of the data in seconds.
-`function`– The name of the aggregating function to apply to data whose age falls within the range `[age, age + precision]`.
The `required-columns`:
-`path_column_name` — Column with the metric name (Graphite sensor).
-`time_column_name` — Column with the time for measuring the metric.
-`value_column_name` — Column with the value of the metric at the time set in `time_column_name`.
-`version_column_name` — Column with the version timestamp of the metric with the same name and time remains in the database.