コード例 #1
0
        public IEnumerable <CounterValue> GetValuesBetween(DateTime startTime, DateTime endTime)
        {
            List <CounterValue> res = new List <CounterValue> ();

            lock (values)
            {
                if (values.Count == 0 || startTime > values[values.Count - 1].TimeStamp)
                {
                    return(res);
                }
                for (int n = 0; n < values.Count; n++)
                {
                    CounterValue val = values[n];
                    if (val.TimeStamp > endTime)
                    {
                        break;
                    }
                    if (val.TimeStamp >= startTime)
                    {
                        res.Add(val);
                    }
                }
            }
            return(res);
        }
コード例 #2
0
        internal int StoreValue(string message, TimerTraceList traces)
        {
            DateTime now = DateTime.Now;

            if (resolution.Ticks != 0)
            {
                if (now - lastValueTime < resolution)
                {
                    return(-1);
                }
            }
            var val = new CounterValue(count, totalCount, now, message, traces);

            if (storeValues)
            {
                values.Add(val);
            }
            if (handlers.Count > 0)
            {
                foreach (var h in handlers)
                {
                    h.ConsumeValue(this, val);
                }
            }
            return(values.Count - 1);
        }
コード例 #3
0
		public TimeLineViewWindow (Counter c, CounterValue value) : base(Gtk.WindowType.Toplevel)
		{
			this.Build ();
			this.mainCounter = c;
			this.mainValue = value;
			timeView.Scale = 300;
			
			Update ();
		}
コード例 #4
0
 internal void RemoveValue(int index)
 {
     lock (values) {
         values.RemoveAt(index);
         for (int n = index; n < values.Count; n++)
         {
             CounterValue val = values [n];
             val.UpdateValueIndex(n);
         }
     }
 }
コード例 #5
0
        internal int StoreValue(string?message, ITimeCounter?timer, IDictionary <string, object>?metadata)
        {
            DateTime now = DateTime.Now;

            if (resolution.Ticks != 0)
            {
                if (now - lastValueTime < resolution)
                {
                    return(-1);
                }
                lastValueTime = now;
            }
            var val = new CounterValue(count, totalCount, now, message, timer?.TraceList, metadata);

            if (StoreValues)
            {
                values.Add(val);
            }

            if (Handlers.Count > 0)
            {
                if (timer != null)
                {
                    foreach (var h in handlers)
                    {
                        var t = h.BeginTimer((TimerCounter)this, val);
                        if (t != null)
                        {
                            timer.AddHandlerTracker(t);
                        }
                    }
                }
                else
                {
                    foreach (var h in handlers)
                    {
                        h.ConsumeValue(this, val);
                    }
                }
            }
            return(values.Count - 1);
        }
コード例 #6
0
ファイル: Counter.cs プロジェクト: slagusev/monodevelop
        internal int StoreValue(string message, TimeCounter timer)
        {
            DateTime now = DateTime.Now;

            if (resolution.Ticks != 0)
            {
                if (now - lastValueTime < resolution)
                {
                    return(-1);
                }
            }
            var val = new CounterValue(count, totalCount, count - lastStoredCount, now, message, timer != null ? timer.TraceList : null);

            lastStoredCount = count;

            if (storeValues)
            {
                values.Add(val);
            }
            if (Handlers.Count > 0)
            {
                if (timer != null)
                {
                    foreach (var h in handlers)
                    {
                        var t = h.BeginTimer((TimerCounter)this, val);
                        if (t != null)
                        {
                            timer.AddHandlerTracker(t);
                        }
                    }
                }
                else
                {
                    foreach (var h in handlers)
                    {
                        h.ConsumeValue(this, val);
                    }
                }
            }
            return(values.Count - 1);
        }
コード例 #7
0
        public IEnumerable <CounterValue> GetValuesAfter(DateTime time)
        {
            List <CounterValue> res = new List <CounterValue> ();

            lock (values) {
                for (int n = values.Count - 1; n >= 0; n--)
                {
                    CounterValue val = values [n];
                    if (val.TimeStamp > time)
                    {
                        res.Add(val);
                    }
                    else
                    {
                        break;
                    }
                }
            }
            res.Reverse();
            return(res);
        }
コード例 #8
0
ファイル: Counter.cs プロジェクト: Kalnor/monodevelop
		internal int StoreValue (string message, TimerTraceList traces)
		{
			DateTime now = DateTime.Now;
			if (resolution.Ticks != 0) {
				if (now - lastValueTime < resolution)
					return -1;
			}
			var val = new CounterValue (count, totalCount, now, message, traces);
			if (storeValues)
				values.Add (val);
			if (handlers.Count > 0) {
				foreach (var h in handlers)
					h.ConsumeValue (this, val);
			}
			return values.Count - 1;
		}
コード例 #9
0
ファイル: TimeLineView.cs プロジェクト: llucenic/monodevelop
		public void SetMainCounter (Counter c, CounterValue value)
		{
			mainCounter = c;
			mainValue = value;
			data = null;
			Scale = scale;
			QueueDraw ();
		}
コード例 #10
0
 public virtual IDisposable?BeginTimer(TimerCounter counter, CounterValue value)
 {
     return(null);
 }
コード例 #11
0
 public virtual void ConsumeValue(Counter counter, CounterValue value)
 {
 }
コード例 #12
0
		public virtual IDisposable BeginTimer (TimerCounter counter, CounterValue value)
		{
			return null;
		}
コード例 #13
0
		public virtual void ConsumeValue (Counter counter, CounterValue value)
		{
		}
コード例 #14
0
ファイル: Counter.cs プロジェクト: brantwedel/monodevelop
		internal int StoreValue (string message, TimeCounter timer)
		{
			DateTime now = DateTime.Now;
			if (resolution.Ticks != 0) {
				if (now - lastValueTime < resolution)
					return -1;
			}
			var val = new CounterValue (count, totalCount, count - lastStoredCount, now, message, timer != null ? timer.TraceList : null);
			lastStoredCount = count;

			if (storeValues)
				values.Add (val);
			if (Handlers.Count > 0) {
				if (timer != null) {
					foreach (var h in handlers) {
						var t = h.BeginTimer ((TimerCounter)this, val);
						if (t != null)
							timer.AddHandlerTracker (t);
					}
				} else {
					foreach (var h in handlers)
						h.ConsumeValue (this, val);
				}
			}
			return values.Count - 1;
		}