summaryrefslogtreecommitdiffstats
path: root/src/stats/event-exporter.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:36:47 +0000
commit0441d265f2bb9da249c7abf333f0f771fadb4ab5 (patch)
tree3f3789daa2f6db22da6e55e92bee0062a7d613fe /src/stats/event-exporter.h
parentInitial commit. (diff)
downloaddovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.tar.xz
dovecot-0441d265f2bb9da249c7abf333f0f771fadb4ab5.zip
Adding upstream version 1:2.3.21+dfsg1.upstream/1%2.3.21+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/stats/event-exporter.h31
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