-
WINAPI to monitor performance of VB COM
Hello all:
Are there any WINAPIs (or any other method for that matter) that will allow
me to gather information on the memory and CPU utilization of a specific
COM object written in Visual Basic...particularly compiled as a .dll. I
know in the windows NT/2000 performance monitor, you can monitor vb applications,
but I would like to actually see the actual stats down to the object. I
appreciate your time.
Dave
-
Re: WINAPI to monitor performance of VB COM
Dave,
> Are there any WINAPIs (or any other method for that matter) that will
allow
> me to gather information on the memory and CPU utilization of a specific
> COM object written in Visual Basic...particularly compiled as a .dll. I
Well, the way varies depending upon the operation system. For Win9x, you
would use ToolHelp32 api calls (there is an article on this somewhere on the
DevX site from VBPJ. For NT, the easiest way is to use PSAPI.dll. I have the
code from an article I did for VBPJ at my web site (below -- look under VBPJ
Code, Create Your Own ToolHelp for NT). However, this gives you information
on *processes*, and a DLL runs as part of a process.
--
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.inquiry.com>
-
Re: WINAPI to monitor performance of VB COM
Dave,
> Are there any WINAPIs (or any other method for that matter) that will
allow
> me to gather information on the memory and CPU utilization of a specific
> COM object written in Visual Basic...particularly compiled as a .dll. I
Well, the way varies depending upon the operation system. For Win9x, you
would use ToolHelp32 api calls (there is an article on this somewhere on the
DevX site from VBPJ. For NT, the easiest way is to use PSAPI.dll. I have the
code from an article I did for VBPJ at my web site (below -- look under VBPJ
Code, Create Your Own ToolHelp for NT). However, this gives you information
on *processes*, and a DLL runs as part of a process.
--
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.inquiry.com>
-
Re: WINAPI to monitor performance of VB COM
L.J.,
This looks like almost what I need. Now I am curious. Can I take a module
ID, name, base address, etc. and find specific memory consumption and cpu
utilization while it is loaded in memory? I assume there much be a hook
in there somewhere. For instance, if a .dll is running on a web server,
if I dive far enough into the IIS process... could I find my COM and verify
its statistics aren't going to crash my server :-)
Thanks,
Dave
"L.J. Johnson" <ljjohnsn@flash.net> wrote:
>Dave,
>
>> Are there any WINAPIs (or any other method for that matter) that will
>allow
>> me to gather information on the memory and CPU utilization of a specific
>> COM object written in Visual Basic...particularly compiled as a .dll.
I
>
>Well, the way varies depending upon the operation system. For Win9x, you
>would use ToolHelp32 api calls (there is an article on this somewhere on
the
>DevX site from VBPJ. For NT, the easiest way is to use PSAPI.dll. I have
the
>code from an article I did for VBPJ at my web site (below -- look under
VBPJ
>Code, Create Your Own ToolHelp for NT). However, this gives you information
>on *processes*, and a DLL runs as part of a process.
>
>--
>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.inquiry.com>
>
>
>
-
Re: WINAPI to monitor performance of VB COM
L.J.,
This looks like almost what I need. Now I am curious. Can I take a module
ID, name, base address, etc. and find specific memory consumption and cpu
utilization while it is loaded in memory? I assume there much be a hook
in there somewhere. For instance, if a .dll is running on a web server,
if I dive far enough into the IIS process... could I find my COM and verify
its statistics aren't going to crash my server :-)
Thanks,
Dave
"L.J. Johnson" <ljjohnsn@flash.net> wrote:
>Dave,
>
>> Are there any WINAPIs (or any other method for that matter) that will
>allow
>> me to gather information on the memory and CPU utilization of a specific
>> COM object written in Visual Basic...particularly compiled as a .dll.
I
>
>Well, the way varies depending upon the operation system. For Win9x, you
>would use ToolHelp32 api calls (there is an article on this somewhere on
the
>DevX site from VBPJ. For NT, the easiest way is to use PSAPI.dll. I have
the
>code from an article I did for VBPJ at my web site (below -- look under
VBPJ
>Code, Create Your Own ToolHelp for NT). However, this gives you information
>on *processes*, and a DLL runs as part of a process.
>
>--
>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.inquiry.com>
>
>
>
-
Re: WINAPI to monitor performance of VB COM
Dave,
> This looks like almost what I need. Now I am curious. Can I take a
module
> ID, name, base address, etc. and find specific memory consumption and cpu
> utilization while it is loaded in memory?
You can find CPU utilization of a thread via the performance monitor API
(run PerfMon.exe and look at the available items for Threads).
I have a sample of this also on my web site ("Use PDH Interface to Capture
NT Performance Data"). I haven't seen anything about memory consumption for
a thread.
--
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.inquiry.com>
-
Re: WINAPI to monitor performance of VB COM
Dave,
> This looks like almost what I need. Now I am curious. Can I take a
module
> ID, name, base address, etc. and find specific memory consumption and cpu
> utilization while it is loaded in memory?
You can find CPU utilization of a thread via the performance monitor API
(run PerfMon.exe and look at the available items for Threads).
I have a sample of this also on my web site ("Use PDH Interface to Capture
NT Performance Data"). I haven't seen anything about memory consumption for
a thread.
--
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.inquiry.com>
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