Batch Requests/sec ; FROM sys.dm_os_performance_counters -how to get SUM /hour?

  • Is it possible to query the SUM(cntr_value) for the previous hour ? (for example, to compare it with Sum of the current hour?) (or any other time period, for that matter?)

    SELECT cntr_value,*

    FROM master.sys.dm_os_performance_counters

    WHERE counter_name='Batch Requests/sec';

    Likes to play Chess

  • as you have been advised on other similar queries you need to implement a storage of these metrics onto a table at a point in time - and then build your reports taking in consideration the point in time values vs the prior point in time.

    and as also advised these counters reset if the instance is restarted (or failed over) so you have the further issue that any restart of server needs to be taken in consideration on your reports.

    or buy something like SQL Monitor that does that for you.

  • Thank you! I'll do just as you advised. Will save the counter value every 1 minute to table.

     

    Likes to play Chess

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply