Results 1 to 4 of 4

Thread: How to monitor CPU and Mem usage?

  1. #1
    Join Date
    Feb 2009
    Posts
    1

    Default How to monitor CPU and Mem usage?

    Hi ,


    I want to monitor the CPU and Mem usage when running a software under PTS.

    Is there any variables I can use to do this thing?
    And how to use it? Similar to $TIMER_START and $TIMEE_STOP in the sample-program?



    Thanks
    --Ava

  2. #2

    Default

    Hi Ava,

    Currently there is only memory and CPU monitoring support through a separate module that will chart out the results. i.e. run:

    MONITOR=all ./phoronix-test-suite benchmark encode-ogg

    To see all monitor results. Though some of the monitoring capabilities are only supported on Linux, but patches for OpenSolaris would be welcome.

    Then I can add support so that a test profile can monitor the CPU usage within a test profile using say $CPU_LOAD_AVG_START $CPU_LOAD_AVG_END or something like that along with other metrics. I'll see about writing up that support this week

    Let me know if you have any other questions or requests.

    Michael

  3. #3

    Default

    Ava,

    I just committed something to Git master that I hope is able to fulfill your needs:

    Test profiles can now call $SYSTEM_MONITOR_START and $SYSTEM_MONITOR_STOP. Below is a brief example of one I hacked together to demonstrate for an install script for a test profile:

    Code:
    #!/bin/sh
    
    echo "#!/bin/sh
    \$SYSTEM_MONITOR_START mem.usage delta 1
    firefox http://www.phoronix-test-suite.com/ &
    \$TIMED_KILL firefox 10
    sleep 8
    \$SYSTEM_MONITOR_STOP > \$LOG_FILE" > idle
    chmod +x idle
    What that does is monitor the memory usage every 1 second while launching Firefox for 10 seconds. The memory usage delta/difference is then determined.

    $SYSTEM_MONITOR_START has three parameters. The first is what to monitor (currently what's implemented right now is mem.usage or cpu.usage). The second argument is for average, maximum, minimum, delta, or all. The last argument is the amount of time (in seconds) between polling results.

    Running $SYSTEM_MONITOR_STOP then stops the polling and will return the value.

    Commit:

    http://phorogit.com/index.php?p=phor...aee6bf2b9b4c49

    Let me know how that works out for your needs or if you hit any problems or need any other features Patches are also welcome along with new test profiles.

    Michael

  4. #4

    Default

    Support has now been committed to pts-core/ so that OpenSolaris has integrated CPU load usage detection as well.

    http://www.phorogit.com/index.php?p=...7f2c347a60d2ff

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •