Permalink
Browse files

[Dashboard] Add the PLE query

  • Loading branch information...
gboge committed Jul 6, 2017
1 parent fb4df2b commit 076567a98552bbccf64da67c95f9e88096b89520
Showing with 15 additions and 1 deletion.
  1. +15 −1 KServer.cs
View
@@ -1184,6 +1184,21 @@ public static DataTable DashboardGetLocks(this smo.Server s, int durationInMinut
return d.ExecuteWithResults(sql).Tables[0];
}
/// <summary>
/// Get the actual Page Life Expectancy
/// </summary>
/// <param name="s"></param>
/// <returns></returns>
public static DataTable DashboardPLE(this smo.Server s)
{
smo.Database d = s.Databases["master"];
string sql = @"SELECT[cntr_value] as PLE
FROM sys.dm_os_performance_counters (NOLOCK)
WHERE object_name LIKE '%Manager%'
AND counter_name = 'Page life expectancy'";
return d.ExecuteWithResults(sql).Tables[0];
}
public static bool IsOleAutomationProcedureActivated(this smo.Server s)
{
@@ -1196,7 +1211,6 @@ public static bool IsOleAutomationProcedureActivated(this smo.Server s)
}
return false;
}
#endregion
}
}

0 comments on commit 076567a

Please sign in to comment.