00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef COH_SIMPLE_CACHE_STATISTICS_HPP
00017 #define COH_SIMPLE_CACHE_STATISTICS_HPP
00018
00019 #include "coherence/lang.ns"
00020
00021 #include "coherence/net/cache/CacheStatistics.hpp"
00022
00023 #include <ostream>
00024
00025 COH_OPEN_NAMESPACE3(coherence,net,cache)
00026
00027
00028
00029
00030
00031
00032
00033
00034 class COH_EXPORT SimpleCacheStatistics
00035 : public class_spec<SimpleCacheStatistics,
00036 extends<Object>,
00037 implements<CacheStatistics> >
00038 {
00039 friend class factory<SimpleCacheStatistics>;
00040
00041
00042
00043 protected:
00044
00045
00046
00047 SimpleCacheStatistics();
00048
00049
00050
00051
00052 public:
00053
00054
00055
00056 virtual int64_t getTotalGets() const;
00057
00058
00059
00060
00061 virtual int64_t getTotalGetsMillis() const;
00062
00063
00064
00065
00066 virtual float64_t getAverageGetMillis() const;
00067
00068
00069
00070
00071 virtual int64_t getTotalPuts() const;
00072
00073
00074
00075
00076 virtual int64_t getTotalPutsMillis() const;
00077
00078
00079
00080
00081 virtual float64_t getAveragePutMillis() const;
00082
00083
00084
00085
00086 virtual int64_t getCacheHits() const;
00087
00088
00089
00090
00091 virtual int64_t getCacheHitsMillis() const;
00092
00093
00094
00095
00096 virtual float64_t getAverageHitMillis() const;
00097
00098
00099
00100
00101 virtual int64_t getCacheMisses() const;
00102
00103
00104
00105
00106 virtual int64_t getCacheMissesMillis() const;
00107
00108
00109
00110
00111 virtual float64_t getAverageMissMillis() const;
00112
00113
00114
00115
00116 virtual float64_t getHitProbability() const;
00117
00118
00119
00120
00121 virtual int64_t getCachePrunes() const;
00122
00123
00124
00125
00126 virtual int64_t getCachePrunesMillis() const;
00127
00128
00129
00130
00131 virtual float64_t getAveragePruneMillis() const;
00132
00133
00134
00135
00136 virtual void resetHitStatistics();
00137
00138
00139
00140
00141 public:
00142
00143
00144
00145 virtual void registerHit();
00146
00147
00148
00149
00150
00151
00152 virtual void registerHit(int64_t lStartMillis);
00153
00154
00155
00156
00157
00158
00159
00160 virtual void registerHits(int32_t cHits, int64_t lStartMillis);
00161
00162
00163
00164
00165 virtual void registerMiss();
00166
00167
00168
00169
00170
00171
00172 virtual void registerMiss(int64_t lStartMillis);
00173
00174
00175
00176
00177
00178
00179
00180 virtual void registerMisses(int32_t cMisses, int64_t lStartMillis);
00181
00182
00183
00184
00185
00186
00187 virtual void registerPut(int64_t lStartMillis);
00188
00189
00190
00191
00192
00193
00194
00195 virtual void registerPuts(int32_t cPuts, int64_t lStartMillis);
00196
00197
00198
00199
00200
00201
00202 virtual void registerCachePrune(int64_t lStartMillis);
00203
00204
00205
00206
00207 public:
00208
00209
00210
00211 void toStream(std::ostream& out) const;
00212
00213
00214
00215
00216 protected:
00217
00218
00219
00220
00221
00222 int64_t m_cCacheHits;
00223
00224
00225
00226
00227
00228
00229 int64_t m_cCacheMisses;
00230
00231
00232
00233
00234
00235 int64_t m_cHitsMillis;
00236
00237
00238
00239
00240
00241 int64_t m_cMissesMillis;
00242
00243
00244
00245
00246 int64_t m_cCachePuts;
00247
00248
00249
00250
00251
00252 int64_t m_cPutsMillis;
00253
00254
00255
00256
00257
00258 int64_t m_cCachePrunes;
00259
00260
00261
00262
00263
00264 int64_t m_cCachePrunesMillis;
00265
00266 };
00267
00268 COH_CLOSE_NAMESPACE3
00269
00270 #endif // COH_SIMPLE_CACHE_STATISTICS_HPP