Ask a questionAsk a question
 

AnswerGetting realtime metric values with the .NET SDK

  • Wednesday, March 04, 2009 5:59 PMOfer Dekel Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    In powershell, I can do:

    Add-PSSnapin microsoft.hpc
    get-hpcmetricvalue -Scheduler <myCluster'sName>

    And I get all of the realtime CPU/Network/Disk usage from each node in the cluster.

    How can I get this info through the .NET SDK ? 

    Thanks.

Answers

All Replies

  • Saturday, April 04, 2009 5:13 AMyidingzMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You can run those cmdlets with correct pipleline to filter our the desired value in your C# code.
  • Tuesday, April 07, 2009 9:15 AMKeshuang ShenMSFTUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    1. the CPU/Network/Disk usage you get with "get-hpcmetricvalue" are not realtime, the default interval for each metric is "1min". you can export-hpcmetric to see the interval setting for one metric, change the interval in exported xml file, then change this setting with import-hpcmetric command. however, the minimun interval is 1min, you cannot set this to a value less than 1min.
    2. if you are an cluster admin, you can query realtime perfmance counter values with .NET api. pls. refer to http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecountermanager.performancecountermanager(vs.80).aspx for more information.
  • Tuesday, June 23, 2009 2:33 AMZhen WEI MSFT Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Errr, one correction: Get-HpcMetricValue IS realtime. And what's more Get-HpcMetricValue accepts NodeName, (Metric's) Name and Counter (perf counter instance name) as parameters, so you can get perf counter value for specific node and/or perf counter instance.