|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.yammer.metrics.core.MetricName
public class MetricName
A value class encapsulating a metric's owning class and name.
| Constructor Summary | |
|---|---|
MetricName(Class<?> klass,
String name)
Creates a new MetricName without a scope. |
|
MetricName(Class<?> klass,
String name,
String scope)
Creates a new MetricName without a scope. |
|
MetricName(String group,
String type,
String name)
Creates a new MetricName without a scope. |
|
MetricName(String group,
String type,
String name,
String scope)
Creates a new MetricName without a scope. |
|
MetricName(String group,
String type,
String name,
String scope,
String mBeanName)
Creates a new MetricName without a scope. |
|
| Method Summary | |
|---|---|
static String |
chooseGroup(String group,
Class<?> klass)
If the group is empty, use the package name of the given class. |
static String |
chooseName(String name,
Method method)
If name is empty, use the name of the given method. |
static String |
chooseType(String type,
Class<?> klass)
If the type is empty, use the simple name of the given class. |
int |
compareTo(MetricName o)
|
boolean |
equals(Object o)
|
String |
getGroup()
Returns the group to which the Metric belongs. |
String |
getMBeanName()
Returns the MBean name for the Metric identified by this metric name. |
String |
getName()
Returns the name of the Metric. |
String |
getScope()
Returns the scope of the Metric. |
String |
getType()
Returns the type to which the Metric belongs. |
int |
hashCode()
|
boolean |
hasScope()
Returns true if the Metric has a scope, false otherwise. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MetricName(Class<?> klass,
String name)
MetricName without a scope.
klass - the Class to which the Metric belongsname - the name of the Metric
public MetricName(String group,
String type,
String name)
MetricName without a scope.
group - the group to which the Metric belongstype - the type to which the Metric belongsname - the name of the Metric
public MetricName(Class<?> klass,
String name,
String scope)
MetricName without a scope.
klass - the Class to which the Metric belongsname - the name of the Metricscope - the scope of the Metric
public MetricName(String group,
String type,
String name,
String scope)
MetricName without a scope.
group - the group to which the Metric belongstype - the type to which the Metric belongsname - the name of the Metricscope - the scope of the Metric
public MetricName(String group,
String type,
String name,
String scope,
String mBeanName)
MetricName without a scope.
group - the group to which the Metric belongstype - the type to which the Metric belongsname - the name of the Metricscope - the scope of the MetricmBeanName - the 'ObjectName', represented as a string, to use when registering the
MBean.| Method Detail |
|---|
public String getGroup()
Metric belongs. For class-based metrics, this will be
the package name of the Class to which the Metric belongs.
Metric belongspublic String getType()
Metric belongs. For class-based metrics, this will be
the simple class name of the Class to which the Metric belongs.
Metric belongspublic String getName()
Metric.
Metricpublic String getScope()
Metric.
Metricpublic boolean hasScope()
true if the Metric has a scope, false otherwise.
true if the Metric has a scopepublic String getMBeanName()
Metric identified by this metric name.
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic int compareTo(MetricName o)
compareTo in interface Comparable<MetricName>
public static String chooseGroup(String group,
Class<?> klass)
group - The group to use by defaultklass - The class being tracked
public static String chooseType(String type,
Class<?> klass)
type - The type to use by defaultklass - The class being tracked
public static String chooseName(String name,
Method method)
name - The name to use by defaultmethod - The method being tracked
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||