12 Replies Latest reply on Dec 23, 2016 8:33 AM by aseymour4

    Calculating % Proc Time and % Core Util Time

    WilsF Lurker

      Hi,

       

      I'm trying to write a PowerShell script to collect % Processor Time to % Core Util Time ratio of multiple vSphere hosts using the Get-ESXtop command in PowerCLI.  I've been using LucD's guide to Get-ESXtop (http://www.lucd.info/2011/04/03/hitchhikers-guide-to-get-esxtop-part-2-the-wrapper/) , but can't get results that even come close to matching actual ESXtop data. 

       

      In order to get % Proc and % Core Util Time, I use the UsedTimeInUsec and CoreHaltTimeInUsec LCPU counters, respectively.  Using the derivation method listed for PCPUUtil, I convert these raw values to the percentages from ESXtop: (n – n-1) / ESX-interval / 1E6 * 100

       

      These percentages more-or-less match up with ESXtop for % Proc Time, but the values for % Core Util Time do not make sense.  The differences in the raw CoreHaltTimeInUsec data are roughly two orders of magnitude higher than those of the UsedTimeInUsec numbers leading to percentages that don't make sense (>100%).

       

      Does anyone here have any ideas why this discrepancy is present?

       

      Here's an example of some of my raw numbers:

       

      Differences in UsedTimeInUsec

      % Processor Time

      323544

      81555

      746247

      298459

      500901

      499624

      664155

      545064

      626532

      207229

      6.47088

      1.6311

      14.92494

      5.96918

      10.01802

      9.99248

      13.2831

      10.90128

      12.53064

      4.14458

       

      Differences in CoreHaltTimeInUsec

      % Core Util Time

      5124259

      5124259

      4560600

      4560548

      4651946

      4651946

      4424210

      4424210

      4773042

      4773042

      102.48518

      102.48518

      91.212

      91.21096

      93.03892

      93.03892

      88.4842

      88.4842

      95.46084

      95.46084

       

      Appreciate any ideas!

       

      Wilson