Search in sources :

Example 1 with AgentActiveThreadDump

use of com.navercorp.pinpoint.web.vo.AgentActiveThreadDump in project pinpoint by naver.

the class AgentActiveThreadDumpListSerializer method serialize.

@Override
public void serialize(AgentActiveThreadDumpList agentActiveThreadDumpList, JsonGenerator jgen, SerializerProvider serializers) throws IOException, JsonProcessingException {
    List<AgentActiveThreadDump> agentActiveThreadDumpRepository = agentActiveThreadDumpList.getSortOldestAgentActiveThreadDumpRepository();
    jgen.writeStartArray();
    for (AgentActiveThreadDump agentActiveThreadDump : agentActiveThreadDumpRepository) {
        jgen.writeStartObject();
        String hexStringThreadId = Long.toHexString(agentActiveThreadDump.getThreadId());
        jgen.writeStringField("threadId", "0x" + hexStringThreadId);
        jgen.writeStringField("threadName", agentActiveThreadDump.getThreadName());
        TThreadState threadState = agentActiveThreadDump.getThreadState();
        if (threadState == null) {
            jgen.writeStringField("threadState", TThreadState.UNKNOWN.name());
        } else {
            jgen.writeStringField("threadState", agentActiveThreadDump.getThreadState().name());
        }
        jgen.writeNumberField("startTime", agentActiveThreadDump.getStartTime());
        jgen.writeNumberField("execTime", agentActiveThreadDump.getExecTime());
        jgen.writeNumberField("localTraceId", agentActiveThreadDump.getLocalTraceId());
        jgen.writeBooleanField("sampled", agentActiveThreadDump.isSampled());
        jgen.writeStringField("transactionId", agentActiveThreadDump.getTransactionId());
        jgen.writeStringField("entryPoint", agentActiveThreadDump.getEntryPoint());
        jgen.writeStringField("detailMessage", agentActiveThreadDump.getDetailMessage());
        jgen.writeEndObject();
    }
    jgen.writeEndArray();
}
Also used : TThreadState(com.navercorp.pinpoint.thrift.dto.command.TThreadState) AgentActiveThreadDump(com.navercorp.pinpoint.web.vo.AgentActiveThreadDump)

Aggregations

TThreadState (com.navercorp.pinpoint.thrift.dto.command.TThreadState)1 AgentActiveThreadDump (com.navercorp.pinpoint.web.vo.AgentActiveThreadDump)1