Jerry Cwiklik created UIMA-4397:
-----------------------------------

             Summary: DUCC Agent throws NumberFormatException when scraping cpu 
time from top
                 Key: UIMA-4397
                 URL: https://issues.apache.org/jira/browse/UIMA-4397
             Project: UIMA
          Issue Type: Bug
          Components: DUCC
            Reporter: Jerry Cwiklik
            Assignee: Jerry Cwiklik
             Fix For: 2.0.0-Ducc


An agent collects per process CPU stats by using the following: 
 top -b -n 1 -p "+pid+" | tail -n 2 | head -n 1 | awk '{print $9}';

The above seems to cause a NumberFormatException while trying to convert 
scraped output into an integer. The exception is:

java.lang.NumberFormatException: For input string: "%CPU"
        at 
java.lang.NumberFormatException.forInputString(NumberFormatException.java:76)
        at java.lang.Integer.parseInt(Integer.java:492)
        at java.lang.Integer.valueOf(Integer.java:593)
        at 
org.apache.uima.ducc.agent.processors.LinuxProcessMetricsProcessor.collectProcessCurrentCPU(LinuxProcessMetricsProce\ssor.java:462)
 
When running the command by hand I seem to be getting a numeric value. 



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

Reply via email to