diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:54:23 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-24 09:54:44 +0000 |
commit | 836b47cb7e99a977c5a23b059ca1d0b5065d310e (patch) | |
tree | 1604da8f482d02effa033c94a84be42bc0c848c3 /src/database/engine/pagecache.h | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.tar.xz netdata-836b47cb7e99a977c5a23b059ca1d0b5065d310e.zip |
Merging upstream version 1.46.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/database/engine/pagecache.h')
-rw-r--r-- | src/database/engine/pagecache.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/database/engine/pagecache.h b/src/database/engine/pagecache.h new file mode 100644 index 000000000..2e9f13ab7 --- /dev/null +++ b/src/database/engine/pagecache.h @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +#ifndef NETDATA_PAGECACHE_H +#define NETDATA_PAGECACHE_H + +#include "rrdengine.h" + +extern struct mrg *main_mrg; +extern struct pgc *main_cache; +extern struct pgc *open_cache; +extern struct pgc *extent_cache; + +/* Forward declarations */ +struct rrdengine_instance; + +#define INVALID_TIME (0) + +extern struct rrdeng_cache_efficiency_stats rrdeng_cache_efficiency_stats; + +struct page_descr_with_data { + nd_uuid_t *id; + Word_t metric_id; + usec_t start_time_ut; + usec_t end_time_ut; + uint8_t type; + uint32_t update_every_s; + uint32_t page_length; + struct pgd *pgd; + + struct { + struct page_descr_with_data *prev; + struct page_descr_with_data *next; + } link; +}; + +struct pg_alignment { + uint32_t refcount; +}; + +struct rrdeng_query_handle; +struct page_details_control; + +void rrdeng_prep_wait(struct page_details_control *pdc); +void rrdeng_prep_query(struct page_details_control *pdc, bool worker); +void pg_cache_preload(struct rrdeng_query_handle *handle); +struct pgc_page *pg_cache_lookup_next(struct rrdengine_instance *ctx, struct page_details_control *pdc, time_t now_s, uint32_t last_update_every_s, size_t *entries); +void pgc_and_mrg_initialize(void); + +void pgc_open_add_hot_page(Word_t section, Word_t metric_id, time_t start_time_s, time_t end_time_s, uint32_t update_every_s, struct rrdengine_datafile *datafile, uint64_t extent_offset, unsigned extent_size, uint32_t page_length); + +#endif /* NETDATA_PAGECACHE_H */ |