c# - Need example of using CounterDelta32 PerformanceCounter -


I have been trying to attempt an operation several times since the previous display replay. I have created a performance counter using the following:

  var clearStateCounterData = new CounterCreationData () {CounterName = ClearStateName, CounterHelp = "Service status has been cleared since previous performance recycling ", CounterType = DisplayTorrentTypeConverterData 32};  

Then I call counter.Increment () in my code but I never see the display counter value level. Even if I run it several times per second.

Do I need to show something special or raise a particular price to show PerformanceCounter to something?

Explained it

I have answered the answer to this counter in the following reply: Thanks for the friends.

Here's an example that works for me.

  class program {const string classname = "____ test category"; Const String CounterName = "Clear State Operations"; Fixed Zero main (string [] args) {if (PerformanceCounterCategory.Exists (classname)) PerformanceCounterCategory.Delete (CategoryName); Var counterDataCollection = New Counter CreditsDataCollection (); Var clearStateCounterData = new CounterCreationData () {CounterName = CounterName, CounterHelp = "Service status has been cleared since the previous display", counterTip = PerformanceCounterType.CounterDelta32}; CounterDataCollection.Add (clearStateCounterData); PerformanceCounterCategory.Create (category name, "Test Perf Counter", PerformanceCounterCategoryType.SingleInstance, counterDataCollection); Var counter = new display counter (category name, countername, incorrect); For (int i = 0; i <5000; i ++) {var sw = stopwatch Startup (); Thread.Sleep (10300); Sw.Stop (); Counter.Increment (); } Console. Read (); }}  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -