Skip to content

Commit 2a06960

Browse files
authored
Variable Granularity support for data collection (netdata#6430)
* Variable Granularity support for data collection in the dbengine. * Variable Granularity support for data collection in the daemon. * Added tests to validate the data being queried after having been collected by changing data collection interval * Fix memory corruption * Updated database engine documentation about data collection frequency behaviour
1 parent dab0eee commit 2a06960

File tree

15 files changed

+1604
-294
lines changed

15 files changed

+1604
-294
lines changed

backends/backends.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ calculated_number backend_calculate_value_from_stored_data(
131131
}
132132
*/
133133
for(rd->state->query_ops.init(rd, &handle, after, before) ; !rd->state->query_ops.is_finished(&handle) ; ) {
134-
n = rd->state->query_ops.next_metric(&handle);
134+
time_t curr_t;
135+
n = rd->state->query_ops.next_metric(&handle, &curr_t);
135136

136137
if(unlikely(!does_storage_number_exist(n))) {
137138
// not collected

daemon/unit_test.c

Lines changed: 281 additions & 73 deletions
Large diffs are not rendered by default.

database/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ Currently Netdata supports 6 memory modes:
4747
database. There is some amount of RAM dedicated to data caching and indexing and the rest of
4848
the data reside compressed on disk. The number of history entries is not fixed in this case,
4949
but depends on the configured disk space and the effective compression ratio of the data stored.
50+
This is the **only mode** that supports changing the data collection update frequency
51+
(`update_every`) **without losing** the previously stored metrics.
5052
For more details see [here](engine/).
5153

5254
You can select the memory mode by editing `netdata.conf` and setting:

database/engine/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ The Database Engine works like a traditional
44
database. There is some amount of RAM dedicated to data caching and indexing and the rest of
55
the data reside compressed on disk. The number of history entries is not fixed in this case,
66
but depends on the configured disk space and the effective compression ratio of the data stored.
7+
This is the **only mode** that supports changing the data collection update frequency
8+
(`update_every`) **without losing** the previously stored metrics.
79

810
## Files
911

0 commit comments

Comments
 (0)