Writing perfomance data to a log file

N

NayJo

Hi,

I'm using the performance data helper library to write some performance
counters to a log file but the only format available to me seems to be the
CSV format.

Is there a way I can have the log written in PERFMON format?

////// start code

pdhStatus = PdhBrowseCounters(&pdhBrowseDialogConfigurationBlock);

if (pdhStatus == ERROR_SUCCESS || pdhStatus == PDH_DIALOG_CANCELLED)
{
DWORD dwFlags = (PDH_LOG_WRITE_ACCESS | PDH_LOG_CREATE_ALWAYS);
DWORD dwLogType = PDH_LOG_TYPE_CSV; // PDH_LOG_TYPE_PERFMON not
supported?
DWORD dwMaxSize = 0x20000000; // .5 GB?

// PdhOpenLog returns ERROR_SUCCESS when log type is CSV
// and PDH_NOT_IMPLEMENTED when log type is Perfmon.

pdhStatus = PdhOpenLog( ptcFilename, dwFlags, &dwLogType,
(HQUERY)hPDHQuery, dwMaxSize, NULL, &hPDHLog);

}

////// snip

Counters are properly selected and data is logged as log as I use the CSV
file format but this is not what I want to use.

Many thanks ahead of time.

J
 
N

NayJo

NayJo said:
Hi,

I'm using the performance data helper library to write some performance
counters to a log file but the only format available to me seems to be the
CSV format.

I found out that Perfmon format files are read-only.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top