[srvx-commits] CVS: services/src saxdb.c,1.22,1.23
Brought to you by:
entrope
|
From: Entrope <en...@us...> - 2002-12-14 02:07:24
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv9909/src
Modified Files:
saxdb.c
Log Message:
track last write duration for each database
Index: saxdb.c
===================================================================
RCS file: /cvsroot/srvx/services/src/saxdb.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** saxdb.c 22 Nov 2002 21:55:32 -0000 1.22
--- saxdb.c 14 Dec 2002 02:07:22 -0000 1.23
***************
*** 35,38 ****
--- 35,39 ----
unsigned int write_interval;
time_t last_write;
+ unsigned int last_write_duration;
struct saxdb *prev;
};
***************
*** 126,129 ****
--- 127,131 ----
char tmp_fname[MAXLEN];
int res, res2;
+ time_t start, finish;
assert(db->filename);
***************
*** 137,140 ****
--- 139,143 ----
return 1;
}
+ start = time(NULL);
if ((res = setjmp(ctx.jbuf)) || (res2 = db->writer(&ctx))) {
if (res) {
***************
*** 148,151 ****
--- 151,155 ----
return 2;
}
+ finish = time(NULL);
assert(ctx.complex.used == 0);
int_list_clean(&ctx.complex);
***************
*** 155,158 ****
--- 159,163 ----
}
db->last_write = now;
+ db->last_write_duration = finish - start;
log(MAIN_LOG, LOG_INFO, "Wrote %s database to disk.\n", db->name);
return 0;
|