Perf Counters in Web App

B

Ben

Hi,

I registered some custom perf counters that i want to use in my app
(all of type NumberOfItems32). I added them under the same category
name but different counter names...

Same code work perfect in a test c# app, but when i put it on a web
app, there's a strange issue -- In perfmon, i only see one counter
being affected (rest are 0)... and in my code I made a test page to
just show the RawValue for each counter -- that page shows each
PerformanceCounter object has the same value (it should not... i also
have internal counter variables i use for a sanity check).

The PerformanceCounter objects are defined as static like so:

internal static PerformanceCounter pcCurrentRequests = new
PerformanceCounter("Amdocs SIMS HTTP Server","TotalRequests",false);
internal static PerformanceCounter pcCurrentFullscans = new
PerformanceCounter("Amdocs SIMS HTTP Server", "FullscanRequests",
false);
internal static PerformanceCounter pcCurrentFullscans2 = new
PerformanceCounter("Amdocs SIMS HTTP Server", "Fullscan2Requests",
false);
internal static PerformanceCounter pcCurrentHeartbeat = new
PerformanceCounter("Amdocs SIMS HTTP Server", "HeartbeatRequests",
false);
internal static PerformanceCounter pcCurrentGetConfig = new
PerformanceCounter("Amdocs SIMS HTTP Server", "GetConfigRequests",
false);

In the Application_Start method i set the initial RawValue to 0.... I
tried to set each object to a different value, but it just takes the
last and sets on all of them....

anyone experienced this?
 
B

Ben

Hi,

I registered some custom perf counters that i want to use in my app
(all of type NumberOfItems32).  I added them under the same category
name but different counter names...

Same code work perfect in a test c# app, but when i put it on a web
app, there's a strange issue --  In perfmon, i only see one counter
being affected (rest are 0)... and in my code I made a test page to
just show the RawValue for each counter -- that page shows each
PerformanceCounter object has the same value (it should not... i also
have internal counter variables i use for a sanity check).

The PerformanceCounter objects are defined as static like so:

internal static PerformanceCounter pcCurrentRequests = new
PerformanceCounter("Amdocs SIMS HTTP Server","TotalRequests",false);
    internal static PerformanceCounter pcCurrentFullscans = new
PerformanceCounter("Amdocs SIMS HTTP Server", "FullscanRequests",
false);
    internal static PerformanceCounter pcCurrentFullscans2 = new
PerformanceCounter("Amdocs SIMS HTTP Server", "Fullscan2Requests",
false);
    internal static PerformanceCounter pcCurrentHeartbeat = new
PerformanceCounter("Amdocs SIMS HTTP Server", "HeartbeatRequests",
false);
    internal static PerformanceCounter pcCurrentGetConfig = new
PerformanceCounter("Amdocs SIMS HTTP Server", "GetConfigRequests",
false);

In the Application_Start method i set the initial RawValue to 0.... I
tried to set each object to a different value, but it just takes the
last and sets on all of them....

anyone experienced this?

I took the same class code and popped in a test web app and it worked
(same exact category/counter names)....

eventually to fix it, i just changed the Cateogry name and it
worked!! something must of been corrupt on that server in regards to
perf counters.... perhaps a reboot would of fixed it as well.

if anyone ran into this or knows more info please drop a note...
 

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