This blog is part of the blog series named SQL Server Monitoring.

Purpose
To show the CPU % as controlled by the Resource Governor over time.
Report
The report has 2 clustered column charts, where the left are showing data based on resource pool data, and the right are showing data based on workload group data.
Sources
This feature queries the DMV sys.dm_os_performance_counters which returns a row per performance counter that is in the master data table dbo.fhsmPerfmonCounters.
Model
The model for the report uses the fact [Performance statistics] and the dimensions [Date], [Time] and [Performance counter].
It is the same model that are used by the Always On performance and Performance statistics report.

Service setup
The feature uses the service ‘fhsmSPPerfmonStatistics’ which can be configured using the stored procedure fhsmSPControl.
Parameter
There is no parameter to be configured for this feature.
Schedule
The default schedule for the feature is every 5 minutes (300 seconds).
EXEC fhsmSPControl
@Type = 'Schedule',
@Command = 'list',
@Task = 'fhsmSPPerfmonStatistics',
@Name = 'Performance statistics',
@Wildcard = 0;

EXEC fhsmSPControl
@Type = 'Schedule',
@Command = 'set',
@Task = 'fhsmSPPerfmonStatistics',
@Name = 'Performance statistics',
@ScheduleType = 0,
@Enabled = 1,
@ExecutionDelaySec = 300,
@FromTime = '00:00:00',
@ToTime = '23:59:59',
@Monday = 1,
@Tuesday = 1,
@Wednesday = 1,
@Thursday = 1,
@Friday = 1,
@Saturday = 1,
@Sunday = 1;
Retention
The default retention for the table dbo.fhsmPerfmonStatistics is 60 days.
EXEC fhsmSPControl
@Type = 'Retention',
@Command = 'list',
@TableName = 'fhsmPerfmonStatistics',
@Wildcard = 0;

EXEC fhsmSPControl
@Type = 'Retention',
@Command = 'set',
@TableName = 'fhsmPerfmonStatistics',
@Enabled = 1,
@Sequence = 1,
@Days = 60;
