performancecounter

Using PerformanceCounters to target specific drives

眉间皱痕 提交于 2019-12-04 07:41:49
Guys, I have the following code: using System.Diagnostics; private PerformanceCounter diskRead = new PerformanceCounter(); private PerformanceCounter diskWrite = new PerformanceCounter(); diskRead.CategoryName = "PhysicalDisk"; diskRead.CounterName = "Disk Reads/sec"; diskRead.InstanceName = "_Total"; diskWrite.CategoryName = "PhysicalDisk"; diskWrite.CounterName = "Disk Writes/sec"; diskWrite.InstanceName = "_Total"; This code keeps track of Disk Reads per second and Disk Writes per second and it works fine. My question is, how do I keep track of reads and writes of one specific drive? I have

Do Core i3/5/7 CPUs provide a mechanism to measure IPC?

大城市里の小女人 提交于 2019-12-04 03:34:53
All the Intel CPUs in the last decade (at least) include a set of performance monitors that count a variety of events. Do the latest Intel CPUs, Core i3, i5 and i7 (aka Nehalem) provide a mechanism to count Instructions Per Clock (IPC)? If so, how are they used? If this is possible, I'll probably be writing the code for this in Assembly, but Windows or Linux system calls may also come in useful. Yes, the Vtune from Intel (linux and windows) can measure IPC. If you want to measure it by yourself with precise counters for some part of code, you need to use some performance api like PAPI or

Exception: Instance 'Name of instance' does not exist in the specified Category

会有一股神秘感。 提交于 2019-12-04 00:31:07
问题 When I create and use performance counters like this: private readonly PerformanceCounter _cpuPerformanceCounter; public ProcessViewModel(Process process) { _cpuPerformanceCounter = new PerformanceCounter("Process", "% Processor Time", process.ProcessName, true); } public void Update() { CPU = (int)_cpuPerformanceCounter.NextValue() / Environment.ProcessorCount; // Exception } ... I get an exception Instance 'Name of instance' does not exist in the specified Category and don't understand why.

How do performance counter average timers get associated with their base?

白昼怎懂夜的黑 提交于 2019-12-03 22:35:46
I am adding some performance counters to my c# project and am creating a new PerformanceCounterCategory. In this category, I would like to have multiple counters/timers that track different things. I have a need to use multiple average timers and am trying to understand how the AverageBase counter gets associated with the correct AverageTimer32 counter when there are more than one in the CoutnerCreationDataCollection. A couple of questions: 1. First, is this a correct way to do it? The samples I have found all have only one average timer. 2. And if the answer to the first question is yes, then

ARM performance counters vs linux clock_gettime

点点圈 提交于 2019-12-03 20:53:58
I am using a Zynq chip on a development board ( ZC702 ) , which has a dual cortex-A9 MPCore at 667MHz and comes with a Linux kernel 3.3 I wanted to compare the execution time of a program so first a used clock_gettime and then used the counters provided by the co-processor of ARM. The counter increment every one processor cycle. ( based on this question of stackoverflow and this ) I compile the program with -O0 flag ( since I don't want any reordering or optimization done) The time I measure with the performance counters is 583833498 ( cycles ) / 666.666687 MHz = 875750.221 (microseconds)

Is QueryPerformanceFrequency accurate when using HPET?

岁酱吖の 提交于 2019-12-03 17:02:12
I'm playing around with QueryPerformanceFrequency . It used to return 3.6 Mhz , but it was not enough for what I was trying to do. I've enabled HPET using this command bcdedit /set useplatformclock true . Now it returns 14.3 Mhz . It's great it's more precise... excepted it's not. I quickly realized that I did not get the granularity I expected. If I try to poll QueryPerformanceCounter until it ticks, the smallest increment I can get is 11 , which means 1.27Mhz . If I try to count the number of different values I can get from QueryPerformanceCounter in one second, I get 1.26Mhz . So I was

How do I figure out whether my process is CPU bound, I/O bound, Memory bound or

﹥>﹥吖頭↗ 提交于 2019-12-03 16:08:57
问题 I'm trying to speed up the time taken to compile my application and one thing I'm investigating is to check what resources, if any, I can add to the build machine to speed things up. To this end, how do I figure out if I should invest in more CPU, more RAM, a better hard disk or whether the process is being bound by some other resource? I already saw this (How to check if app is cpu-bound or memory-bound?) and am looking for more tips and pointers. What I've tried so far: Time the process on

C# Performance Counter Help, Nvidia GPU

a 夏天 提交于 2019-12-03 15:11:05
So I've been experimenting with the performance counter class in C# and have had great success probing the CPU counters and almost everything I can find in the windows performance monitor. HOWEVER, I cannot gain access to the "NVIDIA GPU" category... So for example, the following line of code is how it usually works. PerformanceCounter cpuCounter = new PerformanceCounter("Processor", "% Processor Time", "_Total"); That code works fine, but the GPU category that appeared in the performance monitor, just as the processor category did, is not accessible by C#. The following line of code attempts

How to get the number of CPU cycles used by a process

送分小仙女□ 提交于 2019-12-03 09:16:46
问题 I have a need to get the number of CPU cycles used by a specific process using C# (or VB.Net). This information is available in the Process properties popup within Sysinternal's Process Explorer. For instance, the browser that I'm using the post this message has currently used 18,521,360,165 cyles (give or take a few hundred million). Does anyone know how to get this information from a .Net app? I know how to get the CPU usage (percentage), but this isn't what I'm looking for. I need a way to

Application counters in Linux? (and OSX?)

≡放荡痞女 提交于 2019-12-03 07:00:27
I'm trying to figure out if there is a library that gives me something near the equivalent of Windows custom performance counters (described here http://geekswithblogs.net/.NETonMyMind/archive/2006/08/20/88549.aspx ) Basically, I'm looking for something that can be used to both track global counters within an application, and (ideally) something that presents that information via a well-defined interface to other applications/users. These are application statistics; stuff like memory and disk can be captured other ways, but I'm looking to expose throughput/transactions/"widgets" handled during