Esempio n. 1
0
        public List <AccessTiming> getDomainAccessTimings()
        {
            List <AccessTiming> ret = new List <AccessTiming>();
            Dictionary <String, AccessTiming> timingMap = new Dictionary <String, AccessTiming>();

            if (null != AccessTimes)
            {
                foreach (AccessTiming accessTime in AccessTimes)
                {
                    AccessTiming timing = timingMap.ContainsKey(accessTime.URI.Host) ? timingMap[accessTime.URI.Host] : null;
                    if (null == timing)
                    {
                        timing = new AccessTiming(accessTime.URI, accessTime.TimingInTicks);
                        timingMap[accessTime.URI.Host] = timing;
                        ret.Add(timing);
                    }
                    else
                    {
                        timing.addTiming(accessTime);
                    }
                }
                ret.Reverse();
            }
            return(ret);
        }
Esempio n. 2
0
 protected void updateAccessTimings(Uri url, Boolean updateOldOnly = false)
 {
     if (null != AccessTimes)
     {
         AccessTiming lastEntry = 0 == AccessTimes.Count ? null : AccessTimes.Peek();
         if (null != lastEntry)
         {
             lastEntry.markTiming();
         }
         if (!updateOldOnly)
         {
             AccessTimes.Push(new AccessTiming(url));
         }
     }
 }
Esempio n. 3
0
 public void addTiming(AccessTiming accessTiming)
 {
     this.TimingInTicks += accessTiming.TimingInTicks;
 }
Esempio n. 4
0
 public List<AccessTiming> getDomainAccessTimings()
 {
     List<AccessTiming> ret = new List<AccessTiming>();
     Dictionary<String, AccessTiming> timingMap = new Dictionary<String, AccessTiming>();
     if (null != AccessTimes)
     {
         foreach (AccessTiming accessTime in AccessTimes)
         {
             AccessTiming timing = timingMap.ContainsKey(accessTime.URI.Host) ? timingMap[accessTime.URI.Host] : null;
             if (null == timing)
             {
                 timing = new AccessTiming(accessTime.URI, accessTime.TimingInTicks);
                 timingMap[accessTime.URI.Host] = timing;
                 ret.Add(timing);
             }
             else
             {
                 timing.addTiming(accessTime);
             }
         }
         ret.Reverse();
     }
     return ret;
 }
Esempio n. 5
0
 public void addTiming(AccessTiming accessTiming)
 {
     this.TimingInTicks += accessTiming.TimingInTicks;
 }