private void FormatEvent(RawEvent raw) { switch (raw.Type) { case EventType.Sql: lock (_lockEvents) Events.Add(SqlEventFactory.GetEvent(raw)); break; } }
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); }