public virtual void GetMetrics(MetricsCollector collector, bool all) { collector.AddRecord("foo").SetContext("foocontext").AddCounter(Interns.Info("C1", "C1 desc"), 1).EndRecord().AddRecord("bar").SetContext("barcontext").AddGauge(Interns.Info ("G1", "G1 desc"), 1); registry.Snapshot(collector.AddRecord(registry.Info()), all); }
public static MetricsRecordBuilder MockMetricsRecordBuilder() { MetricsCollector mc = Org.Mockito.Mockito.Mock <MetricsCollector>(); MetricsRecordBuilder rb = Org.Mockito.Mockito.Mock <MetricsRecordBuilder>(new _Answer_66 (mc)); Org.Mockito.Mockito.When(mc.AddRecord(AnyString())).ThenReturn(rb); Org.Mockito.Mockito.When(mc.AddRecord(AnyInfo())).ThenReturn(rb); return(rb); }
public virtual void GetMetrics(MetricsCollector collector, bool all) { lock (this) { //Container goes through registered -> finished -> unregistered. if (unregister) { return; } if (finished || flushOnPeriod) { registry.Snapshot(collector.AddRecord(registry.Info()), all); } if (finished) { this.unregister = true; } else { if (flushOnPeriod) { flushOnPeriod = false; ScheduleTimerTaskIfRequired(); } } } }
public virtual void GetMetrics(MetricsCollector collector, bool all) { lock (this) { registry.Snapshot(collector.AddRecord(registry.Info()), all); } }
//generate a new key per each call public virtual void GetMetrics(MetricsCollector collector, bool all) { MetricsRecordBuilder rb = collector.AddRecord("purgablesource").SetContext("test" ); this.lastKeyName = "key" + this.nextKey++; rb.AddGauge(Interns.Info(this.lastKeyName, "desc"), 1); }
public virtual void GetMetrics(MetricsCollector collector, bool all) { MetricsRecordBuilder rb = collector.AddRecord(JvmMetricsInfo.JvmMetrics).SetContext ("jvm").Tag(MsInfo.ProcessName, processName).Tag(MsInfo.SessionId, sessionId); GetMemoryUsage(rb); GetGcUsage(rb); GetThreadUsage(rb); GetEventCounters(rb); }
public virtual void GetMetrics(MetricsCollector builder, bool all) { lock (this) { MetricsRecordBuilder rb = builder.AddRecord(MsName).AddGauge(MsInfo.NumActiveSources , sources.Count).AddGauge(MsInfo.NumAllSources, allSources.Count).AddGauge(MsInfo .NumActiveSinks, sinks.Count).AddGauge(MsInfo.NumAllSinks, allSinks.Count); foreach (MetricsSinkAdapter sa in sinks.Values) { sa.Snapshot(rb, all); } registry.Snapshot(rb, all); } }
public virtual void GetMetrics(MetricsCollector collector, bool all) { StartupProgressView prog = startupProgress.CreateView(); MetricsRecordBuilder builder = collector.AddRecord(StartupProgressMetricsInfo); builder.AddCounter(Interns.Info("ElapsedTime", "overall elapsed time"), prog.GetElapsedTime ()); builder.AddGauge(Interns.Info("PercentComplete", "overall percent complete"), prog .GetPercentComplete()); foreach (Phase phase in prog.GetPhases()) { AddCounter(builder, phase, "Count", " count", prog.GetCount(phase)); AddCounter(builder, phase, "ElapsedTime", " elapsed time", prog.GetElapsedTime(phase )); AddCounter(builder, phase, "Total", " total", prog.GetTotal(phase)); AddGauge(builder, phase, "PercentComplete", " percent complete", prog.GetPercentComplete (phase)); } }
public virtual void GetMetrics(MetricsCollector collector, bool all) { collector.AddRecord("foo"); }
public void GetMetrics(MetricsCollector builder, bool all) { this._enclosing.registry.Snapshot(builder.AddRecord(this._enclosing.registry.Info ()), all); }
public virtual void GetMetrics(MetricsCollector collector, bool all) { UpdateRunningTime(); registry.Snapshot(collector.AddRecord(registry.Info()), all); }