congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
SharedMetricRegistries.add
Code IndexAdd Tabnine to your IDE (free)

How to use
add
method
in
com.codahale.metrics.SharedMetricRegistries

Best Java code snippets using com.codahale.metrics.SharedMetricRegistries.add (Showing top 13 results out of 315)

origin: io.dropwizard.metrics/metrics-core

public static MetricRegistry getOrCreate(String name) {
  final MetricRegistry existing = REGISTRIES.get(name);
  if (existing == null) {
    final MetricRegistry created = new MetricRegistry();
    final MetricRegistry raced = add(name, created);
    if (raced == null) {
      return created;
    }
    return raced;
  }
  return existing;
}
origin: io.dropwizard.metrics/metrics-core

/**
 * Sets the provided registry as the default one under the provided name
 *
 * @param name           the default registry name
 * @param metricRegistry the default registry
 * @throws IllegalStateException if the default registry has already been set
 */
public static MetricRegistry setDefault(String name, MetricRegistry metricRegistry) {
  if (defaultRegistryName.compareAndSet(null, name)) {
    add(name, metricRegistry);
    return metricRegistry;
  }
  throw new IllegalStateException("Default metric registry name is already set.");
}
origin: signalapp/Signal-Server

 throws Exception
SharedMetricRegistries.add(Constants.METRICS_NAME, environment.metrics());
environment.getObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
environment.getObjectMapper().setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.NONE);
origin: com.ning.billing/killbill-osgi-bundles-analytics

  public static MetricRegistry getOrCreate(String name) {
    final MetricRegistry existing = REGISTRIES.get(name);
    if (existing == null) {
      final MetricRegistry created = new MetricRegistry();
      final MetricRegistry raced = add(name, created);
      if (raced == null) {
        return created;
      }
      return raced;
    }
    return existing;
  }
}
origin: com.codahale.metrics/metrics-core

  public static MetricRegistry getOrCreate(String name) {
    final MetricRegistry existing = REGISTRIES.get(name);
    if (existing == null) {
      final MetricRegistry created = new MetricRegistry();
      final MetricRegistry raced = add(name, created);
      if (raced == null) {
        return created;
      }
      return raced;
    }
    return existing;
  }
}
origin: org.juzu/juzu-doc-extension-examples

@PostConstruct
public void start() {
 SharedMetricRegistries.add(application.getPackageName(), registry);
}
// end::start[]
origin: dropwizard-jobs/dropwizard-jobs

@Override
public void initialize(Bootstrap<?> bootstrap) {
  // add shared metrics registry to be used by Jobs, since defaultRegistry
  // has been removed
  SharedMetricRegistries.add(Job.DROPWIZARD_JOBS_KEY, bootstrap.getMetricRegistry());
}
origin: juzu/juzu

@PostConstruct
public void start() {
 SharedMetricRegistries.add(application.getPackageName(), registry);
}
// end::start[]
origin: io.macgyver/macgyver-core

@Bean(name = "macMetricRegistry")
public MacGyverMetricRegistry macMetricRegistry() {
  MacGyverMetricRegistry registry = new MacGyverMetricRegistry();
  SharedMetricRegistries.add("macMetricRegistry", registry);
  Slf4jReporter r = Slf4jReporter.forRegistry(registry)
      .withLoggingLevel(LoggingLevel.DEBUG)
      .convertDurationsTo(TimeUnit.MILLISECONDS)
      .convertRatesTo(TimeUnit.SECONDS)
      .outputTo(LoggerFactory.getLogger("io.macgyver.metrics"))
      .build();
  r.start(60, TimeUnit.SECONDS);
  return registry;
}
origin: org.lwapp/lwapp-dropwizard-core

@Override
public final void run(final T config, final Environment environment) throws Exception {
  SharedMetricRegistries.add("matrix", environment.metrics());
  environment.getObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  environment.getObjectMapper().setSerializationInclusion(Include.NON_NULL);
origin: io.vertx/vertx-metrics

MetricRegistry other = SharedMetricRegistries.add(metricsOptions.getName(), registry);
if (other != null && other instanceof Registry) {
 registry = (Registry) other;
origin: io.vertx/vertx-dropwizard-metrics

boolean shutdown = true;
if (metricsOptions.getRegistryName() != null) {
 MetricRegistry other = SharedMetricRegistries.add(metricsOptions.getRegistryName(), registry);
 if (other != null) {
  registry = other;
origin: signalapp/PushServer

@Override
public void run(PushServerConfiguration config, Environment environment) throws Exception {
 SharedMetricRegistries.add(Constants.METRICS_NAME, environment.metrics());
 environment.getObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
 JedisPool           redisClient         = new RedisClientFactory(config.getRedisConfiguration()).getRedisClientPool();
 ServerAuthenticator serverAuthenticator = new ServerAuthenticator(config.getAuthenticationConfiguration());
 List<Server>        servers             = config.getAuthenticationConfiguration().getServers();
 UnregisteredQueue   apnQueue            = new UnregisteredQueue(redisClient, environment.getObjectMapper(), servers, "apn");
 UnregisteredQueue   gcmQueue            = new UnregisteredQueue(redisClient, environment.getObjectMapper(), servers, "gcm");
 APNSender apnSender = initializeApnSender(redisClient, apnQueue, config.getApnConfiguration());
 GCMSender gcmSender = initializeGcmSender(gcmQueue, config.getGcmConfiguration());
 environment.lifecycle().manage(apnSender);
 environment.lifecycle().manage(gcmSender);
 environment.jersey().register(AuthFactory.binder(new BasicAuthFactory<>(serverAuthenticator, "PushServer", Server.class)));
 environment.jersey().register(new PushController(apnSender, gcmSender));
 environment.jersey().register(new FeedbackController(gcmQueue, apnQueue));
 environment.healthChecks().register("Redis", new RedisHealthCheck(redisClient));
}
com.codahale.metricsSharedMetricRegistriesadd

Popular methods of SharedMetricRegistries

  • getOrCreate
  • clear
  • setDefault
    Sets the provided registry as the default one under the provided name
  • tryGetDefault
    Same as #getDefault() except returns null when the default registry has not been set.
  • getDefault
    Gets the name of the default registry, if it has been set
  • names
  • remove

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • getSupportFragmentManager (FragmentActivity)
  • getSystemService (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Option (scala)
  • 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