20 m_depth(m_parent->m_depth + 1)
31 m_depth(m_parent->m_depth + 1)
40 std::pair<DsMap_i, bool> ir =
m_subdirs.insert(std::make_pair(dir,
DirState(
this, dir)));
41 return &ir.first->second;
61 if (last_existing_dir)
62 *last_existing_dir = ds;
64 else if (create_subdirs)
70 return ds->
find_path_tok(pt, pos + 1, create_subdirs, last_existing_dir);
82 bool create_subdirs,
DirState **last_existing_dir)
86 if (last_existing_dir)
87 *last_existing_dir =
this;
89 return find_path_tok(pt, 0, create_subdirs, last_existing_dir);
120 for (
auto & [name, daughter] :
m_subdirs)
122 daughter.upward_propagate_initial_scan_usages();
124 DirUsage &dhere = daughter.m_here_usage;
125 DirUsage &dsubdirs = daughter.m_recursive_subdir_usage;
143 i->second.upward_propagate_stats_and_times();
158 i->second.apply_stats_to_usages();
172 i->second.reset_stats();
185 n_dirs += ds.count_dirs_to_level(max_depth);
197 printf(
"%*d %s usage_here=%lld usage_sub=%lld usage_total=%lld num_ios=%d duration=%d b_hit=%lld b_miss=%lld b_byps=%lld b_wrtn=%lld\n",
210 ds.dump_recursively(name.c_str(), max_depth);
242 printf(
"DataFsState::dump_recursively delta_t = %lld, max_dump_depth = %d\n",
void AddUp(const DirStats &s)
long long m_BytesMissed
number of bytes served from remote and cached
long long m_BytesBypassed
number of bytes served directly through XrdCl
int m_Duration
total duration of all IOs attached
int m_NumIos
number of IO objects attached during this access
long long m_BytesHit
number of bytes served from disk
long long m_BytesWritten
number of bytes written to disk
time_t m_stats_reset_time
time_t m_usage_update_time
void apply_stats_to_usages()
void dump_recursively(int max_depth) const
void upward_propagate_stats_and_times()
DirUsage m_recursive_subdir_usage
DsMap_t::iterator DsMap_i
int count_dirs_to_level(int max_depth) const
DirState * create_child(const std::string &dir)
DirStats m_recursive_subdir_stats
DirState * find_dir(const std::string &dir, bool create_subdirs)
DirState * find_path_tok(PathTokenizer &pt, int pos, bool create_subdirs, DirState **last_existing_dir=nullptr)
DirState * find_path(const std::string &path, int max_depth, bool parse_as_lfn, bool create_subdirs, DirState **last_existing_dir=nullptr)
void apply_stats_to_usages()
void dump_recursively(const char *name, int max_depth) const
void upward_propagate_initial_scan_usages()
void upward_propagate_stats_and_times()
void update_from_stats(const DirStats &s)
void update_last_times(const DirUsage &u)
std::vector< const char * > m_dirs