public void Store(RequestLog log) { var id = log.ChainId; _lock.Write(() => { if(_instrumentationReports.ContainsKey(id)) { var report = _instrumentationReports[id]; report.ReportUrl = _urls.UrlFor(new InstrumentationRouteDetailsInputModel { Id = log.ChainId }); report.AddReportLog(log); } else { var chain = _graph.Behaviors.FirstOrDefault(x => x.UniqueId == log.ChainId); var title = ChainVisualization.TitleForChain(chain); var report = new RouteInstrumentationReport(_settings, id, title) { ReportUrl = _urls.UrlFor(new InstrumentationRouteDetailsInputModel { Id = id }) }; report.AddReportLog(log); _instrumentationReports.Add(id, report); } }); }
public RouteInstrumentationModel(RouteInstrumentationReport report) { Id = report.Id; Url = report.Url; ReportUrl = report.ReportUrl; HitCount = report.HitCount; AverageExecution = Math.Round(report.AverageExecution, 2); MinExecution = report.MinExecution; MaxExecution = report.MaxExecution; ExceptionCount = report.ExceptionCount; MaxStoredRequests = report.MaxStoredRequests; }