36 if (!file_reader.
Open(file)) {
37 AERROR <<
"open record file error. file: " << file;
42 std::cout << setiosflags(std::ios::left);
43 std::cout << setiosflags(std::ios::fixed);
47 std::cout << std::setw(w) <<
"record_file: " << file << std::endl;
50 std::cout << std::setw(w) <<
"version: " << hdr.
major_version() <<
"."
54 auto begin_time_s =
static_cast<double>(hdr.
begin_time()) / 1e9;
55 auto end_time_s =
static_cast<double>(hdr.
end_time()) / 1e9;
56 auto duration_s = end_time_s - begin_time_s;
57 auto begin_time_str = UnixSecondsToString(
static_cast<int>(begin_time_s));
58 auto end_time_str = UnixSecondsToString(
static_cast<int>(end_time_s));
59 std::cout << std::setw(w) <<
"duration: " << duration_s <<
" Seconds"
61 std::cout << std::setw(w) <<
"begin_time: " << begin_time_str << std::endl;
62 std::cout << std::setw(w) <<
"end_time: " << end_time_str << std::endl;
65 std::cout << std::setw(w) <<
"size: " << hdr.
size() <<
" Bytes";
66 if (hdr.
size() >= kGB) {
67 std::cout <<
" (" <<
static_cast<float>(hdr.
size()) / kGB <<
" GB)";
68 }
else if (hdr.
size() >= kMB) {
69 std::cout <<
" (" <<
static_cast<float>(hdr.
size()) / kMB <<
" MB)";
70 }
else if (hdr.
size() >= kKB) {
71 std::cout <<
" (" <<
static_cast<float>(hdr.
size()) / kKB <<
" KB)";
73 std::cout << std::endl;
76 std::cout << std::setw(w) <<
"is_complete:";
82 std::cout << std::endl;
85 std::cout << std::setw(w) <<
"message_number: " << hdr.
message_number()
89 std::cout << std::setw(w) <<
"channel_number: " << hdr.
channel_number()
94 AERROR <<
"read index section of the file fail. file: " << file;
99 std::cout << std::setw(w) <<
"channel_info: " << std::endl;
101 for (
int i = 0; i < idx.indexes_size(); ++i) {
102 ChannelCache* cache = idx.mutable_indexes(i)->mutable_channel_cache();
104 std::cout << std::setw(w) <<
"";
105 std::cout << resetiosflags(std::ios::right);
106 std::cout << std::setw(50) << cache->
name();
107 std::cout << setiosflags(std::ios::right);
109 std::cout << std::setw(0) <<
" messages: ";
111 std::cout << std::endl;