473,387 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

C#: performance counters

750 Expert 512MB
C#: programatically i wanna do
In Admin tools: PErformance-> Performance Logs and Alerts
i want to create "Counter Logs"
New Log settings...
Basically for printer (for testing if a printer prints more than 10 pages in one time, processor usage exceeds 50% )...
i want logs to be created in Windows logs... Event viewer... I guess they do get created automatically....

now next thing is if i can do the above programatically... how do i filters the logs ... so that i know which once i created?....

is this code in right direction?

if(!PerformanceCounterCategory.Exists("Grudge 2"))
{
CounterCreationDataCollection mycounter = new CounterCreationDataCollection();

CounterCreationData test = new CounterCreationData();
test.CounterName = "Vanessa";
test.CounterHelp="HALO";
test.CounterType = PerformanceCounterType.NumberOfItems32;


mycounter.Add(test);

PerformanceCounterCategory.Create("Grudge 2","Sample",mycounter);

}
Feb 12 '08 #1
1 793
PRR
750 Expert 512MB
Well i guess i actually wanna do this....
C#: programatically i wanna do
In Admin tools: PErformance-> Performance Logs and Alerts
/// CHANGE HERE
i want to create "Alerts"

New Log settings...
Basically for printer (for testing if a printer prints more than 10 pages in one time, processor usage exceeds 50% )...
i want logs to be created in Windows logs... Event viewer... I guess they do get created automatically....

now next thing is if i can do the above programatically... how do i filters the logs ... so that i know which once i created?....
Feb 12 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: David Mitchell | last post by:
Hello group, I'm trying to write code to test an application we're developing. This application needs to store its own performance data in the registry, and we'd like to be storing quite a...
0
by: rob_c | last post by:
Hi, I've been working with the EIF for a few days now. One of the default event sinks provided is the WMI. I've played around a bit and can send events to the WMI. My question here centers on...
2
by: Mark | last post by:
Hi... We're looking at moving an ASP app from IIS 5 to IIS 6. In general things seem to be working okay, but there are some oddities around the edges. One of those unanticipated changes has to...
2
by: Marc Melancon | last post by:
Will the next release of SQL Server 2000 64bit sp provide performance counter? MarcM
0
by: Christopher Attard | last post by:
Hi, I need to create a dialog like the 'Add Counters' dialog box in perfmon. I'm using the System.Diagnostics namespace class in .NET and I've managed to do it. The problem arises when I'm...
7
by: James | last post by:
Hi Has anybody had any experience of ASP.Net performance counters not updating. In the performance monitor application when I try to add the groups ASP.NET and ASP.NET Applications the...
19
by: Tom Jastrzebski | last post by:
Hello, I was just testing VB.Net on Framework.Net 2.0 performance when I run into the this problem. This trivial code attached below executed hundreds, if not thousand times faster in VB 6.0...
1
by: jvn | last post by:
I am experiencing a particular problem with performance counters. I have created a set of classes, that uses System.Diagnostics.PerformanceCounter to increment custom performance counters (using...
1
by: Robert Strickland | last post by:
I have a .Net web service (written for 1.1 Framework using C#) running on Windows 2003 with all latest patches. To help monitor the service, the code creates several performance counters. One...
10
by: Zytan | last post by:
I made a program using the Timer class, and I start the timer with Timer.Start(), but don't stop it with Timer.Stop(), and I assumed this was ok, but, Process Explorer informs me, after running it...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.