diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:51:24 +0000 |
commit | f7548d6d28c313cf80e6f3ef89aed16a19815df1 (patch) | |
tree | a3f6f2a3f247293bee59ecd28e8cd8ceb6ca064a /src/stats/event-exporter.h | |
parent | Initial commit. (diff) | |
download | dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.tar.xz dovecot-f7548d6d28c313cf80e6f3ef89aed16a19815df1.zip |
Adding upstream version 1:2.3.19.1+dfsg1.upstream/1%2.3.19.1+dfsg1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/stats/event-exporter.h')
-rw-r--r-- | src/stats/event-exporter.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/stats/event-exporter.h b/src/stats/event-exporter.h new file mode 100644 index 0000000..64bb708 --- /dev/null +++ b/src/stats/event-exporter.h @@ -0,0 +1,31 @@ +#ifndef EVENT_EXPORTER_H +#define EVENT_EXPORTER_H + +#include "stats-metrics.h" + +/* fmt functions */ +void event_export_fmt_json(const struct metric *metric, struct event *event, buffer_t *dest); +void event_export_fmt_none(const struct metric *metric, struct event *event, buffer_t *dest); +void event_export_fmt_tabescaped_text(const struct metric *metric, struct event *event, buffer_t *dest); + +/* transport functions */ +void event_export_transport_drop(const struct exporter *exporter, const buffer_t *buf); +void event_export_transport_http_post(const struct exporter *exporter, const buffer_t *buf); +void event_export_transport_http_post_deinit(void); +void event_export_transport_log(const struct exporter *exporter, const buffer_t *buf); + +/* append a microsecond resolution RFC3339 UTC timestamp */ +void event_export_helper_fmt_rfc3339_time(string_t *dest, const struct timeval *time); +/* append a microsecond resolution unix timestamp in seconds (i.e., %u.%06u) */ +void event_export_helper_fmt_unix_time(string_t *dest, const struct timeval *time); +/* append category names using 'append' function pointer, separated by 'separator' arg + + The result has no duplicates regardless of if the array has any or if any + of the categories' ancestors are implictly or explicitly duplicated. */ +void event_export_helper_fmt_categories(string_t *dest, + struct event_category *const *cats, + unsigned int count, + void (*append)(string_t *, const char *), + const char *separator); + +#endif |