You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by la...@apache.org on 2021/09/16 03:12:13 UTC
[kudu] 02/02: [www] Add some guidance to /scans page
This is an automated email from the ASF dual-hosted git repository.
laiyingchun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git
commit 7a4061e87e9c3f47807a8983872d1384414a854e
Author: zhangyifan27 <ch...@163.com>
AuthorDate: Tue Sep 14 22:12:04 2021 +0800
[www] Add some guidance to /scans page
The scans page looks like this after this change:
http://ww1.sinaimg.cn/large/002Qy9fDgy1guh6cgwpygj62qg0e2dkb02.jpg
Change-Id: I056893c4c5dae63c90d42db8c907cf1646de944e
Reviewed-on: http://gerrit.cloudera.org:8080/17846
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <as...@cloudera.com>
---
src/kudu/tserver/tserver_path_handlers.cc | 9 +++++++--
www/scans.mustache | 2 ++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/kudu/tserver/tserver_path_handlers.cc b/src/kudu/tserver/tserver_path_handlers.cc
index 76e457b..2137dfa 100644
--- a/src/kudu/tserver/tserver_path_handlers.cc
+++ b/src/kudu/tserver/tserver_path_handlers.cc
@@ -29,6 +29,7 @@
#include <utility>
#include <vector>
+#include <gflags/gflags_declare.h>
#include <glog/logging.h>
#include "kudu/common/common.pb.h"
@@ -88,6 +89,8 @@ using std::string;
using std::vector;
using strings::Substitute;
+DECLARE_int32(scan_history_count);
+
namespace kudu {
class Schema;
@@ -588,8 +591,10 @@ const char* kLongTimingTitle = "wall time, user cpu time, and system cpu time "
void TabletServerPathHandlers::HandleScansPage(const Webserver::WebRequest& /*req*/,
Webserver::WebResponse* resp) {
- resp->output.Set("timing_title", kLongTimingTitle);
- EasyJson scans = resp->output.Set("scans", EasyJson::kArray);
+ EasyJson* output = &resp->output;
+ (*output)["scan_history_count"] = FLAGS_scan_history_count;
+ output->Set("timing_title", kLongTimingTitle);
+ EasyJson scans = output->Set("scans", EasyJson::kArray);
vector<ScanDescriptor> descriptors = tserver_->scanner_manager()->ListScans();
for (const auto& descriptor : descriptors) {
diff --git a/www/scans.mustache b/www/scans.mustache
index 6e6cb67..064ec09 100644
--- a/www/scans.mustache
+++ b/www/scans.mustache
@@ -18,6 +18,8 @@ under the License.
}}{{#raw}}{{{.}}}{{/raw}}{{^raw}}
<h1>Scans</h1>
+<p class="lead">This page lists all running scans and last {{scan_history_count}} completed scans.
+The number of historical scans is configurable with the <samp>--scan_history_count</samp> flag.</p>
<table class="table table-striped">
<thead>
<tr>