dovecot-2.2: stats: Track clock time as well as user/sys CPU time.
dovecot at dovecot.org
dovecot at dovecot.org
Wed Jan 15 22:50:54 EET 2014
details: http://hg.dovecot.org/dovecot-2.2/rev/43c02090c6cf
changeset: 17109:43c02090c6cf
user: Timo Sirainen <tss at iki.fi>
date: Wed Jan 15 15:50:38 2014 -0500
description:
stats: Track clock time as well as user/sys CPU time.
diffstat:
src/plugins/stats/stats-plugin.c | 5 +++++
src/plugins/stats/stats-plugin.h | 2 ++
src/stats/mail-stats.c | 1 +
src/stats/mail-stats.h | 2 +-
4 files changed, 9 insertions(+), 1 deletions(-)
diffs (64 lines):
diff -r 3f352534af56 -r 43c02090c6cf src/plugins/stats/stats-plugin.c
--- a/src/plugins/stats/stats-plugin.c Wed Jan 15 22:11:22 2014 +0200
+++ b/src/plugins/stats/stats-plugin.c Wed Jan 15 15:50:38 2014 -0500
@@ -196,6 +196,7 @@
stats_r->invol_cs = usage.ru_nivcsw;
stats_r->disk_input = (unsigned long long)usage.ru_inblock * 512ULL;
stats_r->disk_output = (unsigned long long)usage.ru_oublock * 512ULL;
+ (void)gettimeofday(&stats_r->clock_time, NULL);
process_read_io_stats(stats_r);
user_trans_stats_get(suser, &stats_r->trans_stats);
}
@@ -251,6 +252,8 @@
&old_stats->user_cpu);
timeval_add_diff(&dest->sys_cpu, &new_stats->sys_cpu,
&old_stats->sys_cpu);
+ timeval_add_diff(&dest->clock_time, &new_stats->clock_time,
+ &old_stats->clock_time);
trans_stats_dec(&dest->trans_stats, &old_stats->trans_stats);
trans_stats_add(&dest->trans_stats, &new_stats->trans_stats);
}
@@ -263,6 +266,8 @@
(long)stats->user_cpu.tv_usec);
str_printfa(str, "\tscpu=%ld.%ld", (long)stats->sys_cpu.tv_sec,
(long)stats->sys_cpu.tv_usec);
+ str_printfa(str, "\ttime=%ld.%ld", (long)stats->clock_time.tv_sec,
+ (long)stats->clock_time.tv_usec);
str_printfa(str, "\tminflt=%u", stats->min_faults);
str_printfa(str, "\tmajflt=%u", stats->maj_faults);
str_printfa(str, "\tvolcs=%u", stats->vol_cs);
diff -r 3f352534af56 -r 43c02090c6cf src/plugins/stats/stats-plugin.h
--- a/src/plugins/stats/stats-plugin.h Wed Jan 15 22:11:22 2014 +0200
+++ b/src/plugins/stats/stats-plugin.h Wed Jan 15 15:50:38 2014 -0500
@@ -14,6 +14,8 @@
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 */
diff -r 3f352534af56 -r 43c02090c6cf src/stats/mail-stats.c
--- a/src/stats/mail-stats.c Wed Jan 15 22:11:22 2014 +0200
+++ b/src/stats/mail-stats.c Wed Jan 15 15:50:38 2014 -0500
@@ -19,6 +19,7 @@
#define EN(parsename, name) E(parsename, name, TYPE_NUM)
E("ucpu", user_cpu, TYPE_TIMEVAL),
E("scpu", sys_cpu, TYPE_TIMEVAL),
+ E("time", clock_time, TYPE_TIMEVAL),
EN("minflt", min_faults),
EN("majflt", maj_faults),
EN("volcs", vol_cs),
diff -r 3f352534af56 -r 43c02090c6cf src/stats/mail-stats.h
--- a/src/stats/mail-stats.h Wed Jan 15 22:11:22 2014 +0200
+++ b/src/stats/mail-stats.h Wed Jan 15 15:50:38 2014 -0500
@@ -5,7 +5,7 @@
#include "guid.h"
struct mail_stats {
- struct timeval user_cpu, sys_cpu;
+ struct timeval user_cpu, sys_cpu, clock_time;
uint32_t min_faults, maj_faults;
uint32_t vol_cs, invol_cs;
uint64_t disk_input, disk_output;
More information about the dovecot-cvs
mailing list