mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-13 23:19:03 +02:00
MINOR: stats: prepare stats-file support for values other than FN_COUNTER
Currently, only FN_COUNTER are dumped and preloaded via a stats-file. Thus in several places we relied on the assumption that only FN_COUNTER are valid in stats-file context. New stats types will soon be implemented as they are also eligilible to statistics reloading on process startup. Thus, prepare stats-file functions to remove any FN_COUNTER restriction. As one of this change, generate_stat_tree() now uses stcol_is_generic() for stats name tree indexing before stats-file parsing. Also related to stats-file parsing, individual counter preloading step as been extracted from line parsing in a dedicated new function load_ctr(). This will allow to extend it to support multiple mechanism of counter preloading depending on the stats type.
This commit is contained in:
@@ -74,6 +74,12 @@ int stats_emit_field_tags(struct buffer *out, const struct field *f,
|
||||
char delim);
|
||||
|
||||
|
||||
/* Returns true if <col> is fully defined, false if only used as name-desc. */
|
||||
static inline int stcol_is_generic(const struct stat_col *col)
|
||||
{
|
||||
return !!(col->cap);
|
||||
}
|
||||
|
||||
static inline enum field_format stcol_format(const struct stat_col *col)
|
||||
{
|
||||
return col->type & FF_MASK;
|
||||
|
||||
Reference in New Issue
Block a user