public static PerformanceHint Create(string title, string msg, PerformanceHintType type, NotificationSeverity notificationSeverity, string source, INotificationDetails details = null) { return(new PerformanceHint { IsPersistent = true, Title = title, Message = msg, HintType = type, Severity = notificationSeverity, Source = source, Details = details }); }
private PerformanceHint GetOrCreatePerformanceHint <T>(string processTag, string processName, PerformanceHintType etlHintType, string message, out T details) where T : INotificationDetails, new() { Debug.Assert(etlHintType == PerformanceHintType.SqlEtl_SlowSql); var key = $"{processTag}/{processName}"; var id = PerformanceHint.GetKey(etlHintType, key); using (_notificationsStorage.Read(id, out NotificationTableValue ntv)) { details = GetDetails <T>(ntv); return(PerformanceHint.Create( _databaseName, $"{processTag}: '{processName}'", message, etlHintType, NotificationSeverity.Warning, source: key, details: details)); } }
public static string GetKey(PerformanceHintType type, string source) { return($"{NotificationType.PerformanceHint}/{type}/{source}"); }