Coda Distributed File System
rvm_statistics.h
Go to the documentation of this file.
1/* BLURB lgpl
2
3 Coda File System
4 Release 5
5
6 Copyright (c) 1987-1999 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU Library General Public Licence Version 2, as
11shown in the file LICENSE. The technical and financial contributors to
12Coda are listed in the file CREDITS.
13
14 Additional copyrights
15 none currently
16
17#*/
18
19/*
20*
21* Definitions for RVM Statistics Structures
22*
23*/
24/*LINTLIBRARY*/
25
26/* permit multiple includes */
27#ifndef RVM_STATISTICS_VERSION
28
29#define RVM_STATISTICS_VERSION "RVM Statistics Version 1.1 8 Dec 1992"
30
31#include <stdio.h>
32
33/* histgram definitions */
34
35#define flush_times_len 10 /* length of flush timing vectors */
36/* timing distribution in millisecs, use as array initializer */
37#define flush_times_dist 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000
38
39#define truncation_times_len 5 /* length of truncation timing vectors */
40#define truncation_times_dist /* timing distribution in seconds */ \
41 1, 10, 100, 500
42
43#define range_lengths_len 13 /* length of range length histogram */
44#define range_lengths_dist /* range lengths in bytes */ \
45 0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096
46
47#define range_overlaps_len \
48 13 /* length of overlaps eliminated by range coalesce */
49#define range_overlaps_dist /* range lengths in bytes */ \
50 0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096
51
52#define trans_overlaps_len \
53 13 /* length of overlaps eliminated by transaction coalesce */
54#define trans_overlaps_dist /* range lengths in bytes */ \
55 0, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096
56
57#define range_elims_len 6 /* ranges eliminated from log by range coalesce */
58#define range_elims_dist /* number of ranges */ 0, 5, 10, 50, 100
59
60#define trans_elims_len 6 /* ranges eliminated from log by trans coalesce */
61#define trans_elims_dist /* number of ranges */ 0, 5, 10, 50, 100
62
63#define trans_coalesces_len 6 /* transactions coalesced by trans coalesce */
64#define trans_coalesces_dist /* number of transactions */ 0, 5, 10, 50, 100
65
66/* RVM statistics record */
67typedef struct {
68 rvm_struct_id_t struct_id; /* self-identifier, do not change */
69 rvm_bool_t from_heap; /* true if heap allocated; do not change */
70
71 /* transaction statistics -- current epoch */
72
73 rvm_length_t n_abort; /* number of transactions aborted */
74 rvm_length_t n_flush_commit; /* number of flush mode commits */
75 rvm_length_t n_no_flush_commit; /* number of no_flush mode commits */
76 rvm_length_t n_uncommit; /* number of uncommitted transactions */
77 rvm_length_t n_no_flush; /* number of queued no_flush transactions */
78 rvm_length_t n_truncation_wait; /* total transactions delayed by truncation */
79 rvm_offset_t no_flush_length; /* length of queued no_flush transactions */
80 /* log statistics -- current epoch */
81
82 rvm_length_t n_split; /* number trans split for log wrap */
83 rvm_length_t n_flush; /* number of internal flushes */
84 rvm_length_t n_rvm_flush; /* number of explicit flush calls */
85 rvm_length_t n_special; /* number of special log records */
86 rvm_length_t n_wrap; /* number of log wrap-arounds (0 or 1) */
87 rvm_length_t log_dev_cur; /* current % log device in use */
88 rvm_offset_t log_written; /* current length of writes to log */
89 /* current overlap eliminated by range coalesce */
91 /* current overlap eliminated by trans coalesce */
93 /* current number of ranges eliminated by range coalesce/flush */
95 /* current number of ranges eliminated by trans coalesce/flush */
97 /* number of transactions coalesced in this flush cycle */
99 struct timeval flush_time; /* time spent in flushes */
100 rvm_length_t last_flush_time; /* duration of last flush (msec) */
101 rvm_length_t last_truncation_time; /* duration of last truncation (sec) */
102 rvm_length_t last_tree_build_time; /* duration of tree build (sec) */
103 rvm_length_t last_tree_apply_time; /* duration of tree apply phase (sec) */
104
105 /* histogram vectors */
106
107 rvm_length_t flush_times[flush_times_len]; /* flush timings (msec) */
108 rvm_length_t range_lengths[range_lengths_len]; /* range lengths flushed */
109 /* num ranges eliminated by range coalesce/flush */
111 /* num ranges eliminated by trans coalesce/flush */
113 /* space saved by range coalesce/flush */
115 /* space saved by trans coalesce/flush */
117 /* transaction stats -- cumulative since log init */
118
119 rvm_length_t tot_abort; /* total aborted transactions */
120 rvm_length_t tot_flush_commit; /* total flush commits */
121 rvm_length_t tot_no_flush_commit; /* total no_flush commits */
122
123 /* log stats -- cumulative */
124
125 rvm_length_t tot_split; /* total transactions split for log wrap-around */
126 rvm_length_t tot_flush; /* total internal flush calls */
127 rvm_length_t tot_rvm_flush; /* total explicit rvm_flush calls */
128 rvm_length_t tot_special; /* total special log records */
129 rvm_length_t tot_wrap; /* total log wrap-arounds */
130 rvm_length_t log_dev_max; /* maximum % log device used so far */
131 rvm_offset_t tot_log_written; /* total length of all writes to log */
132 /* total overlap eliminated by range coalesce */
134 /* total overlap eliminated by trans coalesce */
136 /* total number of ranges eliminated by range coalesce */
138 /* total number of ranges eliminated by trans coalesce */
140 /* total number of transactions coalesced */
142
143 /* truncation stats -- cummulative */
144
145 rvm_length_t tot_rvm_truncate; /* total explicit rvm_truncate calls */
146 rvm_length_t tot_async_truncation; /* total asynchronous truncations */
147 /* total forced synchronous truncations */
149 /* total transactions delayed by truncation */
151 rvm_length_t tot_recovery; /* total recovery truncations */
152 struct timeval tot_flush_time; /* total time spent in flush */
153 struct timeval tot_truncation_time; /* cumulative truncation time */
154
155 /* histogram vectors */
156 /* truncation timings (sec) */
157 rvm_length_t tot_tree_build_times[truncation_times_len];
158 rvm_length_t tot_tree_apply_times[truncation_times_len];
159 rvm_length_t tot_truncation_times[truncation_times_len];
160 /* cummulative flush timings (msec) */
162 /* cummulative range lengths */
163 rvm_length_t tot_range_lengths[range_lengths_len];
164 /* total num ranges eliminated by range coalesce/flush */
166 /* total num ranges eliminated by trans coalesce/flush */
168 /* space saved by range coalesce/flush */
169 rvm_length_t tot_range_overlaps[range_overlaps_len];
170 /* space saved by trans coalesce/flush */
171 rvm_length_t tot_trans_overlaps[range_overlaps_len];
172 /* transactions coalesced per flush */
173 rvm_length_t tot_trans_coalesces[trans_coalesces_len];
175
176/* get RVM statistics */
177rvm_return_t rvm_statistics(const char *version, rvm_statistics_t *statistics);
178#define RVM_STATISTICS(statistics) \
179 rvm_statistics(RVM_STATISTICS_VERSION, (statistics))
180
181/* rvm_statistics_t initializer, copier & finalizer */
182
184
185void rvm_init_statistics(rvm_statistics_t *statistics);
187void rvm_free_statistics(rvm_statistics_t *statistics);
188
189/* rvm_statistics_t printer */
191 rvm_statistics_t *statistics, /* pointer to record to be printed */
192 FILE *out_stream /* output stream */
193);
194
195#endif /* _RVM_STATISTICS_VERSION */
int rvm_return_t
Definition: rvm.h:94
rvm_bool_t
Definition: rvm.h:60
unsigned long rvm_length_t
Definition: rvm.h:140
rvm_struct_id_t
Definition: rvm.h:70
rvm_statistics_t * rvm_malloc_statistics(void)
Definition: rvm_utils.c:898
#define trans_coalesces_len
Definition: rvm_statistics.h:63
#define range_overlaps_len
Definition: rvm_statistics.h:47
#define flush_times_len
Definition: rvm_statistics.h:35
#define range_elims_len
Definition: rvm_statistics.h:57
rvm_return_t rvm_statistics(const char *version, rvm_statistics_t *statistics)
Definition: rvm_status.c:250
void rvm_free_statistics(rvm_statistics_t *statistics)
Definition: rvm_utils.c:911
rvm_return_t rvm_print_statistics(rvm_statistics_t *statistics, FILE *out_stream)
Definition: rvm_printers.c:815
#define range_lengths_len
Definition: rvm_statistics.h:43
void rvm_init_statistics(rvm_statistics_t *statistics)
Definition: rvm_utils.c:918
#define truncation_times_len
Definition: rvm_statistics.h:39
#define trans_elims_len
Definition: rvm_statistics.h:60
rvm_statistics_t * rvm_copy_statistics(rvm_statistics_t *statistics)
Definition: rvm_utils.c:926
Definition: rvm.h:145
Definition: rvm_statistics.h:67
rvm_length_t tot_flush_commit
Definition: rvm_statistics.h:120
rvm_length_t log_dev_cur
Definition: rvm_statistics.h:87
rvm_length_t n_trans_coalesced
Definition: rvm_statistics.h:98
rvm_length_t tot_wrap
Definition: rvm_statistics.h:129
rvm_length_t n_wrap
Definition: rvm_statistics.h:86
rvm_length_t tot_sync_truncation
Definition: rvm_statistics.h:148
rvm_length_t tot_recovery
Definition: rvm_statistics.h:151
rvm_length_t tot_range_elim
Definition: rvm_statistics.h:137
rvm_length_t n_truncation_wait
Definition: rvm_statistics.h:78
rvm_length_t tot_rvm_truncate
Definition: rvm_statistics.h:145
rvm_length_t tot_no_flush_commit
Definition: rvm_statistics.h:121
rvm_length_t n_flush_commit
Definition: rvm_statistics.h:74
rvm_length_t n_split
Definition: rvm_statistics.h:82
rvm_offset_t range_overlap
Definition: rvm_statistics.h:90
rvm_length_t log_dev_max
Definition: rvm_statistics.h:130
rvm_length_t tot_split
Definition: rvm_statistics.h:125
rvm_length_t tot_truncation_wait
Definition: rvm_statistics.h:150
rvm_length_t last_flush_time
Definition: rvm_statistics.h:100
rvm_length_t n_no_flush_commit
Definition: rvm_statistics.h:75
rvm_length_t n_uncommit
Definition: rvm_statistics.h:76
rvm_length_t n_special
Definition: rvm_statistics.h:85
rvm_length_t tot_special
Definition: rvm_statistics.h:128
rvm_offset_t tot_log_written
Definition: rvm_statistics.h:131
rvm_offset_t tot_trans_overlap
Definition: rvm_statistics.h:135
rvm_length_t n_trans_elim
Definition: rvm_statistics.h:96
rvm_length_t n_flush
Definition: rvm_statistics.h:83
rvm_offset_t tot_range_overlap
Definition: rvm_statistics.h:133
rvm_length_t last_tree_apply_time
Definition: rvm_statistics.h:103
rvm_length_t tot_rvm_flush
Definition: rvm_statistics.h:127
rvm_length_t last_truncation_time
Definition: rvm_statistics.h:101
rvm_length_t n_no_flush
Definition: rvm_statistics.h:77
rvm_bool_t from_heap
Definition: rvm_statistics.h:69
rvm_struct_id_t struct_id
Definition: rvm_statistics.h:68
rvm_length_t n_rvm_flush
Definition: rvm_statistics.h:84
rvm_length_t tot_trans_coalesced
Definition: rvm_statistics.h:141
rvm_length_t n_abort
Definition: rvm_statistics.h:73
rvm_offset_t log_written
Definition: rvm_statistics.h:88
rvm_offset_t trans_overlap
Definition: rvm_statistics.h:92
rvm_length_t tot_trans_elim
Definition: rvm_statistics.h:139
rvm_length_t tot_abort
Definition: rvm_statistics.h:119
rvm_length_t n_range_elim
Definition: rvm_statistics.h:94
rvm_length_t tot_async_truncation
Definition: rvm_statistics.h:146
rvm_offset_t no_flush_length
Definition: rvm_statistics.h:79
rvm_length_t last_tree_build_time
Definition: rvm_statistics.h:102
rvm_length_t tot_flush
Definition: rvm_statistics.h:126