use of com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory in project pinpoint by naver.
the class PinpointClientFactoryProvider method get.
public PinpointClientFactory get() {
PinpointClientFactory pinpointClientFactory = new DefaultPinpointClientFactory();
pinpointClientFactory.setTimeoutMillis(1000 * 5);
AgentInformation agentInformation = this.agentInformation.get();
Map<String, Object> properties = toMap(agentInformation);
boolean isSupportServerMode = profilerConfig.isTcpDataSenderCommandAcceptEnable();
if (isSupportServerMode) {
pinpointClientFactory.setMessageListener(commandDispatcher);
pinpointClientFactory.setServerStreamChannelMessageListener(commandDispatcher);
properties.put(HandshakePropertyType.SUPPORT_SERVER.getName(), true);
properties.put(HandshakePropertyType.SUPPORT_COMMAND_LIST.getName(), commandDispatcher.getRegisteredCommandServiceCodes());
} else {
properties.put(HandshakePropertyType.SUPPORT_SERVER.getName(), false);
}
pinpointClientFactory.setProperties(properties);
return pinpointClientFactory;
}
use of com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory in project pinpoint by naver.
the class DataReceiverGroupTest method createPinpointClientFactory.
private PinpointClientFactory createPinpointClientFactory() {
PinpointClientFactory clientFactory = new DefaultPinpointClientFactory();
clientFactory.setWriteTimeoutMillis(1000 * 3);
clientFactory.setRequestTimeoutMillis(1000 * 5);
clientFactory.setProperties(Collections.emptyMap());
return clientFactory;
}
use of com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory in project pinpoint by naver.
the class AgentInfoSenderTest method createPinpointClientFactory.
private PinpointClientFactory createPinpointClientFactory() {
PinpointClientFactory clientFactory = new DefaultPinpointClientFactory();
clientFactory.setWriteTimeoutMillis(1000 * 3);
clientFactory.setRequestTimeoutMillis(1000 * 5);
clientFactory.setProperties(Collections.<String, Object>emptyMap());
return clientFactory;
}
use of com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory in project pinpoint by naver.
the class ClassPreLoader method preload.
public static void preload(int port) {
PinpointServerAcceptor serverAcceptor = null;
PinpointClient client = null;
PinpointClientFactory clientFactory = null;
try {
serverAcceptor = new PinpointServerAcceptor();
serverAcceptor.bind("127.0.0.1", port);
clientFactory = new DefaultPinpointClientFactory();
client = clientFactory.connect("127.0.0.1", port);
client.sendSync(new byte[0]);
} catch (Exception ex) {
System.err.print("preLoad error Caused:" + ex.getMessage());
ex.printStackTrace();
final Logger logger = LogManager.getLogger(ClassPreLoader.class);
logger.warn("preLoad error Caused:{}", ex.getMessage(), ex);
if (ex instanceof PinpointSocketException) {
throw (PinpointSocketException) ex;
} else {
throw new PinpointSocketException(ex.getMessage(), ex);
}
} finally {
if (client != null) {
try {
client.close();
} catch (Exception e) {
e.printStackTrace();
}
}
if (clientFactory != null) {
try {
clientFactory.release();
} catch (Exception e) {
e.printStackTrace();
}
}
if (serverAcceptor != null) {
try {
serverAcceptor.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
use of com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory in project pinpoint by naver.
the class StatClientFactoryProvider method get.
public PinpointClientFactory get() {
if (!"TCP".equalsIgnoreCase(thriftTransportConfig.getStatDataSenderTransportType())) {
return null;
}
PinpointClientFactory pinpointClientFactory = new DefaultPinpointClientFactory(channelFactoryProvider.get(), connectTimerProvider.get());
pinpointClientFactory.setWriteTimeoutMillis(1000 * 3);
pinpointClientFactory.setRequestTimeoutMillis(1000 * 5);
int writeBufferHighWaterMark = getByteSize(thriftTransportConfig.getStatDataSenderWriteBufferHighWaterMark(), ByteSizeUnit.MEGA_BYTES.toBytesSizeAsInt(16));
int writeBufferLowWaterMark = getByteSize(thriftTransportConfig.getStatDataSenderWriteBufferLowWaterMark(), ByteSizeUnit.MEGA_BYTES.toBytesSizeAsInt(8));
if (writeBufferLowWaterMark > writeBufferHighWaterMark) {
logger.warn("must be writeBufferHighWaterMark({}) >= writeBufferLowWaterMark({})", writeBufferHighWaterMark, writeBufferLowWaterMark);
writeBufferLowWaterMark = writeBufferHighWaterMark;
}
pinpointClientFactory.setWriteBufferHighWaterMark(writeBufferHighWaterMark);
pinpointClientFactory.setWriteBufferLowWaterMark(writeBufferLowWaterMark);
return pinpointClientFactory;
}
Aggregations