private void OnCounterUpdate(CounterEventArgs args) { if (!_counterValues.ContainsKey(args.Provider)) { _counterValues.Add(args.Provider, new Dictionary <string, CounterEventArgs>()); } _counterValues[args.Provider][args.Counter] = args; // TODO: Can we queue up a change and only send after couple of seconds? _hubContext.Clients.Group(HomeDashboardHub.GROUP_NAME_CLR_COUNTERS).SendAsync("clrCounterUpdate", _counterValues); // if (!_counterValues[args.Provider].ContainsKey(args.Counter)) // { // _counterValues // } //_counterValues[args.Provider] //_countersValue.Add((args.DisplayName, args.Value)); // we "know" that the last CLR counter is "assembly-count" // NOTE: this is a flaky way to detect the last counter event: // -> could get the list of counters the first time they are received // if (args.Counter == "assembly-count") // { // SaveLine(); // _countersValue.Clear(); // } }
/// <summary> /// Liefert den Fortschritt an den Fortschrittsbalken /// </summary> /// <param name="sender"></param> /// <param name="e"></param> internal static void SiteCounter(Object sender, CounterEventArgs e) { if (BoolIDS & BoolIntegrata & BoolTechData) { bw.ReportProgress((int)((double)Counter++ / (double)NumberOfCourses * 100)); } else { bw.ReportProgress((int)((double)Counter++ / (double)iEstimatedValue * 100)); } }
/// <summary> /// Update performance counters /// </summary> /// <param name="args"><see cref="CounterEventArgs"/></param> private void OnCounterUpdate(CounterEventArgs args) { if (!_performanceCounters.ContainsKey(args.DisplayName)) { _performanceCounters.Add(args.DisplayName, args.Value); } else { _performanceCounters[args.DisplayName] = args.Value; } }
private static void OnCountValueChanged(Counter c, CounterEventArgs arg) => Console.WriteLine($"Counter changed: Value = {arg.Value}");
public void OnCountValueChanged(Counter c, CounterEventArgs arg) { Console.Out.WriteLine("CounterObserver " + name + ": Counter changed: Value = " + c.Count); }
static void ValueChanged(Counter c, CounterEventArgs arg) { Console.Out.WriteLine(c.Count); }
public void PrintMessage(object sender, CounterEventArgs e) { Console.WriteLine($"{Name}: {e.Message}"); }