Examples of MetricName


Examples of com.yammer.metrics.core.MetricName

   * @param metricName name of the metric.
   * @param value to be used for histogram.
   */
  public void histogram(Class<?> scope, String metricName, long value) {
    if (!histograms.containsKey(metricName)) {
      MetricName name = getMetricName(scope, metricName);
      histograms.put(metricName, Metrics.newHistogram(name));
    }
    histograms.get(metricName).update(value);
  }
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

     * @param jsonMetric A JSONMetric to make a Metric from
     * @return A Metric equivalent to the given JSONMetric
     */
    protected Metric createMetric(JSONMetric jsonMetric) {
        // Split the name from the JSON on dots for the metric group/type/name
        MetricName metricName;
        ArrayList<String> parts = new ArrayList<String>(Arrays.asList(jsonMetric.getName().split("\\.")));
        if (parts.size() >= 3) {
            metricName = new MetricName(parts.remove(0), parts.remove(0), StringUtils.join(parts, "."));
        } else {
            metricName = new MetricName(jsonMetric.getName(), "", "");
        }

        Class<?> metricType = jsonMetric.getMetricClass();
        if (metricType == Gauge.class) {
            return Metrics.newGauge(metricName, new GaugeMetricImpl());
View Full Code Here

Examples of com.yammer.metrics.core.MetricName

     * @param jsonMetric A JSONMetric to make a Metric from
     * @return A Metric equivalent to the given JSONMetric
     */
    protected Metric createMetric(JSONMetric jsonMetric) {
        // Split the name from the JSON on dots for the metric group/type/name
        MetricName metricName;
        ArrayList<String> parts = new ArrayList<String>(Arrays.asList(jsonMetric.getName().split("\\.")));
        if (parts.size() >= 3)
            metricName = new MetricName(parts.remove(0), parts.remove(0), StringUtils.join(parts, "."));
        else
            metricName = new MetricName(jsonMetric.getName(), "", "");

        Class<?> metricType = jsonMetric.getMetricClass();
        if (metricType == Gauge.class) {
            return Metrics.newGauge(metricName, new GaugeMetricImpl());
        } else if (metricType == Counter.class) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.