MCPcopy Create free account
hub / github.com/apache/impala / TraceEventToJson

Function TraceEventToJson

be/src/runtime/io/data-cache-trace.cc:101–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101std::string TraceEventToJson(const TraceEvent& event) {
102 ostringstream buf;
103 kudu::JsonWriter jw(&buf, kudu::JsonWriter::COMPACT);
104
105 jw.StartObject();
106 jw.String("ts");
107 jw.Double(event.timestamp);
108 jw.String("s");
109 jw.String(EventTypeToString(event.type));
110 jw.String("f");
111 jw.String(event.filename);
112 jw.String("m");
113 jw.Int64(event.mtime);
114 jw.String("o");
115 jw.Int64(event.offset);
116
117 if (event.lookup_length != -1) {
118 jw.String("lLen");
119 jw.Int64(event.lookup_length);
120 }
121 if (event.entry_length != -1) {
122 jw.String("eLen");
123 jw.Int64(event.entry_length);
124 }
125 jw.EndObject();
126
127 return buf.str();
128}
129
130Status TraceFileIterator::Init() {
131 boost::filesystem::path file_path(filename_);

Callers 2

TraceMethod · 0.85
TEST_FFunction · 0.85

Calls 7

EventTypeToStringFunction · 0.85
StartObjectMethod · 0.45
StringMethod · 0.45
DoubleMethod · 0.45
Int64Method · 0.45
EndObjectMethod · 0.45
strMethod · 0.45

Tested by 1

TEST_FFunction · 0.68