Add cpu and io indicates to audit log (#513)

Record query consumption into fe audit log. Its basic mode of work is as follows, one of instance of parent plan is responsible for accumulating sub plan's consumption and send to it's parent, BE coordinator will get total consumption because it's a single instance.
This commit is contained in:
chenhao
2019-01-09 22:28:20 +08:00
committed by GitHub
parent 69f9987abd
commit 5192e2f010
30 changed files with 467 additions and 46 deletions

View File

@ -131,6 +131,7 @@ Status ExchangeNode::get_next(RuntimeState* state, RowBatch* output_batch, bool*
if (reached_limit()) {
_stream_recvr->transfer_all_resources(output_batch);
set_runtime_consumption(state);
*eos = true;
return Status::OK;
} else {
@ -179,6 +180,7 @@ Status ExchangeNode::get_next(RuntimeState* state, RowBatch* output_batch, bool*
if (reached_limit()) {
_stream_recvr->transfer_all_resources(output_batch);
set_runtime_consumption(state);
*eos = true;
return Status::OK;
}
@ -197,6 +199,7 @@ Status ExchangeNode::get_next(RuntimeState* state, RowBatch* output_batch, bool*
RETURN_IF_ERROR(fill_input_row_batch(state));
*eos = (_input_batch == NULL);
if (*eos) {
set_runtime_consumption(state);
return Status::OK;
}
@ -243,6 +246,7 @@ Status ExchangeNode::get_next_merging(RuntimeState* state, RowBatch* output_batc
// by the merger to the output batch.
if (*eos) {
_stream_recvr->transfer_all_resources(output_batch);
set_runtime_consumption(state);
}
COUNTER_SET(_rows_returned_counter, _num_rows_returned);