Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-4397

DUCC Agent throws NumberFormatException when scraping cpu time from top

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0-Ducc
    • DUCC
    • 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 '

      {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.

      Attachments

        Activity

          People

            cwiklik Jaroslaw Cwiklik
            cwiklik Jaroslaw Cwiklik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: