Example #1
0
        public static dynamic Calculate(IEnumerable <int> samples)
        {
            IEnumerable <int> source = samples.DefaultIfEmpty <int>();

            SizeAndCountStatistics sizeAndCountStatistics = new SizeAndCountStatistics();

            sizeAndCountStatistics.Average     = source.Average((int t) => t);
            sizeAndCountStatistics.Maximum     = source.Max((int t) => t);
            sizeAndCountStatistics.Minimum     = source.Min((int t) => t);
            sizeAndCountStatistics.Sum         = (long)source.Sum((int t) => t);
            sizeAndCountStatistics.SampleCount = source.Count <int>();
            return(sizeAndCountStatistics);
        }
Example #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)));
 }
 public void Calculate(DeltaSyncBatchResults deltaSyncBatch)
 {
     base.Calculate(deltaSyncBatch.Objects, deltaSyncBatch.Links);
     this.ContextCount = deltaSyncBatch.Contexts.Count <DirectoryContext>();
     if (DeltaSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1 == null)
     {
         DeltaSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(DeltaSyncBatchStatistics)));
     }
     this.ContextSize = DeltaSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1.Target(DeltaSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1, SizeAndCountStatistics.Calculate(from o in deltaSyncBatch.Contexts
                                                                                                                                                                                                             select SyncBatchStatisticsBase.SerializedSize(o)));
     this.ContextsPerSecond     = (double)this.ContextCount / base.ResponseTime.TotalSeconds;
     this.ContextBytesPerSecond = (double)this.ContextSize.Sum / base.ResponseTime.TotalSeconds;
 }
Example #4
0
 public void Calculate(TenantSyncBatchResults tenantSyncBatch)
 {
     base.Calculate(tenantSyncBatch.Objects, tenantSyncBatch.Links);
     this.ErrorCount = tenantSyncBatch.Errors.Count <DirectoryObjectError>();
     if (TenantSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1 == null)
     {
         TenantSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(TenantSyncBatchStatistics)));
     }
     this.ErrorSize = TenantSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1.Target(TenantSyncBatchStatistics.< Calculate > o__SiteContainer0.< > p__Site1, SizeAndCountStatistics.Calculate(from o in tenantSyncBatch.Errors
                                                                                                                                                                                                             select SyncBatchStatisticsBase.SerializedSize(o)));
     this.ErrorsPerSecond     = (double)this.ErrorCount / base.ResponseTime.TotalSeconds;
     this.ErrorBytesPerSecond = (double)this.ErrorSize.Sum / base.ResponseTime.TotalSeconds;
 }
Example #5
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)));
 }
 public virtual void Calculate(IEnumerable <DirectoryObject> Objects, IEnumerable <DirectoryLink> Links)
 {
     this.ObjectCount = Objects.Count <DirectoryObject>();
     this.LinkCount   = Links.Count <DirectoryLink>();
     if (SyncBatchStatisticsBase.< Calculate > o__SiteContainer0.< > p__Site1 == null)
     {
         SyncBatchStatisticsBase.< Calculate > o__SiteContainer0.< > p__Site1 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(SyncBatchStatisticsBase)));
     }
     this.ObjectSize = SyncBatchStatisticsBase.< Calculate > o__SiteContainer0.< > p__Site1.Target(SyncBatchStatisticsBase.< Calculate > o__SiteContainer0.< > p__Site1, SizeAndCountStatistics.Calculate(from o in Objects
                                                                                                                                                                                                          select SyncBatchStatisticsBase.SerializedSize(o)));
     this.ObjectsPerSecond     = (double)this.ObjectCount / this.ResponseTime.TotalSeconds;
     this.ObjectBytesPerSecond = (double)this.ObjectSize.Sum / this.ResponseTime.TotalSeconds;
     if (SyncBatchStatisticsBase.< Calculate > o__SiteContainer0.< > p__Site2 == null)
     {
         SyncBatchStatisticsBase.< Calculate > o__SiteContainer0.< > p__Site2 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(SyncBatchStatisticsBase)));
     }
     this.LinkSize = SyncBatchStatisticsBase.< Calculate > o__SiteContainer0.< > p__Site2.Target(SyncBatchStatisticsBase.< Calculate > o__SiteContainer0.< > p__Site2, SizeAndCountStatistics.Calculate(from o in Links
                                                                                                                                                                                                        select SyncBatchStatisticsBase.SerializedSize(o)));
     this.LinksPerSecond     = (double)this.LinkCount / this.ResponseTime.TotalSeconds;
     this.LinkBytesPerSecond = (double)this.LinkSize.Sum / this.ResponseTime.TotalSeconds;
     this.ObjectTypes        = (from o in Objects
                                group o by o.GetType().Name).ToDictionary((IGrouping <string, DirectoryObject> g) => g.Key, (IGrouping <string, DirectoryObject> g) => g.Count <DirectoryObject>());
 }
Example #7
0
        public override void CalculateStats()
        {
            base.CalculateStats();
            List <IEnumerable <DeltaSyncBatchResults> > source = this.Samples as List <IEnumerable <DeltaSyncBatchResults> >;

            if (DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site1 == null)
            {
                DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site1 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(DeltaSyncSummary)));
            }
            this.ContextCount = DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site1.Target(DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site1, SizeAndCountStatistics.Calculate(source.SelectMany((IEnumerable <DeltaSyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                 select(r.Stats as DeltaSyncBatchStatistics).ContextCount)));
            if (DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site2 == null)
            {
                DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site2 = CallSite <Func <CallSite, object, SizeAndCountStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(SizeAndCountStatistics), typeof(DeltaSyncSummary)));
            }
            this.ContextSize = DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site2.Target(DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site2, SizeAndCountStatistics.Calculate(source.SelectMany((IEnumerable <DeltaSyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                select(int)(r.Stats as DeltaSyncBatchStatistics).ContextSize.Sum)));
            if (DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site3 == null)
            {
                DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site3 = CallSite <Func <CallSite, object, ThroughputStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(ThroughputStatistics), typeof(DeltaSyncSummary)));
            }
            this.ContextBytesPerSecond = DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site3.Target(DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site3, ThroughputStatistics.Calculate(source.SelectMany((IEnumerable <DeltaSyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                        select(r.Stats as DeltaSyncBatchStatistics).ContextBytesPerSecond)));
            if (DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site4 == null)
            {
                DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site4 = CallSite <Func <CallSite, object, ThroughputStatistics> > .Create(Binder.Convert(CSharpBinderFlags.None, typeof(ThroughputStatistics), typeof(DeltaSyncSummary)));
            }
            this.ContextsPerSecond = DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site4.Target(DeltaSyncSummary.< CalculateStats > o__SiteContainer0.< > p__Site4, ThroughputStatistics.Calculate(source.SelectMany((IEnumerable <DeltaSyncBatchResults> iter) => from r in iter
                                                                                                                                                                                                                                    select(r.Stats as DeltaSyncBatchStatistics).ContextsPerSecond)));
        }