LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CPU performance monitor?


@Andrey_Dmitriev wrote:
 
 



works like charm in LabVIew 2020 64bit on Windows 11

 

on a side note: you can use a stacked, not transposed waveform chart to compare the cpu % for each core.

 

Spoiler
alexderjuengere_0-1686736173697.png alexderjuengere_1-1686736235659.png

 

 

 

Message 11 of 17
(850 Views)

With the fix you've posted it works fine on my PC and I started to have the feeling that this solution is equivalent with the one I linked when I created this topic. (its just calling the dll directly not thru the .net nodes)

 

I'm not sure if its just me but the numbers dont really add up. For me the total CPU usage (displayed in the task manager) should be: sum(proc% for each cores) / number of cores, but the number I get is significantly different than what I see in the task manager.

0 Kudos
Message 12 of 17
(839 Views)

@1984 wrote:

 For me the total CPU usage (displayed in the task manager) should be: sum(proc% for each cores) / number of cores, but the number I get is significantly different than what I see in the task manager.


If you would like to get overall utilization, then you should use \Processor(_Total)\% Processor Time performance counter, (of course, you can combine multiple counters if needed) something like that:

Screenshot 2023-06-14 12.19.15.png

hope it helps,

Andrey.

0 Kudos
Message 13 of 17
(832 Views)

@1984 wrote:

 

I'm not sure if its just me but the numbers dont really add up. For me the total CPU usage (displayed in the task manager) should be: sum(proc% for each cores) / number of cores, but the number I get is significantly different than what I see in the task manager.


processor>% processor time includes a built in _Total that you can use for reference

 

 

turns out, this built-in total  is quite the same as a total from the formula = sum(proc% for each cores) / number of cores

 

 

Spoiler
alexderjuengere_2-1686746311148.png



I use the chart in https://forums.ni.com/t5/Example-Code/Performance-Monitor-Using-LabVIEW/ta-p/3501988 to log all processor time values
I used 7-Zip Benchmark to create a reproducable load, which is depicted in my chart and graphs

 

alexderjuengere_3-1686746437619.png


Then, I just copy and past the Chart to a new .vi and look at the Chart History (default length: 1024)

total_equality.png

 




 

 

0 Kudos
Message 14 of 17
(776 Views)

@alexderjuengere wrote:


I used 7-Zip Benchmark to create a reproducable load, which is depicted in my chart and graphs
Spoiler
 

Why need 7-zip and do not use such a great tool called LabVIEW?

Screenshot 2023-06-14 17.08.16.png

Timed Loops can be assigned to physical CPUs, and at works (well, a little bit tricky if hyperthreading is enabled, but anyway). Another possibility is to use CPUStress from SysInternals, where you can assign affinity mask to individual cores: https://learn.microsoft.com/en-us/sysinternals/downloads/cpustres

 

Message 15 of 17
(753 Views)

@Andrey_Dmitriev wrote:

Why need 7-zip and do not use such a great tool called LabVIEW?

 


I probably got lazy 😉

 

 

 

 

0 Kudos
Message 16 of 17
(715 Views)

turns out, this built-in total  is quite the same as a total from the formula = sum(proc% for each cores) / number of cores

 

 

Yeah, I've found the _total is practically the same as the formula I used to get the total load on my own.

 

0 Kudos
Message 17 of 17
(711 Views)