Difference between revisions of "Global cache"

From collectd Wiki
Jump to: navigation, search
(Created initial page.)
 
(Add note about AVL-trees and efficiency.)
Line 6: Line 6:
  
 
Functions to access the cache are declared in {{GitFile|src/utils_cache.h}}.
 
Functions to access the cache are declared in {{GitFile|src/utils_cache.h}}.
 +
 +
The cache uses an ''AVL-tree'', a balanced binary search tree, to store and retrieve the values. This has proven to be efficient even when handling thousands of entries.
  
 
[[Category:Development]]
 
[[Category:Development]]

Revision as of 16:06, 15 July 2009

There is a global cache into which all values that are handled by collectd are inserted. There are two major uses for this cache:

  • Convert COUNTER, DERIVE, and ABSOLUTE values to a rate, i. e. a GAUGE value.
  • Recognize missing values.

Values are identified by their identifier which can be constructed from the value_list_t data structure.

Functions to access the cache are declared in src/utils_cache.h.

The cache uses an AVL-tree, a balanced binary search tree, to store and retrieve the values. This has proven to be efficient even when handling thousands of entries.