cuffer
May 21st, 1999, 07:09 AM
I've created my own PerfMon object and counters for my server application.
I'm able to get PERF_COUNTER_RAWCOUNT and PERF_COUNTER_COUNTER counters
working, but I can't seem to get the PERF_ELAPSED_TIME counters working.
PERF_ELAPSED_TIME is defined in WINPERF.H as:
// The data collected in this counter is actually the start time of the
// item being measured. For display, this data is subtracted from the
// sample time to yield the elapsed time as the difference between the two.
// In the definition below, the PerfTime field of the Object contains
// the sample time as indicated by the PERF_OBJECT_TIMER bit and the
// difference is scaled by the PerfFreq of the Object to convert the time
// units into seconds.
#define PERF_ELAPSED_TIME \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_ELAPSED |\
PERF_OBJECT_TIMER | PERF_DISPLAY_SECONDS)
In my app I value the counter by:
time_t StartTime;
g_PrfData.GetCtr32(ELAPSED_TIME) = time(&StartTime);
This was just a guess, I have no idea what kind of data type the "start
time" in the comment above expects.
Any ideas?
Thanks,
-- Pat
mailto: Pat.Cuff@smed.com
I'm able to get PERF_COUNTER_RAWCOUNT and PERF_COUNTER_COUNTER counters
working, but I can't seem to get the PERF_ELAPSED_TIME counters working.
PERF_ELAPSED_TIME is defined in WINPERF.H as:
// The data collected in this counter is actually the start time of the
// item being measured. For display, this data is subtracted from the
// sample time to yield the elapsed time as the difference between the two.
// In the definition below, the PerfTime field of the Object contains
// the sample time as indicated by the PERF_OBJECT_TIMER bit and the
// difference is scaled by the PerfFreq of the Object to convert the time
// units into seconds.
#define PERF_ELAPSED_TIME \
(PERF_SIZE_LARGE | PERF_TYPE_COUNTER | PERF_COUNTER_ELAPSED |\
PERF_OBJECT_TIMER | PERF_DISPLAY_SECONDS)
In my app I value the counter by:
time_t StartTime;
g_PrfData.GetCtr32(ELAPSED_TIME) = time(&StartTime);
This was just a guess, I have no idea what kind of data type the "start
time" in the comment above expects.
Any ideas?
Thanks,
-- Pat
mailto: Pat.Cuff@smed.com