Ejemplo n.º 1
0
 private void FormatEvent(RawEvent raw)
 {
     switch (raw.Type)
     {
     case EventType.Sql:
         lock (_lockEvents)
             Events.Add(SqlEventFactory.GetEvent(raw));
         break;
     }
 }
Ejemplo n.º 2
0
        public static TimeSpan SlowSlqThreshold = TimeSpan.FromSeconds(10); // seconds

        public static bool IsSqlSlow(BaseEvent ev)
        {
            if (ev is SqlEvent)
            {
                foreach (var qry in ((SqlEvent)ev).Queries)
                {
                    var durRead  = SqlEventFactory.EDocsSecondsToTimeSpan(qry.DurationReadItem);
                    var durIssue = SqlEventFactory.EDocsSecondsToTimeSpan(qry.DurationIssueCommand);
                    if (durRead > SlowSlqThreshold || durIssue > SlowSlqThreshold)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }