[ 
https://issues.apache.org/jira/browse/DRILL-5242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15857206#comment-15857206
 ] 

ASF GitHub Bot commented on DRILL-5242:
---------------------------------------

Github user kkhatua commented on a diff in the pull request:

    https://github.com/apache/drill/pull/742#discussion_r99975093
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/profile/OperatorWrapper.java
 ---
    @@ -163,11 +165,18 @@ public String getMetricsTable() {
               null);
     
           final Number[] values = new Number[metricNames.length];
    +      //Track new/Unknown Metrics
    +      final Set<Integer> unknownMetrics = new TreeSet<Integer>();
           for (final MetricValue metric : op.getMetricList()) {
    -        if (metric.hasLongValue()) {
    -          values[metric.getMetricId()] = metric.getLongValue();
    -        } else if (metric.hasDoubleValue()) {
    -          values[metric.getMetricId()] = metric.getDoubleValue();
    +        if (metric.getMetricId() < metricNames.length) {
    +          if (metric.hasLongValue()) {
    +            values[metric.getMetricId()] = metric.getLongValue();
    +          } else if (metric.hasDoubleValue()) {
    +            values[metric.getMetricId()] = metric.getDoubleValue();
    +          }
    +        } else {
    +          //Tracking unknown metric IDs
    +          unknownMetrics.add(metric.getMetricId());
    --- End diff --
    
    The unknownMetrics set is built incase we want to use this list of metrics 
to do something. I tried logging by publishing the number of unknown metrics 
found, but the problem is that it floods the log. A fix could be to do 
something to publish it just once per rendering of the page. But either way, it 
has no real value. 
    For me, the unknown metric IDs existed because the profile was created from 
a prototype/forked Drill version. It would be nice if the registry of these IDs 
was part of the profile, but that is a separate problem. 
    The simplest suggestion from @parthchandra and @sudheeshkatkam was to 
ignore these metrics for now. The expectation is that elements of the profile 
which are unknown to the rendering version of Drill should never break the UI. 


> The UI breaks when trying to render profiles having unknown metrics
> -------------------------------------------------------------------
>
>                 Key: DRILL-5242
>                 URL: https://issues.apache.org/jira/browse/DRILL-5242
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Web Server
>    Affects Versions: 1.9.0
>            Reporter: Kunal Khatua
>            Assignee: Kunal Khatua
>             Fix For: 1.10.0
>
>
> When profiles are generated using a fork of Drill that has introduced new 
> metrics, the server of the parent branch will fail in rendering the operator 
> metrics correctly. 
> The workaround should be to simply skip unknown metrics. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to