Codota Logo
Metrics.newTimer
Code IndexAdd Codota to your IDE (free)

How to use
newTimer
method
in
com.yammer.metrics.Metrics

Best Java code snippets using com.yammer.metrics.Metrics.newTimer (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
BufferedReader b =
  • Codota IconInputStream in;new BufferedReader(new InputStreamReader(in))
  • Codota IconReader in;new BufferedReader(in)
  • Codota IconFile file;new BufferedReader(new FileReader(file))
  • Smart code suggestions by Codota
}
origin: apache/incubator-pinot

/**
 *
 * Return an existing timer if
 *  (a) A timer already exist with the same metric name.
 * Otherwise, creates a new timer and registers
 *
 * @param registry MetricsRegistry
 * @param name metric name
 * @param durationUnit TimeUnit for duration
 * @param rateUnit TimeUnit for rate determination
 * @return Timer
 */
public static Timer newTimer(MetricsRegistry registry, MetricName name, TimeUnit durationUnit, TimeUnit rateUnit) {
 if (registry != null) {
  return registry.newTimer(name, durationUnit, rateUnit);
 } else {
  return Metrics.newTimer(name, durationUnit, rateUnit);
 }
}
origin: apache/usergrid

Timer timer = Metrics.newTimer( BcryptCommandTest.class, "hashtimer" );
origin: urbanairship/statshtable

SHTimerMetric(TimeUnit durationUnit, TimeUnit rateUnit) {
  t = Metrics.newTimer(this.getClass(),"Timer",durationUnit, rateUnit);
}
origin: sematext/ActionGenerator

/**
 * Constructor.
 * 
 * @param clazz
 *          class for calculating metrics
 */
