summaryrefslogtreecommitdiffstats
path: root/src/old-stats/client-reset.c
blob: 965bb222e754b42603052566393c694d4eec3623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Copyright (c) 2016-2018 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "ostream.h"
#include "strescape.h"
#include "mail-stats.h"
#include "client.h"
#include "client-reset.h"

int client_stats_reset(struct client *client, const char *const *args ATTR_UNUSED,
			const char **error_r ATTR_UNUSED)
{
	struct mail_global *g = &mail_global_stats;
	stats_reset(g->stats);
	g->num_logins = 0;
	g->num_cmds = 0;
	g->reset_timestamp = ioloop_time;
	i_zero(&g->last_update);
	o_stream_nsend_str(client->output, "OK\n");
	return 0;
}