MCPcopy Create free account
hub / github.com/apache/trafficserver / MetricStorage

Class MetricStorage

include/cripts/Metrics.hpp:183–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181} // namespace Metrics
182
183class MetricStorage
184{
185 using self_type = MetricStorage;
186
187public:
188 MetricStorage() = delete;
189 MetricStorage(const self_type &) = delete;
190 void operator=(const self_type &) = delete;
191
192 MetricStorage(size_t size) : _metrics(size) {}
193
194 ~MetricStorage()
195 {
196 for (auto &metric : _metrics) {
197 delete metric;
198 }
199 }
200
201 detail::BaseMetrics *&
202 operator[](std::size_t index)
203 {
204 if (_metrics.size() <= index) {
205 _metrics.resize(index + 8); // 8 at a time.
206 }
207
208 return _metrics[index];
209 }
210
211private:
212 std::vector<detail::BaseMetrics *> _metrics;
213
214}; // class MetricStorage
215
216} // namespace cripts

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected