stats-plugin.h revision 6afdf0b6fce26c5492d5e56f6f16fb8a4d869566
#ifndef STATS_PLUGIN_H
#define STATS_PLUGIN_H
#include "module-context.h"
#include "mail-user.h"
#include "mail-storage-private.h"
#define STATS_USER_CONTEXT(obj) \
#define STATS_USER_CONTEXT_REQUIRE(obj) \
struct stats_user {
struct ioloop_context *ioloop_ctx;
struct stats_connection *stats_conn;
const char *stats_session_id;
bool stats_connected;
unsigned int refresh_secs;
bool track_commands;
unsigned int refresh_check_counter;
/* current session statistics */
struct stats *session_stats;
/* cumulative trans_stats for all already freed transactions. */
/* stats before calling IO callback. after IO callback this value is
compared to current stats to see the difference */
struct stats *pre_io_stats;
struct timeout *to_stats_timeout;
/* stats that were last sent to stats server */
struct stats *last_sent_session_stats;
bool session_sent_duplicate;
/* list of all currently existing transactions for this user */
struct stats_transaction_context *transactions;
};
struct stats_transaction_context {
struct mailbox_transaction_context *trans;
struct mailbox_transaction_stats prev_stats;
};
void old_stats_plugin_deinit(void);
#endif