Search in sources :

Example 26 with DefaultWhiteboard

use of org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard in project jackrabbit-oak by apache.

the class MetricsExporterFixtureProviderTest method checkCorrectPushGatewayInit.

@Test
public void checkCorrectPushGatewayInit() throws Exception {
    OptionParser parser = new OptionParser();
    DataStoreOptions dataStoreOptions = new DataStoreOptions(parser);
    OptionSet option = parser.parse("--export-metrics", "pushgateway;localhost:9091;key1=value1,key2=value2");
    dataStoreOptions.configure(option);
    MetricsExporterFixture metricsExporterFixture = MetricsExporterFixtureProvider.create(dataStoreOptions, new DefaultWhiteboard());
    assertEquals("pushgateway", metricsExporterFixture.getExporterType().name());
    Object metricsExporter = metricsExporterFixture.getMetricsExporter();
    assertTrue(metricsExporter instanceof PushGateway);
}
Also used : DefaultWhiteboard(org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard) PushGateway(io.prometheus.client.exporter.PushGateway) OptionSet(joptsimple.OptionSet) OptionParser(joptsimple.OptionParser) Test(org.junit.Test)

Aggregations

DefaultWhiteboard (org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard)26 Whiteboard (org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard)21 Test (org.junit.Test)16 Before (org.junit.Before)5 OpenSecurityProvider (org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider)4 NodeBuilder (org.apache.jackrabbit.oak.spi.state.NodeBuilder)4 Map (java.util.Map)3 AtomicReference (java.util.concurrent.atomic.AtomicReference)3 Oak (org.apache.jackrabbit.oak.Oak)3 ContentRepository (org.apache.jackrabbit.oak.api.ContentRepository)3 Jcr (org.apache.jackrabbit.oak.jcr.Jcr)3 MemoryNodeStore (org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore)3 EditorHook (org.apache.jackrabbit.oak.spi.commit.EditorHook)3 NodeStore (org.apache.jackrabbit.oak.spi.state.NodeStore)3 Closeable (java.io.Closeable)2 Repository (javax.jcr.Repository)2 ContentSession (org.apache.jackrabbit.oak.api.ContentSession)2 PropertyState (org.apache.jackrabbit.oak.api.PropertyState)2 BlobAccessProvider (org.apache.jackrabbit.oak.api.blob.BlobAccessProvider)2 RepositoryImpl (org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl)2