Register Stats, this handles both the global cache metrics, as well as the per volume metrics.
| 1099 | |
| 1100 | // Register Stats, this handles both the global cache metrics, as well as the per volume metrics. |
| 1101 | void |
| 1102 | register_cache_stats(CacheStatsBlock *rsb, const std::string &prefix) |
| 1103 | { |
| 1104 | // These are special, in that we have 7 x 3 metrics here in a structure based on cache operation done |
| 1105 | rsb->status[static_cast<int>(CacheOpType::Lookup)].active = ts::Metrics::Gauge::createPtr(prefix + ".lookup.active"); |
| 1106 | rsb->status[static_cast<int>(CacheOpType::Lookup)].success = ts::Metrics::Counter::createPtr(prefix + ".lookup.success"); |
| 1107 | rsb->status[static_cast<int>(CacheOpType::Lookup)].failure = ts::Metrics::Counter::createPtr(prefix + ".lookup.failure"); |
| 1108 | rsb->status[static_cast<int>(CacheOpType::Read)].active = ts::Metrics::Gauge::createPtr(prefix + ".read.active"); |
| 1109 | rsb->status[static_cast<int>(CacheOpType::Read)].success = ts::Metrics::Counter::createPtr(prefix + ".read.success"); |
| 1110 | rsb->status[static_cast<int>(CacheOpType::Read)].failure = ts::Metrics::Counter::createPtr(prefix + ".read.failure"); |
| 1111 | rsb->status[static_cast<int>(CacheOpType::Write)].active = ts::Metrics::Gauge::createPtr(prefix + ".write.active"); |
| 1112 | rsb->status[static_cast<int>(CacheOpType::Write)].success = ts::Metrics::Counter::createPtr(prefix + ".write.success"); |
| 1113 | rsb->status[static_cast<int>(CacheOpType::Write)].failure = ts::Metrics::Counter::createPtr(prefix + ".write.failure"); |
| 1114 | rsb->status[static_cast<int>(CacheOpType::Update)].active = ts::Metrics::Gauge::createPtr(prefix + ".update.active"); |
| 1115 | rsb->status[static_cast<int>(CacheOpType::Update)].success = ts::Metrics::Counter::createPtr(prefix + ".update.success"); |
| 1116 | rsb->status[static_cast<int>(CacheOpType::Update)].failure = ts::Metrics::Counter::createPtr(prefix + ".update.failure"); |
| 1117 | rsb->status[static_cast<int>(CacheOpType::Remove)].active = ts::Metrics::Gauge::createPtr(prefix + ".remove.active"); |
| 1118 | rsb->status[static_cast<int>(CacheOpType::Remove)].success = ts::Metrics::Counter::createPtr(prefix + ".remove.success"); |
| 1119 | rsb->status[static_cast<int>(CacheOpType::Remove)].failure = ts::Metrics::Counter::createPtr(prefix + ".remove.failure"); |
| 1120 | rsb->status[static_cast<int>(CacheOpType::Evacuate)].active = ts::Metrics::Gauge::createPtr(prefix + ".evacuate.active"); |
| 1121 | rsb->status[static_cast<int>(CacheOpType::Evacuate)].success = ts::Metrics::Counter::createPtr(prefix + ".evacuate.success"); |
| 1122 | rsb->status[static_cast<int>(CacheOpType::Evacuate)].failure = ts::Metrics::Counter::createPtr(prefix + ".evacuate.failure"); |
| 1123 | rsb->status[static_cast<int>(CacheOpType::Scan)].active = ts::Metrics::Gauge::createPtr(prefix + ".scan.active"); |
| 1124 | rsb->status[static_cast<int>(CacheOpType::Scan)].success = ts::Metrics::Counter::createPtr(prefix + ".scan.success"); |
| 1125 | rsb->status[static_cast<int>(CacheOpType::Scan)].failure = ts::Metrics::Counter::createPtr(prefix + ".scan.failure"); |
| 1126 | |
| 1127 | // These are in an array of 1, 2 and 3+ fragment documents |
| 1128 | rsb->fragment_document_count[0] = ts::Metrics::Counter::createPtr(prefix + ".frags_per_doc.1"); |
| 1129 | rsb->fragment_document_count[1] = ts::Metrics::Counter::createPtr(prefix + ".frags_per_doc.2"); |
| 1130 | rsb->fragment_document_count[2] = ts::Metrics::Counter::createPtr(prefix + ".frags_per_doc.3+"); |
| 1131 | |
| 1132 | // And then everything else |
| 1133 | rsb->bytes_used = ts::Metrics::Gauge::createPtr(prefix + ".bytes_used"); |
| 1134 | rsb->bytes_total = ts::Metrics::Gauge::createPtr(prefix + ".bytes_total"); |
| 1135 | rsb->stripes = ts::Metrics::Gauge::createPtr(prefix + ".stripes"); |
| 1136 | rsb->ram_cache_bytes_total = ts::Metrics::Gauge::createPtr(prefix + ".ram_cache.total_bytes"); |
| 1137 | rsb->ram_cache_bytes = ts::Metrics::Gauge::createPtr(prefix + ".ram_cache.bytes_used"); |
| 1138 | rsb->ram_cache_hits = ts::Metrics::Counter::createPtr(prefix + ".ram_cache.hits"); |
| 1139 | rsb->ram_cache_misses = ts::Metrics::Counter::createPtr(prefix + ".ram_cache.misses"); |
| 1140 | rsb->pread_count = ts::Metrics::Counter::createPtr(prefix + ".pread_count"); |
| 1141 | rsb->percent_full = ts::Metrics::Gauge::createPtr(prefix + ".percent_full"); |
| 1142 | rsb->read_seek_fail = ts::Metrics::Counter::createPtr(prefix + ".read.seek.failure"); |
| 1143 | rsb->read_invalid = ts::Metrics::Counter::createPtr(prefix + ".read.invalid"); |
| 1144 | rsb->write_backlog_failure = ts::Metrics::Counter::createPtr(prefix + ".write.backlog.failure"); |
| 1145 | rsb->direntries_total = ts::Metrics::Gauge::createPtr(prefix + ".direntries.total"); |
| 1146 | rsb->direntries_used = ts::Metrics::Gauge::createPtr(prefix + ".direntries.used"); |
| 1147 | rsb->directory_collision = ts::Metrics::Counter::createPtr(prefix + ".directory_collision"); |
| 1148 | rsb->read_busy_success = ts::Metrics::Counter::createPtr(prefix + ".read_busy.success"); |
| 1149 | rsb->read_busy_failure = ts::Metrics::Counter::createPtr(prefix + ".read_busy.failure"); |
| 1150 | rsb->write_bytes = ts::Metrics::Counter::createPtr(prefix + ".write_bytes_stat"); |
| 1151 | rsb->hdr_vector_marshal = ts::Metrics::Counter::createPtr(prefix + ".vector_marshals"); |
| 1152 | rsb->hdr_marshal = ts::Metrics::Counter::createPtr(prefix + ".hdr_marshals"); |
| 1153 | rsb->hdr_marshal_bytes = ts::Metrics::Counter::createPtr(prefix + ".hdr_marshal_bytes"); |
| 1154 | rsb->gc_bytes_evacuated = ts::Metrics::Counter::createPtr(prefix + ".gc_bytes_evacuated"); |
| 1155 | rsb->gc_frags_evacuated = ts::Metrics::Counter::createPtr(prefix + ".gc_frags_evacuated"); |
| 1156 | rsb->directory_wrap = ts::Metrics::Counter::createPtr(prefix + ".wrap_count"); |
| 1157 | rsb->directory_sync_count = ts::Metrics::Counter::createPtr(prefix + ".sync.count"); |
| 1158 | rsb->directory_sync_bytes = ts::Metrics::Counter::createPtr(prefix + ".sync.bytes"); |
no outgoing calls
no test coverage detected