예제 #1
0
 public QueryMetrics(
     BackendMetrics backendMetrics,
     IndexUtilizationInfo indexUtilizationInfo,
     ClientSideMetrics clientSideMetrics)
 {
     this.BackendMetrics       = backendMetrics ?? throw new ArgumentNullException(nameof(backendMetrics));
     this.IndexUtilizationInfo = indexUtilizationInfo ?? throw new ArgumentNullException(nameof(indexUtilizationInfo));
     this.ClientSideMetrics    = clientSideMetrics ?? throw new ArgumentNullException(nameof(clientSideMetrics));
 }
        private void WriteClientSideMetrics(ClientSideMetrics clientSideMetrics)
        {
            this.WriteBeforeClientSideMetrics();

            this.WriteRetries(clientSideMetrics.Retries);
            this.WriteRequestCharge(clientSideMetrics.RequestCharge);
            this.WritePartitionExecutionTimeline(clientSideMetrics);

            this.WriteAfterClientSideMetrics();
        }
예제 #3
0
 public QueryMetrics(
     string deliminatedString,
     IndexUtilizationInfo indexUtilizationInfo,
     ClientSideMetrics clientSideMetrics)
     : this(!String.IsNullOrWhiteSpace(deliminatedString) &&
            BackendMetricsParser.TryParse(deliminatedString, out BackendMetrics backendMetrics)
         ? backendMetrics
         : BackendMetrics.Empty, indexUtilizationInfo, clientSideMetrics)
 {
 }
        private void WritePartitionExecutionTimeline(ClientSideMetrics clientSideMetrics)
        {
            this.WriteBeforePartitionExecutionTimeline();

            foreach (FetchExecutionRange fetchExecutionRange in clientSideMetrics.FetchExecutionRanges.OrderBy(fetchExecutionRange => fetchExecutionRange.StartTime))
            {
                this.WriteFetchExecutionRange(fetchExecutionRange);
            }

            this.WriteAfterPartitionExecutionTimeline();
        }
예제 #5
0
            public Accumulator Accumulate(ClientSideMetrics clientSideMetrics)
            {
                if (clientSideMetrics == null)
                {
                    throw new ArgumentNullException(nameof(clientSideMetrics));
                }

                return(new Accumulator(
                           retries: this.Retries + clientSideMetrics.Retries,
                           requestCharge: this.RequestCharge + clientSideMetrics.RequestCharge,
                           fetchExecutionRanges: (this.FetchExecutionRanges ?? Enumerable.Empty <FetchExecutionRange>()).Concat(clientSideMetrics.FetchExecutionRanges)));
            }
예제 #6
0
        private void WriteSchedulingMetrics(ClientSideMetrics clientSideMetrics)
        {
            this.WriteBeforeSchedulingMetrics();

            foreach (Tuple <string, SchedulingTimeSpan> partitionSchedulingTimeSpan in clientSideMetrics.PartitionSchedulingTimeSpans.OrderBy(x => x.Item2.ResponseTime))
            {
                string             partitionId        = partitionSchedulingTimeSpan.Item1;
                SchedulingTimeSpan schedulingTimeSpan = partitionSchedulingTimeSpan.Item2;

                this.WritePartitionSchedulingTimeSpan(partitionId, schedulingTimeSpan);
            }

            this.WriteAfterSchedulingMetrics();
        }