Search in sources :

Example 1 with StartProfilerCommand

use of com.newrelic.agent.profile.StartProfilerCommand in project newrelic-java-agent by newrelic.

the class CommandParserThreadProfilerTest method processThreadProfilerCommand.

private Map<Long, Object> processThreadProfilerCommand(String threadProfilerGetCommand) throws Exception {
    JSONParser parser = new JSONParser();
    Object parsedTPAgentCommand = parser.parse(threadProfilerGetCommand);
    Map<?, ?> tpAgentCommandMap = Map.class.cast(parsedTPAgentCommand);
    List<List<?>> threadProfilerCommands = (List<List<?>>) tpAgentCommandMap.get("return_value");
    commandParser.addCommands(new StartProfilerCommand(profilerService));
    MockRPMService rpmService = new MockRPMService();
    Map<Long, Object> result = commandParser.processCommands(rpmService, threadProfilerCommands);
    return result;
}
Also used : JSONParser(org.json.simple.parser.JSONParser) List(java.util.List) StartProfilerCommand(com.newrelic.agent.profile.StartProfilerCommand) MockRPMService(com.newrelic.agent.MockRPMService)

Aggregations

MockRPMService (com.newrelic.agent.MockRPMService)1 StartProfilerCommand (com.newrelic.agent.profile.StartProfilerCommand)1 List (java.util.List)1 JSONParser (org.json.simple.parser.JSONParser)1