Henry Robinson has posted comments on this change.

Change subject: IMPALA-5511: Add process start time to debug web page
......................................................................


Patch Set 6:

(6 comments)

I think the code would be cleaner if the metric always had the same name - do 
you feel strongly about keeping them separate for different processes? We can 
also probably keep the changes out of process-state-info with a little 
refactoring. Let me know what you think.

http://gerrit.cloudera.org:8080/#/c/7363/6/be/src/util/metrics.cc
File be/src/util/metrics.cc:

PS6, Line 224: getMetricByName
GetMetricByName


PS6, Line 224: std::
remove std:: in files.


PS6, Line 227: NULL
prefer nullptr now that we're using C++11.


http://gerrit.cloudera.org:8080/#/c/7363/6/be/src/util/process-state-info.cc
File be/src/util/process-state-info.cc:

PS6, Line 191:   StringProperty* start_time_metric = GetMetricFromChildGroup(
             :       "impala-server", "impala-server.start-time");
             :   if (start_time_metric == NULL) {
             :     start_time_metric = GetMetricFromChildGroup(
             :       "catalog", "catalog-server.start-time");
             :   }
             :   if (start_time_metric == NULL) {
             :     start_time_metric = GetMetricFromChildGroup(
             :       "statestore", "statestore.start-time");
             :   }
             : 
             :   return start_time_metric;
I think it's better to avoid this complication, and just have 
"process-start-time" for all processes.


PS6, Line 292: << "  Process Start Time: " << endl
             :          << "    " << GetString("start_time") << endl;
I think it would be better to have the process start time be a json property 
that was added to the document produced by the webserver. That way we can 
choose how to present the start time. I think it would simplify this patch a 
lot as well, because we could probably do without all the changes in this file 
- we can just add that logic to webserver::RootHandler() itself.


http://gerrit.cloudera.org:8080/#/c/7363/6/be/src/util/webserver.cc
File be/src/util/webserver.cc:

PS6, Line 163: metrics_(NULL) {
I suggest a small refactor to avoid adding this dependency on the metrics group 
to the webserver: move the RootHandler() method to the default-path-handlers.cc 
file, and have it added as part of AddDefaultUrlCallbacks(). That method 
already takes a MetricGroup, which you can bind to the RootHandler callback 
(let me know if you need help with bit of C++ trickery - it's basically:

   void RootHandler(MetricGroup* metrics, const ArgumentMap& args, Document* 
doc) {

  }

  // In AddDefaultPathHandlers - make a wrapper fn that calls RootHandler() 
with the metric group.
  webserver->RegisterUrlCallback([metrics](const ArgumentMap& args, Document* 
doc) { RootHandler(metrics, args, doc); });


-- 
To view, visit http://gerrit.cloudera.org:8080/7363
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I05ae2f80835b1b0e4bc3b38731778ba0871338a4
Gerrit-PatchSet: 6
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Gabor Kaszab <gaborkas...@cloudera.com>
Gerrit-Reviewer: Attila Jeges <atti...@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhe...@cloudera.com>
Gerrit-Reviewer: Gabor Kaszab <gaborkas...@cloudera.com>
Gerrit-Reviewer: Henry Robinson <he...@cloudera.com>
Gerrit-Reviewer: Laszlo Gaal <laszlo.g...@cloudera.com>
Gerrit-Reviewer: Matthew Jacobs <m...@cloudera.com>
Gerrit-Reviewer: Tim Armstrong <tarmstr...@cloudera.com>
Gerrit-HasComments: Yes

Reply via email to