| 18977 | SubvolumeMetricTracker::SubvolumeMetricTracker(CephContext *ct, client_t id) : cct(ct), whoami(id) {} |
| 18978 | |
| 18979 | void SubvolumeMetricTracker::dump(Formatter *f) { |
| 18980 | auto current_metrics = aggregate(false); |
| 18981 | f->open_array_section("current_metrics"); |
| 18982 | for (auto &met : current_metrics) { |
| 18983 | f->dump_object("", met); |
| 18984 | } |
| 18985 | f->close_section(); |
| 18986 | |
| 18987 | std::vector<AggregatedIOMetrics> temp; |
| 18988 | { |
| 18989 | std::shared_lock l(metrics_lock); |
| 18990 | temp = last_subvolume_metrics; |
| 18991 | } |
| 18992 | f->open_array_section("last_metrics"); |
| 18993 | for (auto &val : temp) { |
| 18994 | f->dump_object("", val); |
| 18995 | } |
| 18996 | f->close_section(); |
| 18997 | } |
| 18998 | |
| 18999 | void SubvolumeMetricTracker::add_inode(inodeno_t inode, inodeno_t subvol) { |
| 19000 | ldout(cct, 20) << __func__ << " subv_metric " << inode << "-" << subvol << dendl; |
no test coverage detected