-
Getting Process I/O statistics
I have a situation where a VB program uses CreateProcess to start an external
program written outside my business. Unfortunately, its not a well behaved
external program and it sometimes goes into an infinite loop. The best way
for me to detect this would be to monitor the external program's I/O usage
and terminate it if it stops doing I/O. Does anyone know of an API I can
tie into that gives me Process I/O statistics?
Note that this is running on Windows NT, so the Windows 2000 API is not available
to me.
Thanks for your help.
Andy
-
Re: Getting Process I/O statistics
Andy,
> program written outside my business. Unfortunately, its not a well
behaved
> external program and it sometimes goes into an infinite loop. The best
way
> for me to detect this would be to monitor the external program's I/O usage
> and terminate it if it stops doing I/O. Does anyone know of an API I can
> tie into that gives me Process I/O statistics?
Yea, you need to use PDH.DLL. It does have a VB as well as a C++ interface.
--
L.J. Johnson, Slightly Tilted Software
Microsoft MVP (Visual Basic)
LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
<http://www.SlightlyTiltedSoftware.com>
Ask The NT Pro at <http://www.devx.com/gethelp>
-
Re: Getting Process I/O statistics
Andy,
> program written outside my business. Unfortunately, its not a well
behaved
> external program and it sometimes goes into an infinite loop. The best
way
> for me to detect this would be to monitor the external program's I/O usage
> and terminate it if it stops doing I/O. Does anyone know of an API I can
> tie into that gives me Process I/O statistics?
Yea, you need to use PDH.DLL. It does have a VB as well as a C++ interface.
--
L.J. Johnson, Slightly Tilted Software
Microsoft MVP (Visual Basic)
LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
<http://www.SlightlyTiltedSoftware.com>
Ask The NT Pro at <http://www.devx.com/gethelp>
-
Re: Getting Process I/O statistics
"L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
>Andy,
>
>Yea, you need to use PDH.DLL. It does have a VB as well as a C++ interface.
>
>--
>L.J. Johnson, Slightly Tilted Software
>Microsoft MVP (Visual Basic)
>LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
><http://www.SlightlyTiltedSoftware.com>
>Ask The NT Pro at <http://www.devx.com/gethelp>
>
>
>
Larry:
Thanks for your response. I've looked at PDH.DLL. It looked to me like
it is a helper for PSAPI.DLL that connects to the counters for the Performance
Monitor. I did not see a counter on the performance monitor that gave me
process I/O time or counts or anything I could translate into one of these.
The counts I saw were:
% Privileged Time
% Processor Time
% User Time
Elapsed Time
Handle Count
ID Process
Page Faults/sec
Page File Bytes
Page File Bytes Peak
Pool Nonpaged Bytes
Pool Paged Bytes
Priority Base
Private Bytes
Thread Count
Virtual Bytes
Virtual Bytes Peak
Working Set
Working Set Peak
Am I missing something? Thanks again for your help.
-
Re: Getting Process I/O statistics
"L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
>Andy,
>
>Yea, you need to use PDH.DLL. It does have a VB as well as a C++ interface.
>
>--
>L.J. Johnson, Slightly Tilted Software
>Microsoft MVP (Visual Basic)
>LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
><http://www.SlightlyTiltedSoftware.com>
>Ask The NT Pro at <http://www.devx.com/gethelp>
>
>
>
Larry:
Thanks for your response. I've looked at PDH.DLL. It looked to me like
it is a helper for PSAPI.DLL that connects to the counters for the Performance
Monitor. I did not see a counter on the performance monitor that gave me
process I/O time or counts or anything I could translate into one of these.
The counts I saw were:
% Privileged Time
% Processor Time
% User Time
Elapsed Time
Handle Count
ID Process
Page Faults/sec
Page File Bytes
Page File Bytes Peak
Pool Nonpaged Bytes
Pool Paged Bytes
Priority Base
Private Bytes
Thread Count
Virtual Bytes
Virtual Bytes Peak
Working Set
Working Set Peak
Am I missing something? Thanks again for your help.
-
Re: Getting Process I/O statistics
Andy,
> Thanks for your response. I've looked at PDH.DLL. It looked to me like
> it is a helper for PSAPI.DLL that connects to the counters for the
Performance
> Monitor. I did not see a counter on the performance monitor that gave me
> process I/O time or counts or anything I could translate into one of
these.
Not exactly. PSAPI is a *subset* of the per data (plus some other stuff).
PDH is the full set (without the other stuff). Look at Matt Pietrek's
article at
http://www.microsoft.com/msj/default...ood0598.htm&na
v=/msj/0598/newnav.htm for a *VB* sample program (yes, he did write VB at
least once in his life <G>)
--
L.J. Johnson, Slightly Tilted Software
Microsoft MVP (Visual Basic)
LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
<http://www.SlightlyTiltedSoftware.com>
Ask The NT Pro at <http://www.devx.com/gethelp>
> The counts I saw were:
>
> % Privileged Time
> % Processor Time
> % User Time
> Elapsed Time
> Handle Count
> ID Process
> Page Faults/sec
> Page File Bytes
> Page File Bytes Peak
> Pool Nonpaged Bytes
> Pool Paged Bytes
> Priority Base
> Private Bytes
> Thread Count
> Virtual Bytes
> Virtual Bytes Peak
> Working Set
> Working Set Peak
>
> Am I missing something? Thanks again for your help.
>
>
-
Re: Getting Process I/O statistics
Andy,
> Thanks for your response. I've looked at PDH.DLL. It looked to me like
> it is a helper for PSAPI.DLL that connects to the counters for the
Performance
> Monitor. I did not see a counter on the performance monitor that gave me
> process I/O time or counts or anything I could translate into one of
these.
Not exactly. PSAPI is a *subset* of the per data (plus some other stuff).
PDH is the full set (without the other stuff). Look at Matt Pietrek's
article at
http://www.microsoft.com/msj/default...ood0598.htm&na
v=/msj/0598/newnav.htm for a *VB* sample program (yes, he did write VB at
least once in his life <G>)
--
L.J. Johnson, Slightly Tilted Software
Microsoft MVP (Visual Basic)
LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
<http://www.SlightlyTiltedSoftware.com>
Ask The NT Pro at <http://www.devx.com/gethelp>
> The counts I saw were:
>
> % Privileged Time
> % Processor Time
> % User Time
> Elapsed Time
> Handle Count
> ID Process
> Page Faults/sec
> Page File Bytes
> Page File Bytes Peak
> Pool Nonpaged Bytes
> Pool Paged Bytes
> Priority Base
> Private Bytes
> Thread Count
> Virtual Bytes
> Virtual Bytes Peak
> Working Set
> Working Set Peak
>
> Am I missing something? Thanks again for your help.
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks