コード例 #1
0
ファイル: PerformanceHint.cs プロジェクト: otgoo0603/ravendb
 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
     });
 }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
ファイル: PerformanceHint.cs プロジェクト: yitaom2/ravendb
 public static string GetKey(PerformanceHintType type, string source)
 {
     return($"{NotificationType.PerformanceHint}/{type}/{source}");
 }