1 //
2 //   stt.h
3 //
4 //   Oliver Fromme  <olli@fromme.com>
5 //   @(#)$Id: stt.h,v 1.2 1998/12/11 02:11:03 olli Exp $
6 //
7 
8 #ifndef HAVE_STT_H
9 #define HAVE_STT_H
10 
11 static const char cvsid_stt_h[]
12     = "@(#)$Id: stt.h,v 1.2 1998/12/11 02:11:03 olli Exp $";
13 
14 #include <sys/types.h>
15 #include <time.h>
16 
17 #include "bas.h"
18 
19 typedef struct {
20 	time_t start, end;		// start and end time of the job
21 	unsigned errors;		// number of errors occured
22 	unsigned totalpairs;		// total number of remote/local trees
23 	unsigned totalsites;		// total number of mirrored sites
24 	unsigned totalchanges;		// total number of changes
25 
26 	ulonglong totalbytes;		// total bytes in the mirror
27 	unsigned totalfiles;		// total plain files in the mirror
28 	unsigned totaldirs;		// total directories in the mirror
29 	unsigned totallinks;		// total symlinks in the mirror
30 
31 	ulonglong gonebytes;		// bytes removed
32 	unsigned gonefiles;		// files removed
33 	unsigned gonedirs;		// directories removed
34 	unsigned gonelinks;		// symlinks removed
35 
36 	ulonglong newbytes;		// new bytes retrieved
37 	unsigned newfiles;		// new files retrieved
38 	unsigned newdirs;		// new directories created
39 	unsigned newlinks;		// new symlinks created
40 
41 	ulonglong updbytes;		// bytes updated
42 	unsigned updfiles;		// files updated
43 	unsigned upddirs;		// directories updated
44 	unsigned updlinks;		// symlinks updated
45 
46 	unsigned permfiles;		// files permission changed
47 	unsigned permdirs;		// directories permission changed
48 
49 	longlong growbytes;		// growth in bytes
50 	ulonglong xferbytes;		// bytes actually transferred
51 	double xfertime;		// data transfer time (seconds)
52 } omistats;
53 
54 //
55 //   Global statistics, and pointer to the current statistics.
56 //
57 
58 extern omistats globalstats;
59 extern omistats *cs;
60 
61 void stats_init (omistats *os);
62 void stats_done (omistats *os);
63 void stats_summary (omistats *sum, omistats *x);
64 void stats_report (omistats *os, char *site, char *remote, char *local);
65 char * ulkformat (unsigned long ulk);
66 char * lkformat (long lk);
67 char * xferrate_report (double duration, ulonglong bytes);
68 
69 #endif // HAVE_STT_H
70 
71 //--
72