if (m_perf_counters) {
m_perf_counters->inc(l_cephfs_mirror_peer_replayer_sync_bytes, stx.stx_size);
}
+ inc_sync_bytes(dir_root, stx.stx_size);
} else if (S_ISLNK(stx.stx_mode)) {
// free the remote link before relinking
r = ceph_unlinkat(m_remote_mount, fh.r_fd_dir_root, epath.c_str(), 0);
f->dump_float("sync_duration", *sync_stat.last_sync_duration);
f->dump_stream("sync_time_stamp") << sync_stat.last_synced;
}
+ if (sync_stat.last_sync_bytes) {
+ f->dump_unsigned("sync_bytes", *sync_stat.last_sync_bytes);
+ }
f->close_section();
}
f->dump_unsigned("snaps_synced", sync_stat.synced_snap_count);
uint64_t renamed_snap_count = 0;
monotime last_synced = clock::zero();
boost::optional<double> last_sync_duration;
+ boost::optional<uint64_t> last_sync_bytes; //last sync bytes for display in status
+ uint64_t sync_bytes = 0; //sync bytes counter, independently for each directory sync.
};
void _inc_failed_count(const std::string &dir_root) {
const std::string &snap_name) {
std::scoped_lock locker(m_lock);
_set_last_synced_snap(dir_root, snap_id, snap_name);
+ auto &sync_stat = m_snap_sync_stats.at(dir_root);
+ sync_stat.sync_bytes = 0;
}
void set_current_syncing_snap(const std::string &dir_root, uint64_t snap_id,
const std::string &snap_name) {
auto &sync_stat = m_snap_sync_stats.at(dir_root);
sync_stat.last_synced = clock::now();
sync_stat.last_sync_duration = duration;
+ sync_stat.last_sync_bytes = sync_stat.sync_bytes;
++sync_stat.synced_snap_count;
}
-
+ void inc_sync_bytes(const std::string &dir_root, const uint64_t& b) {
+ std::scoped_lock locker(m_lock);
+ auto &sync_stat = m_snap_sync_stats.at(dir_root);
+ sync_stat.sync_bytes += b;
+ }
bool should_backoff(const std::string &dir_root, int *retval) {
if (m_fs_mirror->is_blocklisted()) {
*retval = -EBLOCKLISTED;