title: How to get diagnostic statistics from a UWP app
body: <p>We are needing to upgrade an application we have to the Universal Windows App (UWP) framework.  The application's main purpose is to collect diagnostic statistics and send them back to our server via a rest call.  </p>
  
  <p>However I am not finding any api's available for getting the statistics</p>
  
  <p>Prior we were </p>
  
  <pre><code>PerformanceCounter _memoryCounter = new PerformanceCounter();
  
  public SystemProperty GetPhysicalMemory()
      {
          string s = _QueryComputerSystem("totalphysicalmemory");
          double totalphysicalmemory = Convert.ToDouble(s);
          double d = _GetCounterValue(_memoryCounter, "Memory", "Available Bytes", null);
          return new SystemProperty { PropertyName = "Physical Memory", Total = totalphysicalmemory, Used = totalphysicalmemory - d };
      }
  </code></pre>
  
  <p>which returned total used and free bytes of memory.  We also collected network and cpu stats.  None of which are compatible with the new framework.  What namespace should I be looking at for this functionality?  Or do I need to use something like Pinvoke (<a href="https://stackoverflow.com/a/33636030/530933">link</a>)?</p>