Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create a Windows Performance Counter with Delphi?

I developed an application that needs to be monitored. Our monitoring site manager wants my app generates some performance parameters through "windows performance monitor".

Then he can monitor them in windows and "ApplicationManger" product of "ManageEngine" company through WMI.

I am searching for Delphi implementation to register/create windows performance counter and set their values.

like image 869
Moh Tarvirdi Avatar asked Oct 02 '22 16:10

Moh Tarvirdi


1 Answers

Create (register) and consume performance counters are a very very wide topic. You can create performance counters from Native Code (C++´or Delphi) for you own App using these alternatives


Using a Performance Extension DLL.

  • Creating a Performance Extension DLL
  • Adding Performance Counters

Providing Counter Data Using Version 2.0 (Windows Vista +)

  • Providing Counter Data Using Version 2.0

Creating a WMI Performance Provider creating a COM Server that implements the IWbemHiPerfProvider interface.

  • IWbemHiPerfProvider interface
  • Developing WMI Hi-Perf Provider using C++

I'm not aware of any Delphi sample project for create performance counters. In the past I used .Net and Delphi to create some performance counters for my customers, unfortunately I can't share this code. But because you mention the WMI in your questions I will recommend you read the MSDN documentation about the performance counters, then check this article Developing WMI Hi-Perf Provider using C++, and finally translate the code of the article to Delphi and if you have any specific issue you can come back and a ask a new question.

like image 95
RRUZ Avatar answered Oct 12 '22 01:10

RRUZ