This project has retired. For details please refer to its Attic page.
MethodMetricsFactory (Lens 2.1.0-beta-incubating API)

org.apache.lens.server.api.metrics
Class MethodMetricsFactory

java.lang.Object
  extended by org.apache.lens.server.api.metrics.MethodMetricsFactory

public class MethodMetricsFactory
extends Object

Factory for creating MethodMetrics objects on demand.


Field Summary
static org.apache.log4j.Logger LOG
           
 
Constructor Summary
MethodMetricsFactory(com.codahale.metrics.MetricRegistry metricRegistry)
           
 
Method Summary
 void clear()
          Remove all meters/timers/...
static MethodMetricsContext createMethodGauge(org.apache.hadoop.conf.Configuration conf, boolean appendToStackName, String gaugeSuffix)
          Get query metric gauge name.
 MethodMetrics get(org.glassfish.jersey.server.model.ResourceMethod method, org.glassfish.jersey.server.ContainerRequest containerRequest)
          This is a factory method for getting a MethodMetrics instance.
 MethodMetrics get(String name)
          Returns MethodMetrics object corresponding to the given name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
Constructor Detail

MethodMetricsFactory

public MethodMetricsFactory(@NonNull
                            com.codahale.metrics.MetricRegistry metricRegistry)
Method Detail

get

public MethodMetrics get(@NonNull
                         org.glassfish.jersey.server.model.ResourceMethod method,
                         @NonNull
                         org.glassfish.jersey.server.ContainerRequest containerRequest)
This is a factory method for getting a MethodMetrics instance. First a unique name is determined for the arguments and then function with same name is called with that unique name.

Parameters:
method -
containerRequest -
Returns:
See Also:
get(String), getUniqueName(org.glassfish.jersey.server.model.ResourceMethod, org.glassfish.jersey.server.ContainerRequest)

get

public MethodMetrics get(@NonNull
                         String name)
Returns MethodMetrics object corresponding to the given name. If doesn't exist yet, one will be created.

Parameters:
name -
Returns:

clear

public void clear()
Remove all meters/timers/... created when MethodMetrics objects were constructed using this factory.


createMethodGauge

public static MethodMetricsContext createMethodGauge(@NonNull
                                                     org.apache.hadoop.conf.Configuration conf,
                                                     boolean appendToStackName,
                                                     String gaugeSuffix)
Get query metric gauge name.

Parameters:
conf -
appendToStackName -
gaugeSuffix -
Returns:


Copyright © 2014–2015 Apache Software Foundation. All rights reserved.