Search in sources :

Example 1 with PServiceInfo

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();
    }
}
Also used : PServiceInfo(com.navercorp.pinpoint.grpc.trace.PServiceInfo) ArrayList(java.util.ArrayList) ServerMetaDataBo(com.navercorp.pinpoint.common.server.bo.ServerMetaDataBo) ServiceInfoBo(com.navercorp.pinpoint.common.server.bo.ServiceInfoBo)

Example 2 with PServiceInfo

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();
}
Also used : ServiceInfo(com.navercorp.pinpoint.bootstrap.context.ServiceInfo) PServiceInfo(com.navercorp.pinpoint.grpc.trace.PServiceInfo) PServiceInfo(com.navercorp.pinpoint.grpc.trace.PServiceInfo) ArrayList(java.util.ArrayList) PServerMetaData(com.navercorp.pinpoint.grpc.trace.PServerMetaData)

Aggregations

PServiceInfo (com.navercorp.pinpoint.grpc.trace.PServiceInfo)2 ArrayList (java.util.ArrayList)2 ServiceInfo (com.navercorp.pinpoint.bootstrap.context.ServiceInfo)1 ServerMetaDataBo (com.navercorp.pinpoint.common.server.bo.ServerMetaDataBo)1 ServiceInfoBo (com.navercorp.pinpoint.common.server.bo.ServiceInfoBo)1 PServerMetaData (com.navercorp.pinpoint.grpc.trace.PServerMetaData)1