public override IInterceptor CreateInterceptor(IProxyRequest request)
 {
     if (meter == null)
     {
         MetricName metricName = Utils.BuildName(request, Name, Absolute);
         MetricRegistry registry = request.Context.Kernel.Get<MetricRegistry>();
         meter = registry.Meter(metricName);
     }
     return new MeteringInterceptor(meter);
 }
Beispiel #2
0
 private void reportMeter(long timestamp, MetricName name, Meter meter)
 {
     report(timestamp,
            name,
            "count,mean_rate,m1_rate,m5_rate,m15_rate,rate_unit",
            meter.Count,
            convertRate(meter.MeanRate),
            convertRate(meter.OneMinuteRate),
            convertRate(meter.FiveMinuteRate),
            convertRate(meter.FifteenMinuteRate),
            "events/" + getRateUnit());
 }
 public MeteringInterceptor(Meter meter)
 {
     this.meter = meter;
 }
 public ExceptionMeteringInterceptor(Meter meter, Type exceptionType)
 {
     this.meter = meter;
     this.exceptionType = exceptionType;
 }
 private void printMeter(Meter meter)
 {
     output.WriteLine(string.Format("             count = {0}", meter.Count));
     output.WriteLine(string.Format("         mean rate = {0} events/{1}", convertRate(meter.MeanRate), getRateUnit()));
     output.WriteLine(string.Format("     1-minute rate = {0} events/{1}", convertRate(meter.OneMinuteRate), getRateUnit()));
     output.WriteLine(string.Format("     5-minute rate = {0} events/{1}", convertRate(meter.FiveMinuteRate), getRateUnit()));
     output.WriteLine(string.Format("    15-minute rate = {0} events/{1}", convertRate(meter.FifteenMinuteRate), getRateUnit()));
 }