public BasicMetrics(Class<?> clazz) {
 sinkRequests = Metrics.newMeter(clazz, "sinkRequests", "sinkRequests", TimeUnit.SECONDS);
 sinkTimer = Metrics.newTimer(clazz, "responses", TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
 requestsTimer = Metrics.newTimer(clazz, "requests", TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
}
origin: com.ning/metrics.eventtracker-http

public HttpSender(final String collectorHost, final int collectorPort, final EventType eventType,
         final long httpMaxWaitTimeInMillis, final long httpMaxKeepAliveInMillis, final int httpWorkersPoolSize)
{
  this(new ThreadSafeAsyncHttpClient(collectorHost, collectorPort, eventType, httpMaxKeepAliveInMillis),
     httpMaxWaitTimeInMillis,
     Metrics.newTimer(HttpSender.class, collectorHost.replace(":", "_"), TimeUnit.MILLISECONDS, TimeUnit.SECONDS),
     httpWorkersPoolSize);
}
origin: pierre/meteo

public AMQSession(final AMQPublisherConfig config, final AMQConnection connection, final String topic,
         final AtomicBoolean useBytesMessage)
{
  this.config = config;
  this.connection = connection;
  this.topic = topic;
  this.useBytesMessage = useBytesMessage;
  timer = Metrics.newTimer(AMQSession.class, topic, TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
  reinit();
}
origin: NGDATA/hbase-indexer

public RowBasedIndexer(String indexerName, IndexerConf conf, String tableName, ResultToSolrMapper mapper,
            Connection tablePool,
            Sharder sharder, SolrInputDocumentWriter solrWriter) {
  super(indexerName, conf, tableName, mapper, sharder, solrWriter);
  this.tablePool = tablePool;
  rowReadTimer = Metrics.newTimer(metricName(getClass(), "Row read timer", indexerName), TimeUnit.MILLISECONDS,
      TimeUnit.SECONDS);
}
origin: com.senseidb/sensei-core

public ActivityPrimitivesStorage(String fieldName, String indexDir) {
 this.fieldName = fieldName;
 this.indexDir = indexDir;
 timer = Metrics.newTimer(new MetricName(MetricsConstants.Domain, "timer",
   "initIntActivities-time-" + fieldName.replaceAll(":", "-"), "initIntActivities"),
  TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
}
origin: com.senseidb/sensei-core

public CompositeActivityStorage(String indexDir) {
 this.indexDir = indexDir;
 timer = Metrics.newTimer(new MetricName(MetricsConstants.Domain, "timer",
   "initCompositeActivities-time", "CompositeActivityStorage"), TimeUnit.MILLISECONDS,
  TimeUnit.SECONDS);
}
origin: com.sematext.ag/ag-player

/**
 * Constructor.
 * 
 * @param clazz
 *          class for calculating metrics
 */
public BasicMetrics(Class<?> clazz) {
 requests = Metrics.newMeter(clazz, "requests", "requests", TimeUnit.SECONDS);
 timer = Metrics.newTimer(clazz, "responses", TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
}
origin: rackerlabs/atom-hopper

private TimerContext startTimer(String name) {
  if (enableTimers) {
    final com.yammer.metrics.core.Timer timer = Metrics.newTimer(getClass(), name, TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
    TimerContext context = timer.time();
    return context;
  } else {
    return null;
  }
}
origin: com.ngdata/hbase-indexer-engine

public RowBasedIndexer(String indexerName, IndexerConf conf, String tableName, ResultToSolrMapper mapper,
            Connection tablePool,
            Sharder sharder, SolrInputDocumentWriter solrWriter) {
  super(indexerName, conf, tableName, mapper, sharder, solrWriter);
  this.tablePool = tablePool;
  rowReadTimer = Metrics.newTimer(metricName(getClass(), "Row read timer", indexerName), TimeUnit.MILLISECONDS,
      TimeUnit.SECONDS);
}
origin: com.senseidb/sensei-core

private Timer buildTimer(int partition) {
 MetricName partitionSearchMetricName = new MetricName(MetricsConstants.Domain, "timer",
   "partition-time-" + partition, "partition");
 return Metrics.newTimer(partitionSearchMetricName, TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
}
origin: rackerlabs/atom-hopper

private TimerContext startTimer(String name) {
  if (enableTimers) {
    final com.yammer.metrics.core.Timer timer = Metrics.newTimer( getClass(), name, TimeUnit.MILLISECONDS,
                                   TimeUnit.SECONDS );
    TimerContext context = timer.time();
    return context;
  } else {
    return null;
  }
}
origin: NGDATA/hbase-indexer

Indexer(String indexerName, IndexerConf conf, String tableName, ResultToSolrMapper mapper, Sharder sharder,
    SolrInputDocumentWriter solrWriter) {
  this.indexerName = indexerName;
  this.conf = conf;
  this.tableName = tableName;
  this.mapper = mapper;
  try {
    this.uniqueKeyFormatter = conf.getUniqueKeyFormatterClass().newInstance();
  } catch (Exception e) {
    throw new RuntimeException("Problem instantiating the UniqueKeyFormatter.", e);
  }
  ConfigureUtil.configure(uniqueKeyFormatter, conf.getGlobalParams());
  this.sharder = sharder;
  this.solrWriter = solrWriter;
  this.indexingTimer = Metrics.newTimer(metricName(getClass(),
      "Index update calculation timer", indexerName),
      TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
}
origin: com.ngdata/hbase-indexer-engine

Indexer(String indexerName, IndexerConf conf, String tableName, ResultToSolrMapper mapper, Sharder sharder,
    SolrInputDocumentWriter solrWriter) {
  this.indexerName = indexerName;
  this.conf = conf;
  this.tableName = tableName;
  this.mapper = mapper;
  try {
    this.uniqueKeyFormatter = conf.getUniqueKeyFormatterClass().newInstance();
  } catch (Exception e) {
    throw new RuntimeException("Problem instantiating the UniqueKeyFormatter.", e);
  }
  ConfigureUtil.configure(uniqueKeyFormatter, conf.getGlobalParams());
  this.sharder = sharder;
  this.solrWriter = solrWriter;
  this.indexingTimer = Metrics.newTimer(metricName(getClass(),
      "Index update calculation timer", indexerName),
      TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
}
origin: com.facebook.presto.cassandra/cassandra-server

/**
 * Create LatencyMetrics with given group, type, prefix to append to each metric name, and scope.
 *
 * @param factory MetricName factory to use
 * @param namePrefix Prefix to append to each metric name
 */
public LatencyMetrics(MetricNameFactory factory, String namePrefix)
{
  this.factory = factory;
  this.namePrefix = namePrefix;
  latency = Metrics.newTimer(factory.createMetricName(namePrefix + "Latency"), TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
  totalLatency = Metrics.newCounter(factory.createMetricName(namePrefix + "TotalLatency"));
}

origin: wavefrontHQ/java

/**
 * Create new instance
 *
 * @param proxyAPI          handles interaction with Wavefront servers as well as queueing.
 * @param handle            handle (usually port number), that serves as an identifier for the metrics pipeline.
 * @param threadId          thread number.
 * @param rateLimiter       rate limiter to control outbound point rate.
 * @param pushFlushInterval interval between flushes.
 * @param itemsPerBatch     max points per flush.
 * @param memoryBufferLimit max points in task's memory buffer before queueing.
 *
 */
ReportSourceTagSenderTask(ForceQueueEnabledAgentAPI proxyAPI, String handle, int threadId,
             AtomicInteger pushFlushInterval,
             @Nullable RecyclableRateLimiter rateLimiter,
             @Nullable AtomicInteger itemsPerBatch,
             @Nullable AtomicInteger memoryBufferLimit) {
 super("sourceTags", handle, threadId, itemsPerBatch, memoryBufferLimit);
 this.proxyAPI = proxyAPI;
 this.batchSendTime = Metrics.newTimer(new MetricName("api.sourceTags." + handle, "", "duration"),
   TimeUnit.MILLISECONDS, TimeUnit.MINUTES);
 this.pushFlushInterval = pushFlushInterval;
 this.rateLimiter = rateLimiter;
 this.permitsGranted = Metrics.newCounter(new MetricName("limiter", "", "permits-granted"));
 this.permitsDenied = Metrics.newCounter(new MetricName("limiter", "", "permits-denied"));
 this.permitsRetried = Metrics.newCounter(new MetricName("limiter", "", "permits-retried"));
 this.scheduler.schedule(this, this.pushFlushInterval.get(), TimeUnit.MILLISECONDS);
}
origin: facebookarchive/hive-io-experimental

/**
 * Constructor
 *
 * @param name String name
 * @param printPeriod how often to print
 */
public MetricsObserver(String name, int printPeriod) {
 TimeUnit durationUnit = TimeUnit.MICROSECONDS;
 TimeUnit rateUnit = TimeUnit.MILLISECONDS;
 this.printPeriod = printPeriod;
 readTimer = Metrics.newTimer(new MetricName(name, "", "reads"),
   durationUnit, rateUnit);
 readSuccessRatio =
   new CounterRatioGauge(Metrics.newCounter(new MetricName(name, "", "successes")),
     Metrics.newCounter(new MetricName(name, "", "-reads")));
 parseTimer = Metrics.newTimer(new MetricName(name, "", "parses"),
   durationUnit, rateUnit);
}
origin: com.facebook.presto.cassandra/cassandra-server

  public CommitLogMetrics(final AbstractCommitLogService service, final CommitLogSegmentManager allocator)
  {
    completedTasks = Metrics.newGauge(factory.createMetricName("CompletedTasks"), new Gauge<Long>()
    {
      public Long value()
      {
        return service.getCompletedTasks();
      }
    });
    pendingTasks = Metrics.newGauge(factory.createMetricName("PendingTasks"), new Gauge<Long>()
    {
      public Long value()
      {
        return service.getPendingTasks();
      }
    });
    totalCommitLogSize = Metrics.newGauge(factory.createMetricName("TotalCommitLogSize"), new Gauge<Long>()
    {
      public Long value()
      {
        return allocator.bytesUsed();
      }
    });
    waitingOnSegmentAllocation = Metrics.newTimer(factory.createMetricName("WaitingOnSegmentAllocation"), TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
    waitingOnCommit = Metrics.newTimer(factory.createMetricName("WaitingOnCommit"), TimeUnit.MICROSECONDS, TimeUnit.SECONDS);
  }
}
com.yammer.metricsMetricsnewTimer

Javadoc

Creates a new com.yammer.metrics.core.Timer and registers it under the given metric name.

Popular methods of Metrics

  • defaultRegistry
    Returns the (static) default registry.
  • newCounter
    Creates a new com.yammer.metrics.core.Counter and registers it under the given class and name.
  • newMeter
  • newGauge
    Given a new com.yammer.metrics.core.Gauge, registers it under the given class and name.
  • newHistogram
    Creates a new com.yammer.metrics.core.Histogram and registers it under the given class and name.
  • shutdown
    Shuts down all thread pools for the default registry.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now