Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
An agent collects per process CPU stats by using the following:
top -b -n 1 -p "pid" | tail -n 2 | head -n 1 | awk '
';
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.