This is an automated email from the ASF dual-hosted git repository. boroknagyz pushed a commit to branch branch-4.4.0 in repository https://gitbox.apache.org/repos/asf/impala.git
commit 43690811192bce9f921244efa5934851ad1e4529 Author: Saurabh Katiyal <saurabhkati...@gmail.com> AuthorDate: Sun Apr 7 17:16:31 2024 +0530 IMPALA-11495: Add glibc version and effective locale to the Web UI Added a new section "Other Info" in root page for WebUI, displaying effective locale and glibc version. Change-Id: Ia69c4d63df4beae29f5261691a8dcdd04b931de7 Reviewed-on: http://gerrit.cloudera.org:8080/21252 Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> --- be/src/util/default-path-handlers.cc | 6 ++++++ tests/webserver/test_web_pages.py | 8 ++++++++ www/root.tmpl | 3 +++ 3 files changed, 17 insertions(+) diff --git a/be/src/util/default-path-handlers.cc b/be/src/util/default-path-handlers.cc index 8bd4edaca..6ee358cc3 100644 --- a/be/src/util/default-path-handlers.cc +++ b/be/src/util/default-path-handlers.cc @@ -23,6 +23,7 @@ #include <boost/algorithm/string.hpp> #include <boost/bind.hpp> #include <gutil/strings/substitute.h> +#include <gnu/libc-version.h> #include "common/logging.h" #include "kudu/util/flags.h" @@ -251,6 +252,11 @@ void RootHandler(const Webserver::WebRequest& req, Document* document) { Value cgroup_info(CGroupUtil::DebugString().c_str(), document->GetAllocator()); document->AddMember("cgroup_info", cgroup_info, document->GetAllocator()); + Value effective_locale(std::locale("").name().c_str(), document->GetAllocator()); + document->AddMember("effective_locale", effective_locale, document->GetAllocator()); + Value glibc_version(gnu_get_libc_version(), document->GetAllocator()); + document->AddMember("glibc_version", glibc_version, document->GetAllocator()); + if (CommonMetrics::PROCESS_START_TIME != nullptr) { Value process_start_time( CommonMetrics::PROCESS_START_TIME->GetValue().c_str(), document->GetAllocator()); diff --git a/tests/webserver/test_web_pages.py b/tests/webserver/test_web_pages.py index 61e8990c9..5e4a73118 100644 --- a/tests/webserver/test_web_pages.py +++ b/tests/webserver/test_web_pages.py @@ -115,6 +115,14 @@ class TestWebPage(ImpalaTestSuite): if build_flags["cmake_build_type"] in ["debug"]: assert not is_ndebug + def test_root_other_info(self): + """Tests to check glibc version and locale is available""" + for port in self.TEST_PORTS_WITH_SS: + other_info_page = requests.get(self.ROOT_URL.format(port) + "/?json").text + other_info = json.loads(other_info_page) + assert "effective_locale" in other_info + assert "glibc_version" in other_info + def test_memz(self): """Tests /memz at impalad / statestored / catalogd""" diff --git a/www/root.tmpl b/www/root.tmpl index ef42be6ab..da779917d 100644 --- a/www/root.tmpl +++ b/www/root.tmpl @@ -53,4 +53,7 @@ this page is rendered --> <h2>CGroup Info</h2> <pre>{{cgroup_info}}</pre> + <h2>Other Info</h2> + <pre>Locale: {{effective_locale}}<br>GLIBC Version: {{glibc_version}}</pre> + {{>www/common-footer.tmpl}}