Search in sources :

Example 16 with AgentBuilder

use of net.bytebuddy.agent.builder.AgentBuilder in project instrumentation-java by census-instrumentation.

the class UrlInstrumentationTest method instrument_enabled.

@Test
public void instrument_enabled() {
    Settings settings = new Settings(ConfigFactory.parseString(FEATURE + ".enabled = true"));
    AgentBuilder agentBuilder2 = instrumentation.instrument(agentBuilder, settings);
    assertThat(agentBuilder2).isNotSameInstanceAs(agentBuilder);
}
Also used : AgentBuilder(net.bytebuddy.agent.builder.AgentBuilder) Settings(io.opencensus.contrib.agent.Settings) Test(org.junit.Test)

Example 17 with AgentBuilder

use of net.bytebuddy.agent.builder.AgentBuilder in project instrumentation-java by census-instrumentation.

the class ThreadInstrumentationTest method instrument_disabled.

@Test
public void instrument_disabled() {
    Settings settings = new Settings(ConfigFactory.parseString(FEATURE + ".enabled = false"));
    AgentBuilder agentBuilder2 = instrumentation.instrument(agentBuilder, settings);
    assertThat(agentBuilder2).isSameInstanceAs(agentBuilder);
}
Also used : AgentBuilder(net.bytebuddy.agent.builder.AgentBuilder) Settings(io.opencensus.contrib.agent.Settings) Test(org.junit.Test)

Aggregations

AgentBuilder (net.bytebuddy.agent.builder.AgentBuilder)17 Settings (io.opencensus.contrib.agent.Settings)6 Test (org.junit.Test)6 Instrumenter (io.opencensus.contrib.agent.instrumentation.Instrumenter)1 JarFile (java.util.jar.JarFile)1 ByteBuddy (net.bytebuddy.ByteBuddy)1 AgentRunner (org.agrona.concurrent.AgentRunner)1 SleepingMillisIdleStrategy (org.agrona.concurrent.SleepingMillisIdleStrategy)1