private JmxMeter(Metered metric, ObjectName objectName, TimeUnit rateUnit) { super(objectName); this.metric = metric; this.rateFactor = rateUnit.toSeconds(1); this.rateUnit = "events/" + calculateRateUnit(rateUnit); }
public void registerMBean(Metric metric, ObjectName name) { AbstractBean mbean; if (metric instanceof Gauge) { mbean = new JmxGauge((Gauge<?>) metric, name); } else if (metric instanceof Counter) { mbean = new JmxCounter((Counter) metric, name); } else if (metric instanceof Histogram) { mbean = new JmxHistogram((Histogram) metric, name); } else if (metric instanceof Meter) { mbean = new JmxMeter((Meter) metric, name, TimeUnit.SECONDS); } else if (metric instanceof Timer) { mbean = new JmxTimer((Timer) metric, name, TimeUnit.SECONDS, TimeUnit.MICROSECONDS); } else { throw new IllegalArgumentException("Unknown metric type: " + metric.getClass()); } try { mBeanServer.registerMBean(mbean, name); } catch (Exception ignored) {} }
public void registerMBean(Metric metric, ObjectName name) { AbstractBean mbean; if (metric instanceof Gauge) { mbean = new JmxGauge((Gauge<?>) metric, name); } else if (metric instanceof Counter) { mbean = new JmxCounter((Counter) metric, name); } else if (metric instanceof Histogram) { mbean = new JmxHistogram((Histogram) metric, name); } else if (metric instanceof Meter) { mbean = new JmxMeter((Meter) metric, name, TimeUnit.SECONDS); } else if (metric instanceof Timer) { mbean = new JmxTimer((Timer) metric, name, TimeUnit.SECONDS, TimeUnit.MICROSECONDS); } else { throw new IllegalArgumentException("Unknown metric type: " + metric.getClass()); } try { mBeanServer.registerMBean(mbean, name); } catch (Exception ignored) {} }
public void registerMBean(Metric metric, ObjectName name) { AbstractBean mbean; if (metric instanceof Gauge) { mbean = new JmxGauge((Gauge<?>) metric, name); } else if (metric instanceof Counter) { mbean = new JmxCounter((Counter) metric, name); } else if (metric instanceof Histogram) { mbean = new JmxHistogram((Histogram) metric, name); } else if (metric instanceof Meter) { mbean = new JmxMeter((Meter) metric, name, TimeUnit.SECONDS); } else if (metric instanceof Timer) { mbean = new JmxTimer((Timer) metric, name, TimeUnit.SECONDS, TimeUnit.MICROSECONDS); } else { throw new IllegalArgumentException("Unknown metric type: " + metric.getClass()); } try { mBeanServer.registerMBean(mbean, name); } catch (Exception ignored) {} }
public void registerMBean(Metric metric, ObjectName name) { AbstractBean mbean; if (metric instanceof Gauge) { mbean = new JmxGauge((Gauge<?>) metric, name); } else if (metric instanceof Counter) { mbean = new JmxCounter((Counter) metric, name); } else if (metric instanceof Histogram) { mbean = new JmxHistogram((Histogram) metric, name); } else if (metric instanceof Meter) { mbean = new JmxMeter((Meter) metric, name, TimeUnit.SECONDS); } else if (metric instanceof Timer) { mbean = new JmxTimer((Timer) metric, name, TimeUnit.SECONDS, TimeUnit.MICROSECONDS); } else { throw new IllegalArgumentException("Unknown metric type: " + metric.getClass()); } try { mBeanServer.registerMBean(mbean, name); } catch (Exception ignored) {} }
private JmxMeter(Metered metric, ObjectName objectName, TimeUnit rateUnit) { super(objectName); this.metric = metric; this.rateFactor = rateUnit.toSeconds(1); this.rateUnit = "events/" + calculateRateUnit(rateUnit); }
private JmxMeter(Metered metric, ObjectName objectName, TimeUnit rateUnit) { super(objectName); this.metric = metric; this.rateFactor = rateUnit.toSeconds(1); this.rateUnit = "events/" + calculateRateUnit(rateUnit); }
private JmxMeter(Metered metric, ObjectName objectName, TimeUnit rateUnit) { super(objectName); this.metric = metric; this.rateFactor = rateUnit.toSeconds(1); this.rateUnit = "events/" + calculateRateUnit(rateUnit); }