private static void AddSummryToSet(ICollection <SpanSummary> summaries, SpanSummary summary, ref int summaryCount, int maxSampleSize) { summaries.Add(summary); summaryCount += 1; while (summaries.Count > maxSampleSize) { summaries.Remove(summaries.First()); } }
internal void ReportSpan(Span span) { if (span.IsRootSpan && !span.ContainsIgnore) { var summary = new SpanSummary(span); if (IsOverThreshold(summary)) { _queue.Add(summary); } } }
private bool IsOverThreshold(SpanSummary summary) { switch (summary.ServiceType) { case CouchbaseTags.ServiceKv: return(summary.TotalDuration > KvThreshold); case CouchbaseTags.ServiceView: return(summary.TotalDuration > ViewThreshold); case CouchbaseTags.ServiceQuery: return(summary.TotalDuration > N1qlThreshold); case CouchbaseTags.ServiceSearch: return(summary.TotalDuration > SearchThreshold); case CouchbaseTags.ServiceAnalytics: return(summary.TotalDuration > AnalyticsThreshold); default: return(false); } }