Search in sources :

Example 1 with TransportModule

use of com.navercorp.pinpoint.bootstrap.config.TransportModule in project pinpoint by naver.

the class ApplicationContextModuleFactory method newRpcModule.

protected Module newRpcModule(AgentOption agentOption) {
    ProfilerConfig profilerConfig = agentOption.getProfilerConfig();
    final TransportModule transportModule = profilerConfig.getTransportModule();
    if (TransportModule.GRPC == transportModule) {
        logger.info("load GrpcModule");
        return new GrpcModule(profilerConfig);
    }
    if (TransportModule.THRIFT == transportModule) {
        logger.info("load ThriftModule");
        return new ThriftModule(profilerConfig);
    }
    logger.info("load ThriftModule");
    return new ThriftModule(profilerConfig);
}
Also used : TransportModule(com.navercorp.pinpoint.bootstrap.config.TransportModule) ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig)

Example 2 with TransportModule

use of com.navercorp.pinpoint.bootstrap.config.TransportModule in project pinpoint by naver.

the class TraceDataFormatVersionProvider method getVersion.

private TraceDataFormatVersion getVersion(ProfilerConfig profilerConfig) {
    final TransportModule transportModule = profilerConfig.getTransportModule();
    logger.info("TransportModule:{}", transportModule);
    if (TransportModule.THRIFT == transportModule) {
        final String version = profilerConfig.readString(TraceDataFormatVersion.THRIFT_TRACE_VERSION_KEY, "v1");
        if ("v1".equalsIgnoreCase(version)) {
            return TraceDataFormatVersion.V1;
        }
        throw new UnsupportedOperationException("unknown " + TraceDataFormatVersion.THRIFT_TRACE_VERSION_KEY + ":" + version);
    }
    if (TransportModule.GRPC == transportModule) {
        final String version = profilerConfig.readString(TraceDataFormatVersion.GRPC_TRACE_VERSION_KEY, "v2");
        if ("v2".equalsIgnoreCase(version)) {
            return TraceDataFormatVersion.V2;
        }
        throw new UnsupportedOperationException("unknown " + TraceDataFormatVersion.GRPC_TRACE_VERSION_KEY + ":" + version);
    }
    throw new UnsupportedOperationException("unknown transportModule:" + transportModule);
}
Also used : TransportModule(com.navercorp.pinpoint.bootstrap.config.TransportModule)

Aggregations

TransportModule (com.navercorp.pinpoint.bootstrap.config.TransportModule)2 ProfilerConfig (com.navercorp.pinpoint.bootstrap.config.ProfilerConfig)1