- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Can we get cpu usage through pstat_getprocesso...
Operating System - HP-UX
1753903
Members
9697
Online
108810
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-29-2007 05:51 AM
тАО06-29-2007 05:51 AM
Can we get cpu usage through pstat_getprocessor
I want to compute the cpu usage for a while.
First I get cpu number through pstat_getdynamic, secondly I call pstat_getprocessor to get all states's ticks of all cpus, including CPU_IDLE, CPU_USER, CPU_KERNEL, CPU_WAIT, and so on.
My computing method is: the difference of CPU_IDLE and CPU_WAIT is used as the numerator, and the whole difference of all states is used as the denominator.
But the result is obviously different from top or sar's output.
First I get cpu number through pstat_getdynamic, secondly I call pstat_getprocessor to get all states's ticks of all cpus, including CPU_IDLE, CPU_USER, CPU_KERNEL, CPU_WAIT, and so on.
My computing method is: the difference of CPU_IDLE and CPU_WAIT is used as the numerator, and the whole difference of all states is used as the denominator.
But the result is obviously different from top or sar's output.
- Tags:
- pstat
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-30-2007 05:15 AM
тАО06-30-2007 05:15 AM
Re: Can we get cpu usage through pstat_getprocessor
if you have a HPUX system check whether you have OVPA (formerly called measureware). you can do this with a command called perfstat. if it shows a process called midaemon and scope you have measureware.
The measureware product has already collected that data per processor every 5 minutes for 6 months.
If you do not have measureware check whether you purchased the Enterprise or Mission Critical OE. IF you did you are entitled to a license for OVPA and glance.
In addition you can use glance in advisor mode to print out CPU global and per cpu metrics on a recuring basis.
check out the sa1 man page
man sa1
on how to make sar collect data for you on a regular basis.
This way you have 3 options..
Good luck
Emil
The measureware product has already collected that data per processor every 5 minutes for 6 months.
If you do not have measureware check whether you purchased the Enterprise or Mission Critical OE. IF you did you are entitled to a license for OVPA and glance.
In addition you can use glance in advisor mode to print out CPU global and per cpu metrics on a recuring basis.
check out the sa1 man page
man sa1
on how to make sar collect data for you on a regular basis.
This way you have 3 options..
Good luck
Emil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-01-2007 07:29 AM
тАО07-01-2007 07:29 AM
Re: Can we get cpu usage through pstat_getprocessor
Hi Emil,
Thank you for your advice. Now I want to get cpu usage through programming. I believe that some system calls can help me to achive it, but I still did not find them.
Thank you for your advice. Now I want to get cpu usage through programming. I believe that some system calls can help me to achive it, but I still did not find them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2007 04:47 AM
тАО07-02-2007 04:47 AM
Re: Can we get cpu usage through pstat_getprocessor
An unofficial thing do do would be to look at the HP-UX-specific code in netperf. Specifically:
http://www.netperf.org/svn/netperf2/trunk/src/netcpu_pstat.c
and the pstat_new.c versions.
If you would prefer GPL code, then you can look at:
http://www.netperf.org/svn/netperf4/trunk/src/netsysstats_hpux.c
Options for what you can/should use vary with release.
http://www.netperf.org/svn/netperf2/trunk/src/netcpu_pstat.c
and the pstat_new.c versions.
If you would prefer GPL code, then you can look at:
http://www.netperf.org/svn/netperf4/trunk/src/netsysstats_hpux.c
Options for what you can/should use vary with release.
there is no rest for the wicked yet the virtuous have no pillows
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP