Exemplo n.º 1
0
        public static dynamic Calculate(IEnumerable <TimeSpan> samples)
        {
            IEnumerable <TimeSpan> source = samples.DefaultIfEmpty(TimeSpan.Zero);

            ResponseTimeStatistics responseTimeStatistics = new ResponseTimeStatistics();

            responseTimeStatistics.Average     = TimeSpan.FromMilliseconds(source.Average((TimeSpan t) => t.TotalMilliseconds));
            responseTimeStatistics.SampleCount = source.Count <TimeSpan>();
            responseTimeStatistics.Maximum     = source.Max((TimeSpan t) => t);
            responseTimeStatistics.Minimum     = source.Min((TimeSpan t) => t);
            responseTimeStatistics.Sum         = TimeSpan.FromMilliseconds(source.Sum((TimeSpan t) => t.TotalMilliseconds));
            return(responseTimeStatistics);
        }
Exemplo n.º 2
0
 public virtual void CalculateStats()
 {
     if (BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Site9 == null)
     {
         BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Site9 = CallSite <Func <CallSite, object, ResponseTimeStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(ResponseTimeStatistics), typeof(BacklogSummary)));
     }
     this.ResponseTime = BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Site9.Target(BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Site9, ResponseTimeStatistics.Calculate(from r in this.Batches
                                                                                                                                                                                                    select r.ResponseTime));
     if (BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Sitea == null)
     {
         BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Sitea = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(BacklogSummary)));
     }
     this.ObjectCount = BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Sitea.Target(BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Sitea, SizeAndCountStatistics.Calculate(this.Batches.SelectMany((BacklogEstimateResults batch) => from b in batch.ContextBacklogs
                                                                                                                                                                                                                           select(int) b.Objects)));
     if (BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Siteb == null)
     {
         BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Siteb = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(BacklogSummary)));
     }
     this.LinkCount = BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Siteb.Target(BacklogSummary.< CalculateStats > o__SiteContainer8.< > p__Siteb, SizeAndCountStatistics.Calculate(this.Batches.SelectMany((BacklogEstimateResults batch) => from b in batch.ContextBacklogs
                                                                                                                                                                                                                         select(int) b.Links)));
 }
Exemplo n.º 3
0
 public virtual void CalculateStats()
 {
     if (OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site1 == null)
     {
         OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site1 = CallSite <Func <CallSite, object, ResponseTimeStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(ResponseTimeStatistics), typeof(OverallSyncSummaryBase)));
     }
     this.ResponseTime = OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site1.Target(OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site1, ResponseTimeStatistics.Calculate(this.Samples.SelectMany((IEnumerable <ISyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                            select r.Stats.ResponseTime)));
     if (OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site2 == null)
     {
         OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site2 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(OverallSyncSummaryBase)));
     }
     this.ObjectCount = OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site2.Target(OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site2, SizeAndCountStatistics.Calculate(this.Samples.SelectMany((IEnumerable <ISyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                           select r.Stats.ObjectCount)));
     if (OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site3 == null)
     {
         OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site3 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(OverallSyncSummaryBase)));
     }
     this.LinkCount = OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site3.Target(OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site3, SizeAndCountStatistics.Calculate(this.Samples.SelectMany((IEnumerable <ISyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                         select r.Stats.LinkCount)));
     if (OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site4 == null)
     {
         OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site4 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(OverallSyncSummaryBase)));
     }
     this.ObjectSize = OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site4.Target(OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site4, SizeAndCountStatistics.Calculate(this.Samples.SelectMany((IEnumerable <ISyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                          select(int) r.Stats.ObjectSize.Sum)));
     if (OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site5 == null)
     {
         OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site5 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(OverallSyncSummaryBase)));
     }
     this.LinkSize = OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site5.Target(OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site5, SizeAndCountStatistics.Calculate(this.Samples.SelectMany((IEnumerable <ISyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                        select(int) r.Stats.LinkSize.Sum)));
     if (OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site6 == null)
     {
         OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site6 = CallSite <Func <CallSite, object, ThroughputStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(ThroughputStatistics), typeof(OverallSyncSummaryBase)));
     }
     this.ObjectBytesPerSecond = OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site6.Target(OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site6, ThroughputStatistics.Calculate(this.Samples.SelectMany((IEnumerable <ISyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                                  select r.Stats.ObjectBytesPerSecond)));
     if (OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site7 == null)
     {
         OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site7 = CallSite <Func <CallSite, object, ThroughputStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(ThroughputStatistics), typeof(OverallSyncSummaryBase)));
     }
     this.LinkBytesPerSecond = OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site7.Target(OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site7, ThroughputStatistics.Calculate(this.Samples.SelectMany((IEnumerable <ISyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                                select r.Stats.LinkBytesPerSecond)));
     if (OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site8 == null)
     {
         OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site8 = CallSite <Func <CallSite, object, ThroughputStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(ThroughputStatistics), typeof(OverallSyncSummaryBase)));
     }
     this.ObjectsPerSecond = OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site8.Target(OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site8, ThroughputStatistics.Calculate(this.Samples.SelectMany((IEnumerable <ISyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                              select r.Stats.ObjectsPerSecond)));
     if (OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site9 == null)
     {
         OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site9 = CallSite <Func <CallSite, object, ThroughputStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(ThroughputStatistics), typeof(OverallSyncSummaryBase)));
     }
     this.LinksPerSecond = OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site9.Target(OverallSyncSummaryBase.< CalculateStats > o__SiteContainer0.< > p__Site9, ThroughputStatistics.Calculate(this.Samples.SelectMany((IEnumerable <ISyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                            select r.Stats.LinksPerSecond)));
 }