コード例 #1
0
        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());
            }
        }
コード例 #2
0
 internal void ReportSpan(Span span)
 {
     if (span.IsRootSpan && !span.ContainsIgnore)
     {
         var summary = new SpanSummary(span);
         if (IsOverThreshold(summary))
         {
             _queue.Add(summary);
         }
     }
 }
コード例 #3
0
        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);
            }
        }