Skip to content

Commit 1bbd559

Browse files
authored
Create Noisiest-StateChanges.sql
1 parent 7c7bf1e commit 1bbd559

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
-- Top 50 Noisiest State Changes
2+
select distinct top 50 count(sce.StateId) as NumStateChanges,
3+
m.DisplayName as MonitorDisplayName,
4+
m.Name as MonitorIdName,
5+
mt.typename AS TargetClass,
6+
MP.MPname
7+
from StateChangeEvent sce with (nolock)
8+
join state s with (nolock) on sce.StateId = s.StateId
9+
join monitorview m with (nolock) on s.MonitorId = m.Id
10+
join managedtype mt with (nolock) on m.TargetMonitoringClassId = mt.ManagedTypeId
11+
join ManagementPack MP with (nolock) on MP.ManagementPackId = M.ManagementPackId
12+
where m.IsUnitMonitor = 1
13+
--- Scoped to within last 7 days
14+
AND sce.TimeGenerated > dateadd(dd,-3,getutcdate())
15+
group by m.DisplayName, m.Name,mt.typename, MP.MPName
16+
order by NumStateChanges desc

0 commit comments

Comments
 (0)