Search in sources :

Example 6 with ServerMetaDataHolder

use of com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder in project pinpoint by naver.

the class WebAppInterceptor method dispatchLibJars.

private void dispatchLibJars(String contextKey, List<String> libJars, ServletContext webapp) {
    ServerMetaDataHolder holder = this.traceContext.getServerMetaDataHolder();
    holder.addServiceInfo(contextKey, libJars);
    holder.setServerName(webapp.getServerInfo());
    holder.notifyListeners();
}
Also used : ServerMetaDataHolder(com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)

Example 7 with ServerMetaDataHolder

use of com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder in project pinpoint by naver.

the class LauncherLaunchInterceptor method before.

@Override
public void before(Object target, Object[] args) {
    if (isDebug) {
        logger.beforeInterceptor(target, args);
    }
    if (!validate(target, args)) {
        return;
    }
    String serviceName = createServiceName(target);
    URLClassLoader classLoader = (URLClassLoader) args[2];
    URL[] urls = classLoader.getURLs();
    List<String> loadedJarNames = new ArrayList<String>(extractLibJarNamesFromURLs(urls));
    ServerMetaDataHolder holder = this.traceContext.getServerMetaDataHolder();
    holder.addServiceInfo(serviceName, loadedJarNames);
    holder.notifyListeners();
}
Also used : URLClassLoader(java.net.URLClassLoader) ArrayList(java.util.ArrayList) ServerMetaDataHolder(com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder) URL(java.net.URL)

Example 8 with ServerMetaDataHolder

use of com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder in project pinpoint by naver.

the class MockApplicationContextModule method newServerMetaDataHolder.

protected ServerMetaDataHolder newServerMetaDataHolder() {
    List<String> vmArgs = RuntimeMXBeanUtils.getVmArgs();
    ServerMetaDataHolder serverMetaDataHolder = new ResettableServerMetaDataHolder(vmArgs);
    return serverMetaDataHolder;
}
Also used : ServerMetaDataHolder(com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)

Example 9 with ServerMetaDataHolder

use of com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder in project pinpoint by naver.

the class MockApplicationContextModule method configure.

@Override
protected void configure() {
    final DataSender spanDataSender = newUdpSpanDataSender();
    logger.debug("spanDataSender:{}", spanDataSender);
    bind(DataSender.class).annotatedWith(SpanDataSender.class).toInstance(spanDataSender);
    final DataSender statDataSender = newUdpStatDataSender();
    logger.debug("statDataSender:{}", statDataSender);
    bind(DataSender.class).annotatedWith(StatDataSender.class).toInstance(statDataSender);
    StorageFactory storageFactory = newStorageFactory(spanDataSender);
    logger.debug("spanFactory:{}", spanDataSender);
    bind(StorageFactory.class).toInstance(storageFactory);
    bind(PinpointClientFactory.class).toProvider(Providers.of((PinpointClientFactory) null));
    bind(PinpointClient.class).toProvider(Providers.of((PinpointClient) null));
    EnhancedDataSender enhancedDataSender = newTcpDataSender();
    logger.debug("enhancedDataSender:{}", enhancedDataSender);
    bind(EnhancedDataSender.class).toInstance(enhancedDataSender);
    ServerMetaDataHolder serverMetaDataHolder = newServerMetaDataHolder();
    logger.debug("serverMetaDataHolder:{}", serverMetaDataHolder);
    bind(ServerMetaDataHolder.class).toInstance(serverMetaDataHolder);
    bind(PluginContextLoadResult.class).toProvider(MockPluginContextLoadResultProvider.class).in(Scopes.SINGLETON);
}
Also used : SpanDataSender(com.navercorp.pinpoint.profiler.context.module.SpanDataSender) StatDataSender(com.navercorp.pinpoint.profiler.context.module.StatDataSender) StorageFactory(com.navercorp.pinpoint.profiler.context.storage.StorageFactory) PinpointClient(com.navercorp.pinpoint.rpc.client.PinpointClient) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) SpanDataSender(com.navercorp.pinpoint.profiler.context.module.SpanDataSender) StatDataSender(com.navercorp.pinpoint.profiler.context.module.StatDataSender) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) DataSender(com.navercorp.pinpoint.profiler.sender.DataSender) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) ServerMetaDataHolder(com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)

Example 10 with ServerMetaDataHolder

use of com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder in project pinpoint by naver.

the class ConnectorInitializeInterceptor method after.

@Override
public void after(Object target, Object[] args, Object result, Throwable throwable) {
    if (isDebug) {
        logger.afterInterceptor(target, args, result, throwable);
    }
    if (target instanceof Connector) {
        final Connector connector = (Connector) target;
        ServerMetaDataHolder holder = this.traceContext.getServerMetaDataHolder();
        holder.addConnector(connector.getProtocol(), connector.getPort());
        holder.notifyListeners();
    }
}
Also used : Connector(org.apache.catalina.connector.Connector) ServerMetaDataHolder(com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)

Aggregations

ServerMetaDataHolder (com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)14 DataSender (com.navercorp.pinpoint.profiler.sender.DataSender)3 PinpointClient (com.navercorp.pinpoint.rpc.client.PinpointClient)3 PinpointClientFactory (com.navercorp.pinpoint.rpc.client.PinpointClientFactory)3 ArrayList (java.util.ArrayList)3 ConcurrentLinkedQueue (java.util.concurrent.ConcurrentLinkedQueue)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 Test (org.junit.Test)3 ServerMetaData (com.navercorp.pinpoint.bootstrap.context.ServerMetaData)2 DefaultServerMetaDataHolder (com.navercorp.pinpoint.profiler.context.DefaultServerMetaDataHolder)2 SpanDataSender (com.navercorp.pinpoint.profiler.context.module.SpanDataSender)2 StatDataSender (com.navercorp.pinpoint.profiler.context.module.StatDataSender)2 StorageFactory (com.navercorp.pinpoint.profiler.context.storage.StorageFactory)2 EnhancedDataSender (com.navercorp.pinpoint.profiler.sender.EnhancedDataSender)2 AgentInfoSender (com.navercorp.pinpoint.profiler.AgentInfoSender)1 TcpDataSender (com.navercorp.pinpoint.profiler.sender.TcpDataSender)1 DefaultPinpointClientFactory (com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory)1 PinpointServerAcceptor (com.navercorp.pinpoint.rpc.server.PinpointServerAcceptor)1 ListenableDataSender (com.navercorp.pinpoint.test.ListenableDataSender)1 MockApplicationContext (com.navercorp.pinpoint.test.MockApplicationContext)1