001package org.avaje.metric; 002 003/** 004 * Bean holding timing metric name and collection count. 005 * <p> 006 * This is simple data bean intended to be passed to a front end, converted to JSON etc. 007 * </p> 008 */ 009public class TimingMetricInfo { 010 011 final String name; 012 013 final int collectionCount; 014 015 /** 016 * Construct with metric name and collection count. 017 */ 018 public TimingMetricInfo(String name, int collectionCount) { 019 this.name = name; 020 this.collectionCount = collectionCount; 021 } 022 023 /** 024 * Return the metric name. 025 */ 026 public String getName() { 027 return name; 028 } 029 030 /** 031 * Return the current collection count for this metric. 032 * <p> 033 * This is the number of remaining requests that will have timing collected. 034 * </p> 035 */ 036 public int getCollectionCount() { 037 return collectionCount; 038 } 039}