• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to capture unix cpu and memory usage....

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been tasked with load testing an application on an Unix machine, let's refer to the application as BASE. I will be writing a load simulator class (in java 1.6) to load the application from a Windows XP machine, let's refer to this application as TESTER.

Is there a straightforward way to get the memory usage and cpu % of BASE from within the TESTER code? This will allow me to capture data conveniently in terms of load units generated and the associated cpu usage and memory usage.

I am totally new to testing but, as usual, have to have this finished quickly. Any pointers, suggestions, or links would be appreciated.

From my initial research there doesn't seem to be a straightforward way to do this as I am not a scripting guru (shell scripts) or finding a way to capture JConsole information.

Thanks in advance for your help and advice.

JD
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JD,
Any reason you aren't using a profiler to get that info?

I don't know how to get that info, but a number of profilers are open source. You could see what they do.
 
J.D. Thompson
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeanne,

Thank you very much for the quick reply. As a fall back position I will use JConsole and manually record the various system params I require. I was hoping that I could automate that feature by retrieving the params from the test program and thus the reason for my posting. Does that help clarify?

You guys at the Ranch are awesome. Also, I love the HeadFirst series!!

Take care!

JD
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JD, you could try and see if Sigar would do the trick. It's a GPL-licensed multi-platform library that seems to give you just the information you're looking for.
 
J.D. Thompson
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wow Lasse!

This looks interesting. I am not certain of my understanding after looking at the site you provided so forgive me if my question is mundane in nature. With the scenario outlined in the first posting, would SIGAR be able to be run in the TESTER program from the Windows box but retrieve system info from the Linux box where the BASE program is running? It almost seems I would have to create a monitor server app which includes SIGAR to pull the information on the Linux box.

Thanks again for your quick reply and I look forward to your "illuminating" answer!

JD
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Heh. It's far from illuminating but here it comes

Yes, SIGAR would need to run on the very machine that you want details on so some kind of an "agent" process would be needed on that Linux box to serve that information to the tester program running on the Windows box.
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic