SQL Server Performance

Average latch wait time(ms) nagative values

Discussion in 'ALL SQL SERVER QUESTIONS' started by snivas, Dec 5, 2011.

  1. snivas Member

    Hi every body,

    I have a Nagios plugin which is calucalating "Average latch wait time(ms)",But some of the reasons we found that this pluin giving Nagative values.
    Queries running by plugin,
    SELECT cntr_value FROM master.dbo.sysperfinfo WHERE counter_name = 'Average Latch Wait Time (ms)' AND object_name = 'SQLServer:Latches'
    SELECT cntr_value FROM master.dbo.sysperfinfo WHERE counter_name = 'Average Latch Wait Time Base' AND object_name = 'SQLServer:Latches'
    By taking above two values plugin is doing some other calucalation and giving out put(most of time nagatives)
    I want to know how to calucalate "Average latch wait time(ms)" at any poing of time,
    Please some provide me Script which can calucalate Average latch wait time(ms) at any point of time.

    Thanks in advance
  2. Luis Martin Moderator

    Did you check using Performance monitor?
  3. snivas Member

    Hi Luis Martin,

    thanks for reply.....

    At this point I did not checked with performance monitor,erlier to this plugin deplyment I checked with Perfmon,I never get the nagative values.

    Thanks in advance
  4. Luis Martin Moderator

    So, if Performance Monitor don't show negatives values, you should ask Nagios people about that.
  5. snivas Member

    Thanks Luis Martin,

    We are taking out that plugin any way,could you please explan how perfmon calucalating 'Average Latch Wait Time (ms)'
    or
    If you give script also helpful for me.
  6. Luis Martin Moderator

    Performance Monitor---> SQL Server:Latches---> Average Latch Time (ms).

    Adding this counter you can see Average, Minimum and Maximum values.

    Also you can Generate Data Collector Set with Performance Monitor and export to CSV and import with Excel.

    Check BOL for those options.
  7. satya Moderator

    Did you check with Nagios software for any updates in this regard?

Share This Page