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);
        }
 internal CounterValue(int value, int totalCount, DateTime timestamp, string message, TimerTraceList traces)
 {
     this.value      = value;
     this.timestamp  = timestamp;
     this.totalCount = totalCount;
     this.message    = message;
     this.traces     = traces;
     this.threadId   = System.Threading.Thread.CurrentThread.ManagedThreadId;
 }
 internal CounterValue(int value, int totalCount, DateTime timestamp)
 {
     this.value      = value;
     this.timestamp  = timestamp;
     this.totalCount = totalCount;
     this.message    = null;
     traces          = null;
     threadId        = 0;
 }
예제 #4
0
 internal TimeCounter(TimerCounter counter)
 {
     this.counter = counter;
     if (counter.Enabled)
     {
         traceList = new TimerTraceList();
     }
     Begin();
 }
예제 #5
0
 internal CounterValue(int value, int totalCount, DateTime timestamp, string message, TimerTraceList traces, IDictionary <string, object> metadata)
 {
     Value         = value;
     TimeStamp     = timestamp;
     TotalCount    = totalCount;
     Message       = message;
     this.traces   = traces;
     ThreadId      = System.Threading.Thread.CurrentThread.ManagedThreadId;
     this.metadata = metadata;
 }
예제 #6
0
 internal CounterValue(int value, int totalCount, int change, DateTime timestamp, string message, TimerTraceList traces, IDictionary <string, string> metadata)
 {
     this.value      = value;
     this.timestamp  = timestamp;
     this.totalCount = totalCount;
     this.message    = message;
     this.traces     = traces;
     this.change     = change;
     this.threadId   = System.Threading.Thread.CurrentThread.ManagedThreadId;
     this.metadata   = metadata;
 }
예제 #7
0
 internal CounterValue(int value, int totalCount, DateTime timestamp, IDictionary <string, string> metadata)
 {
     this.value      = value;
     this.timestamp  = timestamp;
     this.totalCount = totalCount;
     this.message    = null;
     traces          = null;
     threadId        = 0;
     change          = 0;
     this.metadata   = metadata;
 }
예제 #8
0
        internal int StoreValue(string message, TimerTraceList traces)
        {
            DateTime now = DateTime.Now;

            if (resolution.Ticks != 0)
            {
                if (now - lastValueTime < resolution)
                {
                    return(-1);
                }
            }
            values.Add(new CounterValue(count, totalCount, now, message, traces));
            return(values.Count - 1);
        }
예제 #9
0
 internal TimeCounter(TimerCounter counter, T metadata, CancellationToken cancellationToken)
 {
     this.counter  = counter;
     this.metadata = metadata;
     if (counter.Enabled || metadata != null)
     {
         // Store metadata in the traces list. The corresponding CounterValue will get whatever
         // metadata is assigned there
         traceList          = new TimerTraceList();
         traceList.Metadata = metadata?.Properties;
     }
     this.cancellationToken = cancellationToken;
     Begin();
 }
예제 #10
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;
		}
예제 #11
0
		internal TimeCounter (TimerCounter counter)
		{
			this.counter = counter;
			traceList = new TimerTraceList ();
			Begin ();
		}
예제 #12
0
		internal CounterValue (int value, int totalCount, int change, DateTime timestamp, string message, TimerTraceList traces, IDictionary<string, string> metadata)
		{
			this.value = value;
			this.timestamp = timestamp;
			this.totalCount = totalCount;
			this.message = message;
			this.traces = traces;
			this.change = change;
			this.threadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
			this.metadata = metadata;
		}
		internal int StoreValue (string message, TimerTraceList traces)
		{
			DateTime now = DateTime.Now;
			if (resolution.Ticks != 0) {
				if (now - lastValueTime < resolution)
					return -1;
			}
			values.Add (new CounterValue (count, totalCount, now, message, traces));
			return values.Count - 1;
		}
예제 #14
0
 internal TimeCounter(TimerCounter counter)
 {
     this.counter = counter;
     traceList    = new TimerTraceList();
     Begin();
 }
예제 #15
0
		internal CounterValue (int value, int totalCount, DateTime timestamp)
		{
			this.value = value;
			this.timestamp = timestamp;
			this.totalCount = totalCount;
			this.message = null;
			traces = null;
			threadId = 0;
		}
예제 #16
0
		internal CounterValue (int value, int totalCount, DateTime timestamp, string message, TimerTraceList traces)
		{
			this.value = value;
			this.timestamp = timestamp;
			this.totalCount = totalCount;
			this.message = message;
			this.traces = traces;
			this.threadId = System.Threading.Thread.CurrentThread.ManagedThreadId;
		}
예제 #17
0
		internal CounterValue (int value, int totalCount, DateTime timestamp, IDictionary<string, string> metadata)
		{
			this.value = value;
			this.timestamp = timestamp;
			this.totalCount = totalCount;
			this.message = null;
			traces = null;
			threadId = 0;
			change = 0;
			this.metadata = metadata;
		}