@Test public void testProcessNormalExitWithoutSetThreadLocalThreadLocalActionParams() { GrailsControllerStateKeeper.setThreadLocalController(getClass().getSimpleName(), getClass().getName()); Operation op = new Operation(); collector.processNormalExit(op, Object.class); assertOperationContents(op, getClass().getSimpleName(), getClass().getName(), GrailsControllerMetricCollector.UNKNOWN_ACTION); OperationList actionParams = op.get("actionParams", OperationList.class); assertNotNull("No action params", actionParams); assertEquals("Non-empty action params", 0, actionParams.size()); }
@Override public void processNormalExit(Operation op, Object returnValue) { State state = GrailsControllerStateKeeper.getAndDestroyThreadLocalState(); op.label(buildLabel(state)) .sourceCodeLocation(buildSourceCodeLocation(state)) ; OperationList actionParams = op.createList("actionParams"); if ((state != null) && (state.actionParams != null)) { for (KeyValPair<String, String> param : state.actionParams) { actionParams.createMap().put("key", param.getKey()).put("value", param.getValue()); } } }
GrailsControllerMetricCollector extends DefaultOperationCollector { @Override public void processNormalExit(Operation op, Object returnValue) { State state = GrailsControllerStateKeeper.getAndDestroyThreadLocalState(); op.label(buildLabel(state)) .sourceCodeLocation(buildSourceCodeLocation(state)) ; OperationList actionParams = op.createList("actionParams"); if ((state != null) && (state.actionParams != null)) { for (KeyValPair<String, String> param : state.actionParams) { actionParams.createMap().put("key", param.getKey()).put("value", param.getValue()); } } } }
GrailsControllerMetricCollector extends DefaultOperationCollector { @Override public void processNormalExit(Operation op, Object returnValue) { State state = GrailsControllerStateKeeper.getAndDestroyThreadLocalState(); op.label(buildLabel(state)) .sourceCodeLocation(buildSourceCodeLocation(state)) ; OperationList actionParams = op.createList("actionParams"); if ((state != null) && (state.actionParams != null)) { for (KeyValPair<String, String> param : state.actionParams) { actionParams.createMap().put("key", param.getKey()).put("value", param.getValue()); } } } GrailsControllerMetricCollector(); }
GrailsControllerMetricCollector extends DefaultOperationCollector { @Override public void processNormalExit(Operation op, Object returnValue) { State state = GrailsControllerStateKeeper.getAndDestroyThreadLocalState(); op.label(buildLabel(state)) .sourceCodeLocation(buildSourceCodeLocation(state)) ; OperationList actionParams = op.createList("actionParams"); if ((state != null) && (state.actionParams != null)) { for (KeyValPair<String, String> param : state.actionParams) { actionParams.createMap().put("key", param.getKey()).put("value", param.getValue()); } } } GrailsControllerMetricCollector(); @Override void processNormalExit(Operation op, Object returnValue); }
GrailsControllerMetricCollector extends DefaultOperationCollector { @Override public void processNormalExit(Operation op, Object returnValue) { State state = GrailsControllerStateKeeper.getAndDestroyThreadLocalState(); op.label(buildLabel(state)) .sourceCodeLocation(buildSourceCodeLocation(state)) ; OperationList actionParams = op.createList("actionParams"); if ((state != null) && (state.actionParams != null)) { for (KeyValPair<String, String> param : state.actionParams) { actionParams.createMap().put("key", param.getKey()).put("value", param.getValue()); } } } GrailsControllerMetricCollector(); @Override void processNormalExit(Operation op, Object returnValue); static final String UNKNOWN_ACTION; }