mirror of
https://github.com/apache/impala.git
synced 2025-12-25 02:03:09 -05:00
IMPALA-1945: Add query duration to /queries
Change-Id: Ie51af69d6c5c20b577f8d825a9a536d0089ff902 Reviewed-on: http://gerrit.cloudera.org:8080/347 Reviewed-by: Henry Robinson <henry@cloudera.com> Tested-by: Internal Jenkins
This commit is contained in:
committed by
Internal Jenkins
parent
154f1d6671
commit
a26b67c173
@@ -233,6 +233,14 @@ void ImpalaServer::QueryStateToJson(const ImpalaServer::QueryStateRecord& record
|
||||
Value end_time(record.end_time.DebugString().c_str(), document->GetAllocator());
|
||||
value->AddMember("end_time", end_time, document->GetAllocator());
|
||||
|
||||
const TimestampValue& end_timestamp =
|
||||
record.end_time.HasDate() ? record.end_time : TimestampValue::LocalTime();
|
||||
double duration =
|
||||
end_timestamp.ToSubsecondUnixTime() - record.start_time.ToSubsecondUnixTime();
|
||||
const string& printed_duration = PrettyPrinter::Print(duration, TUnit::TIME_S);
|
||||
Value val_duration(printed_duration.c_str(), document->GetAllocator());
|
||||
value->AddMember("duration", val_duration, document->GetAllocator());
|
||||
|
||||
string progress = "N/A";
|
||||
if (record.has_coord) {
|
||||
stringstream ss;
|
||||
|
||||
@@ -28,6 +28,7 @@ archived in memory. The size of that archive is controlled with the
|
||||
<th>Statement</th>
|
||||
<th>Query Type</th>
|
||||
<th>Start Time</th>
|
||||
<th>Duration</th>
|
||||
<th>Scan Progress</th>
|
||||
<th>State</th>
|
||||
<th>Last Event</th>
|
||||
@@ -42,6 +43,7 @@ archived in memory. The size of that archive is controlled with the
|
||||
<td><samp>{{stmt}}</samp></td>
|
||||
<td><samp>{{stmt_type}}</samp></td>
|
||||
<td>{{start_time}}</td>
|
||||
<td>{{duration}}</td>
|
||||
<td>{{progress}}</td>
|
||||
<td><samp>{{state}}</samp></td>
|
||||
<td><samp>{{last_event}}</samp></td>
|
||||
@@ -62,6 +64,7 @@ archived in memory. The size of that archive is controlled with the
|
||||
<th>Query Type</th>
|
||||
<th>Start Time</th>
|
||||
<th>End Time</th>
|
||||
<th>Duration</th>
|
||||
<th>Scan Progress</th>
|
||||
<th>State</th>
|
||||
<th># rows fetched</th>
|
||||
@@ -75,6 +78,7 @@ archived in memory. The size of that archive is controlled with the
|
||||
<td><samp>{{stmt_type}}</samp></td>
|
||||
<td>{{start_time}}</td>
|
||||
<td>{{end_time}}</td>
|
||||
<td>{{duration}}</td>
|
||||
<td>{{progress}}</td>
|
||||
<td><samp>{{state}}</samp></td>
|
||||
<td>{{rows_fetched}}</td>
|
||||
|
||||
Reference in New Issue
Block a user