With raspberries pi with win10 you can get processor usage

I am running win10 on raspberry pi 2. Using C # (and universal applications), I am wondering if there is a way to get processor usage or memory usage?

My guess is no, as I don't have access to PerformanceCounters, but maybe there is a hack that I don't know about yet?

+4
source share
3 answers

You can access the data used on the webpage mentioned when sending the HTTP GET request to port 80 at http: // [yourpi] ​​/ api / resourcemanager / systemperf . This will return you a JSON block. This is described on the device http: // [yourpi] ​​/restdocumentation.htm .

P/Invoke GetNativeSystemInfo IoT. , kernel32.dll. Win10, .

.

(MSFT)

+1

HTTP- 80 RPi2 W10. -, IP- RPi, "" (http://raspberrypi/SystemPerformance.htm). ! , Perf-Tracing (http://raspberrypi/xperf.htm).

0

, , GetNativeSystemInfo .

[StructLayout(LayoutKind.Sequential)]
internal struct SYSTEM_INFO
{
    public ushort wProcessorArchitecture;
    public ushort wReserved;
    public uint dwPageSize;
    public IntPtr lpMinimumApplicationAddress;
    public IntPtr lpMaximumApplicationAddress;
    public UIntPtr dwActiveProcessorMask;
    public uint dwNumberOfProcessors;
    public uint dwProcessorType;
    public uint dwAllocationGranularity;
    public ushort wProcessorLevel;
    public ushort wProcessorRevision;
}

[DllImport("kernel32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
internal static extern void GetNativeSystemInfo(ref SYSTEM_INFO lpSystemInfo);

Details can be found here: msdn

0
source

Source: https://habr.com/ru/post/1589096/


All Articles