performancecounter

Reset performance counter from command line

时光总嘲笑我的痴心妄想 提交于 2019-12-11 02:41:50
问题 I want to execute a command from command line to reset given performance counter to 0. I could write a simple "3" lines console app to do that, but wondering if VS or Windows or Windows SDK already comes with such utility. I did not find such option in either typeperf or logman. Context: Windows 7 x64 (with Admin access) Background: I use a performance counter to debug/develop/stress-test a web service. Web service increments a performance counter every time it is hit. So the scenario is to

RawFraction performance counter persists its state even after deleting the performance category

会有一股神秘感。 提交于 2019-12-11 01:38:36
问题 I am creating and setting up the performance counters correctly but when I delete the category, recreate the category with the same name and add/update the counters to that category, it fails to update the counters and its values. The following code runs fine for the first time but not the second time. The code to remove the "Delete category" is not needed right now but I want to be able to delete existing category each time we deploy our application. How can I permanently delete the counter

Failure in delete performance counter category

╄→гoц情女王★ 提交于 2019-12-10 23:57:25
问题 I have this simple code: public void CreateCounters() { if (PerformanceCounterCategory.Exists(_categoryName)) { PerformanceCounterCategory.Delete(_categoryName); } // create logic… } works on my machine. I run it on my server, get the following stack trace: System has detected a fatal error. EXITING... NativeErrorCode: 1010 ErrorCode: -2147467259 Message: The configuration registry key is invalid TargetSite: Void RegisterFiles(System.String, Boolean) HelpLink: Source: System Stack Trace: at

Performance counter of type RateOfCountsPerSecond64 has always the value 0

爱⌒轻易说出口 提交于 2019-12-10 22:46:26
问题 I have a WCF service that updates the value of two performance counters. The first is defined as NumberOfItems64, and the second as RateOfCountsPerSecond64. When I update their values (I do this several times per second), perfmon displays as expected the right value for the first counter, but always says that the value of the second counter is 0. When I debug my code, I can see that the RawValue property of the second counter is updated as expected... Here is my PowerShell code to create the

How can I get the Resource Monitor values in .NET?

只谈情不闲聊 提交于 2019-12-10 21:04:38
问题 I need to get some of the values that are in the windows 7 resource monitor. In particular, the memory usage, cpu and bandwidth per process. I've looked into the PerformanceCounter class and I don't see a way to drill down to the process level. The resource monitor has exactly what I am looking for, and before you ask... I know this is re-inventing the wheel but the boss wants this. I looked into WMI as well and it seems most people recommend not using it. So does anyone know how I can get at

“Category does not exist.” Creating performance counter for MSMQ Queue

喜你入骨 提交于 2019-12-10 19:51:06
问题 I am attempting this: using System.Diagnostics; // ... var queueCounter = new PerformanceCounter( "MSMQ Queue", "Messages in Queue", @"machinename\private$\testqueue2"); Console.WriteLine( "Queue contains {0} messages", queueCounter.NextValue().ToString()); Which came from this post: Is there a way to check how many messages are in a MSMQ Queue? There is mention of this same error, but no resolution when using PerformanceCounter. I also found mention here: Performance Counter - System

Glassfish - JEE6 - Use of Interceptor to measure performance

只谈情不闲聊 提交于 2019-12-10 11:29:06
问题 For measuring execution time of methods, I've seen suggestions to use public class PerformanceInterceptor { @AroundInvoke Object measureTime(InvocationContext ctx) throws Exception { long beforeTime = System.currentTimeMillis(); Object obj = null; try { obj = ctx.proceed(); return obj; } finally { time = System.currentTimeMillis() - beforeTime; // Log time } } Then put @Interceptors(PerformanceInterceptor.class) before whatever method you want measured. Anyway I tried this and it seems to

Are there any modern Windows PCs that don't have at least one DirectShow capture device in them? [closed]

与世无争的帅哥 提交于 2019-12-10 11:18:59
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . I am considering doing something that might seem strange to get a reliable time clock . I have to push buffers to a WiFi connected

Async WCF Service and Call Duration Performance Counter

断了今生、忘了曾经 提交于 2019-12-10 10:55:33
问题 I am trying to measure the Calls Duration performance counter for a WCF service method. I have a very simple WCF service as given below. Service interface: [ServiceContract] public interface IFooService { [OperationContract] string DoSomeExpensiveOperation(); } The service implementation: public class FooService : IFooService { public string DoSomeExpensiveOperation() { Thread.Sleep(3000); return "Some valuable information"; } } When the implementation is synchronous (as given above), I can

C# PerformanceCounter list of possible Parameters?

谁说胖子不能爱 提交于 2019-12-10 08:48:07
问题 I am using the System.Data PerfomanceCounter class, and I have found some very specific examples of how to retrieve disk space or CPU usage. However I am unable to find the documentation on the possible values for: PerfomanceCounter.CategoryName PerformanceCounter.CounterName PerformanceCounter.InstanceName I can see from the class the different parameters I can pass to the constructor, but even going to the page for say CategoryName does not give me a list of available values. Can anyone