syslog-ng source
dyn-metrics-template.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 Attila Szakacs
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * As an additional exemption you are allowed to compile & link against the
19  * OpenSSL libraries as published by the OpenSSL project. See the file
20  * COPYING for details.
21  *
22  */
23 
24 #ifndef DYN_METRICS_TEMPLATE_H_INCLUDED
25 #define DYN_METRICS_TEMPLATE_H_INCLUDED
26 
27 #include "template/templates.h"
29 #include "stats/stats-cluster.h"
30 
31 /*
32  * DynMetricsTemplate utilizes dyn-metrics-cache to achieve better performance
33  * and to provide proper lifetime for dynamic counters.
34  */
35 
36 typedef struct _DynMetricsTemplate
37 {
38  gchar *key;
40  ValuePairs *vp;
41  gint level;
43 
45 void dyn_metrics_template_add_label_template(DynMetricsTemplate *s, const gchar *label, LogTemplate *value_template);
50  LogTemplateOptions *template_options,
51  LogMessage *msg);
53 
57 
58 #endif
DynMetricsTemplate * dyn_metrics_template_clone(DynMetricsTemplate *self, GlobalConfig *cfg)
Definition: dyn-metrics-template.c:156
gboolean dyn_metrics_template_is_enabled(DynMetricsTemplate *self)
Definition: dyn-metrics-template.c:83
gboolean dyn_metrics_template_init(DynMetricsTemplate *self)
Definition: dyn-metrics-template.c:131
void dyn_metrics_template_add_label_template(DynMetricsTemplate *s, const gchar *label, LogTemplate *value_template)
Definition: dyn-metrics-template.c:38
DynMetricsTemplate * dyn_metrics_template_new(GlobalConfig *cfg)
Definition: dyn-metrics-template.c:138
void dyn_metrics_template_set_key(DynMetricsTemplate *s, const gchar *key)
Definition: dyn-metrics-template.c:50
ValuePairs * dyn_metrics_template_get_value_pairs(DynMetricsTemplate *s)
Definition: dyn-metrics-template.c:44
void dyn_metrics_template_set_level(DynMetricsTemplate *s, gint level)
Definition: dyn-metrics-template.c:32
StatsCounterItem * dyn_metrics_template_get_stats_counter(DynMetricsTemplate *self, LogTemplateOptions *template_options, LogMessage *msg)
Definition: dyn-metrics-template.c:112
void dyn_metrics_template_free(DynMetricsTemplate *self)
Definition: dyn-metrics-template.c:147
Definition: dyn-metrics-template.h:37
gchar * key
Definition: dyn-metrics-template.h:38
ValuePairs * vp
Definition: dyn-metrics-template.h:40
gint level
Definition: dyn-metrics-template.h:41
GList * label_templates
Definition: dyn-metrics-template.h:39
Definition: stats-counter.h:67
GlobalConfig * cfg
Definition: test_batched_ack_tracker.c:34
LogMessage * msg
Definition: test_rename.c:35
LogTemplateOptions template_options
Definition: test_value_pairs.c:65
struct tm key
Definition: cache.c:63