示例#1
0
        public History(Inspector inspector)
        {
            this.history = new SortedDictionary<ulong, Dictionary<ulong, Counter>> ();

            this.inspector = inspector;
            this.inspector.Sample += OnInspectorSampleTick;
        }
示例#2
0
        private void OnInspectorSampleTick(object sender, Inspector.SampleEventArgs a)
        {
            Dictionary<ulong, Counter> counters;

            if (this.history.Count == 0) {
                counters = new Dictionary<ulong, Counter> ();

                foreach (var c in a.Counters)
                    counters.Add (c.Index, c);
            } else {
                counters = new Dictionary<ulong, Counter> (this.history [LastTimestamp]);

                foreach (var c in a.Counters)
                    counters [c.Index] = c;
            }

            lock (this.history) {
                this.history.Add (a.Timestamp, counters);
            }
        }
示例#3
0
 public InspectorEventListener(Inspector inspector)
 {
     Inspector = inspector;
 }