Getting Process I/O statistics


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: Getting Process I/O statistics

Hybrid View

  1. #1
    Andy Guest

    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

  2. #2
    L.J. Johnson Guest

    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>




  3. #3
    Andy Guest

    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.



  4. #4
    L.J. Johnson Guest

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




  5. #5
    L.J. Johnson Guest

    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>




  6. #6
    Andy Guest

    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.



  7. #7
    L.J. Johnson Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center