RateOfCountsPerSecond32 Performancecounter on c#

G

georg sauseng

I tried to monitor the traffic received by my webservice by such a counter.
I can see that it is working. I am using a polling service to get load
on my webservice as i like and watchin it on the perfmon tool.

Well but i need to work with the values and i thought i could get this
calculated values just by the NextValue function but all i got out was zero.

I am incrementing the counter with each request thats all i am doing
with the counter.

To get the calculated value (rate of)i do the calculation as following:
CounterSample sample1 = new CounterSample();
sample1 = counter.NextSample();
float sample = CounterSample.Calculate(orderSample, tempSample);
orderSample = sample1;
return sample;

I never read anywhere that i have to do it in that way on MSDN sites,
but it looks like. Am i doing something wrong or is it the right way?
Are there any codesamples how to use this kind of counter and to work
with nit not only watch it on perfmon?


Next thing i would like to do is to read the counter value via vbscript
to act if its goin down to zero, but it looks like i can only read out
the raw value from the counter as well, so only got the incremented raw
value if i try to read it out with vbscript...


Maybe someone can give me hints about that ..

Regards Georg s.
 

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