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/plugins/old-stats/mail-stats.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 '')
-rw-r--r-- | src/plugins/old-stats/mail-stats.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/plugins/old-stats/mail-stats.h b/src/plugins/old-stats/mail-stats.h new file mode 100644 index 0000000..7254b69 --- /dev/null +++ b/src/plugins/old-stats/mail-stats.h @@ -0,0 +1,41 @@ +#ifndef MAIL_STATS_H +#define MAIL_STATS_H + +#include <sys/time.h> +#include "mail-storage-private.h" + +struct stats_user; + +struct mail_stats { + /* user/system CPU time used */ + struct timeval user_cpu, sys_cpu; + /* clock time used (not counting the time in ioloop wait) */ + struct timeval clock_time; + /* minor / major page faults */ + uint32_t min_faults, maj_faults; + /* voluntary / involuntary context switches */ + uint32_t vol_cs, invol_cs; + /* disk input/output bytes */ + uint64_t disk_input, disk_output; + /* read()/write() syscall count and number of bytes */ + uint32_t read_count, write_count; + uint64_t read_bytes, write_bytes; + + /* based on struct mailbox_transaction_stats: */ + uint32_t trans_lookup_path; + uint32_t trans_lookup_attr; + uint32_t trans_files_read_count; + uint64_t trans_files_read_bytes; + uint64_t trans_cache_hit_count; +}; + +extern const struct stats_vfuncs mail_stats_vfuncs; + +void mail_stats_fill(struct stats_user *suser, struct mail_stats *mail_stats); +void mail_stats_add_transaction(struct mail_stats *stats, + const struct mailbox_transaction_stats *trans_stats); + +void mail_stats_global_preinit(void); +void mail_stats_fill_global_deinit(void); + +#endif |