use of com.navercorp.pinpoint.grpc.trace.PServiceInfo in project pinpoint by naver.
the class GrpcServerMetaDataBoMapper method map.
public ServerMetaDataBo map(final PServerMetaData serverMetaData) {
final String serverInfo = serverMetaData.getServerInfo();
final List<String> vmArgs = serverMetaData.getVmArgList();
final ServerMetaDataBo.Builder builder = new ServerMetaDataBo.Builder();
builder.serverInfo(serverInfo);
builder.vmArgs(vmArgs);
final List<PServiceInfo> serviceInfoList = serverMetaData.getServiceInfoList();
if (CollectionUtils.hasLength(serviceInfoList)) {
final List<ServiceInfoBo> serviceInfoBoList = new ArrayList<>(serverMetaData.getServiceInfoCount());
for (PServiceInfo tServiceInfo : serviceInfoList) {
final ServiceInfoBo serviceInfoBo = mapServiceInfo(tServiceInfo);
serviceInfoBoList.add(serviceInfoBo);
}
builder.serviceInfos(serviceInfoBoList);
return builder.build();
} else {
builder.serviceInfos(Collections.emptyList());
return builder.build();
}
}
use of com.navercorp.pinpoint.grpc.trace.PServiceInfo in project pinpoint by naver.
the class GrpcAgentInfoMessageConverter method convertServerMetaData.
private PServerMetaData convertServerMetaData(final ServerMetaData serverMetaData) {
final PServerMetaData.Builder serverMetaDataBuilder = PServerMetaData.newBuilder();
serverMetaDataBuilder.setServerInfo(serverMetaData.getServerInfo());
serverMetaDataBuilder.addAllVmArg(serverMetaData.getVmArgs());
final List<PServiceInfo> serviceInfoList = new ArrayList<PServiceInfo>();
for (ServiceInfo serviceInfo : serverMetaData.getServiceInfos()) {
final PServiceInfo.Builder serviceInfoBuilder = PServiceInfo.newBuilder();
serviceInfoBuilder.setServiceName(serviceInfo.getServiceName());
serviceInfoBuilder.addAllServiceLib(serviceInfo.getServiceLibs());
serviceInfoList.add(serviceInfoBuilder.build());
}
serverMetaDataBuilder.addAllServiceInfo(serviceInfoList);
return serverMetaDataBuilder.build();
}
Aggregations