Search in sources :

Example 1 with PServerMetaData

use of com.navercorp.pinpoint.grpc.trace.PServerMetaData in project pinpoint by naver.

the class GrpcAgentInfoMessageConverter method convertAgentInfo.

public PAgentInfo convertAgentInfo(final AgentInfo agentInfo) {
    final AgentInformation agentInformation = agentInfo.getAgentInformation();
    final PAgentInfo.Builder builder = PAgentInfo.newBuilder();
    builder.setIp(agentInformation.getHostIp());
    builder.setHostname(agentInformation.getMachineName());
    builder.setPorts("");
    builder.setContainer(agentInformation.isContainer());
    builder.setPid(agentInformation.getPid());
    builder.setServiceType(agentInformation.getServerType().getCode());
    builder.setVmVersion(agentInformation.getJvmVersion());
    builder.setAgentVersion(Version.VERSION);
    final ServerMetaData serverMetaData = agentInfo.getServerMetaData();
    if (serverMetaData != null) {
        final PServerMetaData tServerMetaData = convertServerMetaData(agentInfo.getServerMetaData());
        builder.setServerMetaData(tServerMetaData);
    }
    final JvmInformation jvmInformation = agentInfo.getJvmInfo();
    if (jvmInformation != null) {
        final PJvmInfo tJvmInfo = convertJvmInfo(agentInfo.getJvmInfo());
        builder.setJvmInfo(tJvmInfo);
    }
    return builder.build();
}
Also used : PJvmInfo(com.navercorp.pinpoint.grpc.trace.PJvmInfo) AgentInformation(com.navercorp.pinpoint.profiler.AgentInformation) ServerMetaData(com.navercorp.pinpoint.bootstrap.context.ServerMetaData) PServerMetaData(com.navercorp.pinpoint.grpc.trace.PServerMetaData) PAgentInfo(com.navercorp.pinpoint.grpc.trace.PAgentInfo) PServerMetaData(com.navercorp.pinpoint.grpc.trace.PServerMetaData) JvmInformation(com.navercorp.pinpoint.profiler.JvmInformation)

Example 2 with PServerMetaData

use of com.navercorp.pinpoint.grpc.trace.PServerMetaData 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)

Example 3 with PServerMetaData

use of com.navercorp.pinpoint.grpc.trace.PServerMetaData in project pinpoint by naver.

the class GrpcAgentInfoBoMapper method map.

public AgentInfoBo map(final PAgentInfo agentInfo, final Header header) {
    final String agentId = header.getAgentId();
    final String agentName = header.getAgentName();
    final String applicationName = header.getApplicationName();
    final long startTime = header.getAgentStartTime();
    final String hostName = agentInfo.getHostname();
    final String ip = agentInfo.getIp();
    final String ports = agentInfo.getPorts();
    final short serviceType = (short) agentInfo.getServiceType();
    final int pid = agentInfo.getPid();
    final String vmVersion = agentInfo.getVmVersion();
    final String agentVersion = agentInfo.getAgentVersion();
    final long endTimeStamp = agentInfo.getEndTimestamp();
    final int endStatus = agentInfo.getEndStatus();
    final boolean container = agentInfo.getContainer();
    final AgentInfoBo.Builder builder = new AgentInfoBo.Builder();
    builder.setHostName(hostName);
    builder.setIp(ip);
    builder.setPorts(ports);
    builder.setAgentId(agentId);
    builder.setAgentName(agentName);
    builder.setApplicationName(applicationName);
    builder.setServiceTypeCode(serviceType);
    builder.setPid(pid);
    builder.setVmVersion(vmVersion);
    builder.setAgentVersion(agentVersion);
    builder.setStartTime(startTime);
    builder.setEndTimeStamp(endTimeStamp);
    builder.setEndStatus(endStatus);
    builder.isContainer(container);
    if (agentInfo.hasServerMetaData()) {
        final PServerMetaData serverMetaData = agentInfo.getServerMetaData();
        builder.setServerMetaData(this.serverMetaDataBoMapper.map(serverMetaData));
    }
    if (agentInfo.hasJvmInfo()) {
        final PJvmInfo jvmInfo = agentInfo.getJvmInfo();
        builder.setJvmInfo(this.jvmInfoBoMapper.map(jvmInfo));
    }
    return builder.build();
}
Also used : AgentInfoBo(com.navercorp.pinpoint.common.server.bo.AgentInfoBo) PJvmInfo(com.navercorp.pinpoint.grpc.trace.PJvmInfo) PServerMetaData(com.navercorp.pinpoint.grpc.trace.PServerMetaData)

Aggregations

PServerMetaData (com.navercorp.pinpoint.grpc.trace.PServerMetaData)3 PJvmInfo (com.navercorp.pinpoint.grpc.trace.PJvmInfo)2 ServerMetaData (com.navercorp.pinpoint.bootstrap.context.ServerMetaData)1 ServiceInfo (com.navercorp.pinpoint.bootstrap.context.ServiceInfo)1 AgentInfoBo (com.navercorp.pinpoint.common.server.bo.AgentInfoBo)1 PAgentInfo (com.navercorp.pinpoint.grpc.trace.PAgentInfo)1 PServiceInfo (com.navercorp.pinpoint.grpc.trace.PServiceInfo)1 AgentInformation (com.navercorp.pinpoint.profiler.AgentInformation)1 JvmInformation (com.navercorp.pinpoint.profiler.JvmInformation)1 ArrayList (java.util.ArrayList)1