IMPALA-5630: Add Kudu client version as a common metric Change-Id: I8bd0e220c030822209b811703ebd0cea699e8268 Reviewed-on: http://gerrit.cloudera.org:8080/7525 Reviewed-by: Matthew Jacobs <[email protected]> Tested-by: Impala Public Jenkins
Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/c8814262 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/c8814262 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/c8814262 Branch: refs/heads/master Commit: c8814262e79a6a5d7b6695604496361d5d9bdff5 Parents: 3296064 Author: Bikramjeet Vig <[email protected]> Authored: Thu Jul 27 15:05:01 2017 -0700 Committer: Impala Public Jenkins <[email protected]> Committed: Sat Jul 29 20:24:59 2017 +0000 ---------------------------------------------------------------------- be/src/util/common-metrics.cc | 9 ++++++++- be/src/util/common-metrics.h | 2 ++ common/thrift/metrics.json | 12 ++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/c8814262/be/src/util/common-metrics.cc ---------------------------------------------------------------------- diff --git a/be/src/util/common-metrics.cc b/be/src/util/common-metrics.cc index ed724bb..94c32b5 100644 --- a/be/src/util/common-metrics.cc +++ b/be/src/util/common-metrics.cc @@ -17,15 +17,22 @@ #include "util/common-metrics.h" #include "runtime/timestamp-value.h" +#include <kudu/client/client.h> namespace impala { StringProperty* CommonMetrics::PROCESS_START_TIME = nullptr; +StringProperty* CommonMetrics::KUDU_CLIENT_VERSION = nullptr; + string CommonMetrics::PROCESS_START_TIME_METRIC_NAME = "process-start-time"; +string CommonMetrics::KUDU_CLIENT_VERSION_METRIC_NAME = "kudu-client.version"; void CommonMetrics::InitCommonMetrics(MetricGroup* metric_group) { PROCESS_START_TIME = metric_group->AddProperty<string>( - PROCESS_START_TIME_METRIC_NAME, ""); + PROCESS_START_TIME_METRIC_NAME, ""); + KUDU_CLIENT_VERSION = metric_group->AddProperty<string>( + KUDU_CLIENT_VERSION_METRIC_NAME, kudu::client::GetShortVersionString()); + // TODO: IMPALA-5599: Clean up non-TIMESTAMP usages of TimestampValue PROCESS_START_TIME->set_value(TimestampValue::LocalTime().ToString()); } http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/c8814262/be/src/util/common-metrics.h ---------------------------------------------------------------------- diff --git a/be/src/util/common-metrics.h b/be/src/util/common-metrics.h index 05f0091..141fe1e 100644 --- a/be/src/util/common-metrics.h +++ b/be/src/util/common-metrics.h @@ -25,12 +25,14 @@ namespace impala { class CommonMetrics { public: static StringProperty* PROCESS_START_TIME; + static StringProperty* KUDU_CLIENT_VERSION; /// Registers and initializes the commnon metrics static void InitCommonMetrics(MetricGroup* metric_group); private: static string PROCESS_START_TIME_METRIC_NAME; + static string KUDU_CLIENT_VERSION_METRIC_NAME; }; } http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/c8814262/common/thrift/metrics.json ---------------------------------------------------------------------- diff --git a/common/thrift/metrics.json b/common/thrift/metrics.json index 4f86363..251ea14 100644 --- a/common/thrift/metrics.json +++ b/common/thrift/metrics.json @@ -1438,5 +1438,17 @@ "units": "NONE", "kind": "COUNTER", "key": "total-senders-timedout-waiting-for-recvr-creation" + }, + { + "description": "A version string identifying the Kudu client", + "contexts": [ + "IMPALAD", + "CATALOGSERVER", + "STATESTORE" + ], + "label": "Kudu Client Version", + "units": "NONE", + "kind": "PROPERTY", + "key": "kudu-client.version" } ]
