congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Metrics.newTimer
Code IndexAdd Tabnine 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)

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

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • Reflections (org.reflections)
    Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now