This is an automated email from the ASF dual-hosted git repository. tarmstrong pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/impala.git
commit b7bd6ac44dfbc5f82e5cba52bf7e751f62a35751 Author: Yongzhi Chen <yc...@cloudera.com> AuthorDate: Tue Jan 29 13:45:44 2019 -0500 IMPALA-8093: Prefix time series counters with a hyphen The change makes profiles prefix counters consistent. Only TimeSeriesCounters are affected. Testing: Add TimeSeriesCounter prefix checks in test_observability tests. Manual Tests: Run query and check profile for MemoryUsage and ThreadUsage. Following section of profile shows that TimeSeriesCounters are consistent with other counters: Fragment F00: . . . Fragment Instance Lifecycle Event Timeline: 273.841ms - Prepare Finished: 1.511ms (1.511ms) . . . - MemoryUsage(500.000ms): 2.81 MB - ThreadUsage(500.000ms): 1 - AverageThreadTokens: 1.00 - BloomFilterBytes: 1.00 MB (1048576) - ExchangeScanRatio: 0.00 - PeakMemoryUsage: 54.26 MB (56891933) - PeakReservation: 53.00 MB (55574528) Change-Id: I2e3f08da765b3e6dedead45760729cbc5e8fb6fa Reviewed-on: http://gerrit.cloudera.org:8080/12296 Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> --- be/src/util/runtime-profile.cc | 4 ++-- tests/query_test/test_observability.py | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/be/src/util/runtime-profile.cc b/be/src/util/runtime-profile.cc index 9892c28..5696486 100644 --- a/be/src/util/runtime-profile.cc +++ b/be/src/util/runtime-profile.cc @@ -767,14 +767,14 @@ void RuntimeProfile::PrettyPrint(ostream* s, const string& prefix) const { { // Print all time series counters as following: - // <Name> (<period>): <val1>, <val2>, <etc> + // - <Name> (<period>): <val1>, <val2>, <etc> SpinLock* lock; int num, period; lock_guard<SpinLock> l(counter_map_lock_); for (const TimeSeriesCounterMap::value_type& v: time_series_counter_map_) { const int64_t* samples = v.second->samples_.GetSamples(&num, &period, &lock); if (num > 0) { - stream << prefix << " " << v.first << "(" + stream << prefix << " - " << v.first << "(" << PrettyPrinter::Print(period * 1000000L, TUnit::TIME_NS) << "): "; for (int i = 0; i < num; ++i) { diff --git a/tests/query_test/test_observability.py b/tests/query_test/test_observability.py index 963ace1..9c85e2e 100644 --- a/tests/query_test/test_observability.py +++ b/tests/query_test/test_observability.py @@ -399,6 +399,11 @@ class TestObservability(ImpalaTestSuite): query = """select count(*) from tpch_parquet.orders o inner join tpch_parquet.lineitem l on o.o_orderkey = l.l_orderkey group by o.o_clerk limit 10""" profile = self.execute_query(query).runtime_profile + + # TimeSeriesCounter should be prefixed with a hyphen. + assert " MemoryUsage" not in profile + assert "- MemoryUsage" in profile + assert "ExchangeScanRatio: 3.19" in profile keys = ["TotalBytesSent", "TotalScanBytesSent", "TotalInnerBytesSent"]