Search in sources :

Example 1 with AtlasRegistry

use of com.netflix.spectator.atlas.AtlasRegistry in project iep by Netflix.

the class AtlasRegistryService method startImpl.

@Override
protected void startImpl() throws Exception {
    Config cfg = config.getConfig("netflix.iep");
    registry = new AtlasRegistry(clock, new TypesafeAtlasConfig(cfg));
    registry.start();
    // Add to global registry for http stats and GC logger
    Spectator.globalRegistry().add(registry);
    // Enable GC logger
    gcLogger = new GcLogger();
    if (cfg.getBoolean("atlas.collection.gc")) {
        gcLogger.start(null);
    }
    // Enable JVM data collection
    if (cfg.getBoolean("atlas.collection.jvm")) {
        Jmx.registerStandardMXBeans(registry);
    }
    // Start collection for the registry
    registry.start();
}
Also used : GcLogger(com.netflix.spectator.gc.GcLogger) AtlasConfig(com.netflix.spectator.atlas.AtlasConfig) Config(com.typesafe.config.Config) AtlasRegistry(com.netflix.spectator.atlas.AtlasRegistry)

Example 2 with AtlasRegistry

use of com.netflix.spectator.atlas.AtlasRegistry in project iep by Netflix.

the class AtlasModuleTest method registryIsBound.

@Test
public void registryIsBound() {
    Injector injector = Guice.createInjector(new AtlasModule());
    Registry registry = injector.getInstance(Registry.class);
    Assert.assertTrue(registry instanceof AtlasRegistry);
}
Also used : Injector(com.google.inject.Injector) Registry(com.netflix.spectator.api.Registry) AtlasRegistry(com.netflix.spectator.atlas.AtlasRegistry) AtlasRegistry(com.netflix.spectator.atlas.AtlasRegistry) Test(org.junit.Test)

Example 3 with AtlasRegistry

use of com.netflix.spectator.atlas.AtlasRegistry in project iep by Netflix.

the class AtlasRegistryServiceTest method validTagCharacters.

@Test
public void validTagCharacters() throws Exception {
    AtlasRegistryService service = new AtlasRegistryService();
    AtlasRegistry registry = (AtlasRegistry) service.getRegistry();
    AtlasConfig config = (AtlasConfig) registry.config();
    Assert.assertEquals("-._A-Za-z0-9", config.validTagCharacters());
    Assert.assertEquals("-._A-Za-z0-9^~", config.validTagValueCharacters().get("nf.cluster"));
    Assert.assertEquals("-._A-Za-z0-9^~", config.validTagValueCharacters().get("nf.asg"));
    Assert.assertNull(config.validTagValueCharacters().get("nf.zone"));
    service.stop();
}
Also used : AtlasConfig(com.netflix.spectator.atlas.AtlasConfig) AtlasRegistry(com.netflix.spectator.atlas.AtlasRegistry) Test(org.junit.Test)

Aggregations

AtlasRegistry (com.netflix.spectator.atlas.AtlasRegistry)3 AtlasConfig (com.netflix.spectator.atlas.AtlasConfig)2 Test (org.junit.Test)2 Injector (com.google.inject.Injector)1 Registry (com.netflix.spectator.api.Registry)1 GcLogger (com.netflix.spectator.gc.GcLogger)1 Config (com.typesafe.config.Config)1