87 ss <<
"# -----------------------------------------------------------------" << std::endl;
90 ss <<
"# File: " <<
fname << std::endl;
91 ss <<
"# Sync: " << std::fixed << std::setprecision(2) <<
synchronicity <<
"%" << std::endl;
92 ss <<
"# Errs: " << std::fixed <<
errors << std::endl;
96 ss <<
"# Summary" << std::endl;
98 ss <<
"# -----------------------------------------------------------------" << std::endl;
101 std::string key = i.first;
102 std::transform(key.begin(), key.end(), key.begin(), ::tolower);
105 ss <<
"# " << std::setw(16) << key <<
" : " << std::setw(16) << std::fixed << i.second
106 <<
" s" << std::endl;
111 std::string key = i.first;
112 std::transform(key.begin(), key.end(), key.begin(), ::tolower);
115 ss <<
"# " << std::setw(16) << key <<
" : " << std::setw(16) << i.second << std::endl;
121 std::string name =
fname;
123 name =
"_files_summary_";
125 ss <<
" {" << std::endl;
127 <<
"\"" << name <<
"\"," << std::endl;
128 ss <<
" \"synchronicity\": " <<
synchronicity <<
"," << std::endl;
129 ss <<
" \"errors\": " <<
errors <<
"," << std::endl;
132 std::string key = i.first;
133 std::transform(key.begin(), key.end(), key.begin(), ::tolower);
136 ss <<
" \"" << key <<
"\": " << i.second <<
"," << std::endl;
141 std::string key = i.first;
142 std::transform(key.begin(), key.end(), key.begin(), ::tolower);
145 ss <<
" \"" << key <<
"\": " << i.second <<
"," << std::endl;
148 ss.seekp(-2, std::ios_base::end);
151 ss <<
" }" << std::endl;
153 ss <<
" }," << std::endl;
239 const uint64_t KB = 1000ll;
240 const uint64_t MB = 1000ll * KB;
241 const uint64_t GB = 1000ll * MB;
242 const uint64_t TB = 1000ll * GB;
243 const uint64_t PB = 1000ll * TB;
244 const uint64_t EB = 1000ll * PB;
245 std::stringstream ss;
246 if (insize >= (10 * KB))
259 ss << std::fixed << std::setprecision(2) << (insize * 1.0 / EB) <<
" EB";
264 ss << std::fixed << std::setprecision(2) << (insize * 1.0 / PB) <<
" PB";
270 ss << std::fixed << std::setprecision(2) << (insize * 1.0 / TB) <<
" TB";
276 ss << std::fixed << std::setprecision(2) << (insize * 1.0 / GB) <<
" GB";
282 ss << std::fixed << std::setprecision(2) << (insize * 1.0 / MB) <<
" MB";
288 ss << std::fixed << std::setprecision(2) << (insize * 1.0 / KB) <<
" KB";
293 ss << std::fixed << insize <<
" B";