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

Daniel Templeton commented on YARN-4308:
----------------------------------------

Thanks, [~sunilg].  Looks like checkstyle caught something I should have: 
you're missing javadocs on the {{MockCPUResourceCalculatorProcessTree}} class.  
Since there's another patch coming, I have a few more nits to pick that I just 
noticed:

* In {{MockResourceCalculatorProcessTree}}, you have:

{code}
  private long cpuPercentage = 0;
  ...
  @Override
  public float getCpuUsagePercent() {
    return this.cpuPercentage;
  }
{code}

Should it just return 0 (like you had originally) instead of declaring a member 
variable that is never changed?

In the test you sleep for 200ms for the next cycle.  Is there a way to wait for 
a concrete event instead of sleeping and hoping?  I'm worried about adding 
another flakey test to the list.

> ContainersAggregated CPU resource utilization reports negative usage in first 
> few heartbeats
> --------------------------------------------------------------------------------------------
>
>                 Key: YARN-4308
>                 URL: https://issues.apache.org/jira/browse/YARN-4308
>             Project: Hadoop YARN
>          Issue Type: Bug
>          Components: nodemanager
>    Affects Versions: 2.7.1
>            Reporter: Sunil G
>            Assignee: Sunil G
>         Attachments: 0001-YARN-4308.patch, 0002-YARN-4308.patch, 
> 0003-YARN-4308.patch, 0004-YARN-4308.patch, 0005-YARN-4308.patch, 
> 0006-YARN-4308.patch, 0007-YARN-4308.patch
>
>
> NodeManager reports ContainerAggregated CPU resource utilization as -ve value 
> in first few heartbeats cycles. I added a new debug print and received below 
> values from heartbeats.
> {noformat}
> INFO 
> org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl:
>  ContainersResource Utilization : CpuTrackerUsagePercent : -1.0 
> INFO 
> org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor.ContainersMonitorImpl:ContainersResource
>  Utilization :  CpuTrackerUsagePercent : 198.94598
> {noformat}
> Its better we send 0 as CPU usage rather than sending a negative values in 
> heartbeats eventhough its happening in only first few heartbeats.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to