protected boolean createPerfLogContextForWSRequest( MessageContext context, SOAPMessage message, PerfLogContextTrackingData perfLogContextTrackingData) { logger.debug("handleRequest - createPerfLogContextForWSRequest"); PerfLogContextHelper.startPerfLogTxnMonitor(perfLogContextTrackingData); // This context is deleted when handling the response in handleMessage() or // in handleFault() method // Note: there may be a chance that the context may not get deleted // However that is ok, because if a new context is created on the same // thread and if it finds a zombie context, it will be deleted next time around // PerfLogContextHelper.pushInfoContext( PerfLogContextConstants.CALLING_JVM_HOST_ID, perfLogContextTrackingData.getCallingJvmHostId()); PerfLogContextHelper.pushInfoContext( PerfLogContextConstants.CALLING_JVM_CLONE_ID, perfLogContextTrackingData.getCallingJvmCloneId()); String tmpValueStr; PerfLogContextHelper.pushInfoContext( ContextHandlerConstants.PROPERTY_NAME_JAXRPC_INBOUND_URL, (tmpValueStr = (String) context.getProperty(ContextHandlerConstants.PROPERTY_NAME_JAXRPC_INBOUND_URL))); PerfLogContextHelper.addToTxnList(tmpValueStr); PerfLogContextHelper.pushInfoContext( ContextHandlerConstants.PROPERTY_NAME_JAXRPC_SOAP_ACTION, (tmpValueStr = (String) context.getProperty(ContextHandlerConstants.PROPERTY_NAME_JAXRPC_SOAP_ACTION))); PerfLogContextHelper.addToTxnList(tmpValueStr); PerfLogContextHelper.setUserId(perfLogContextTrackingData.getUserId()); PerfLogContextHelper.setRequestSessionId( perfLogContextTrackingData.getSessionId()); // calling JVM session id if set addMessagePropertiesToPerfLogContext(context); // add any current filter specific info here.. e.g. from the message // data. return true; }
private void logPerfMetrics( MessageContext context, long elapsedTime, PerfLogContext perfLogContext, Throwable t, String detailedFaultMessage) { logger.debug("logPerfMetrics: elapsedTime = " + elapsedTime); if (perfLogContext == null) { logger.warn("perfLogContext null"); return; } PerfLogData pData = new PerfLogData(perfLogContext); pData.setTransactionType(PerfLogTxnType.JAX_RPC_SERVER_REQUEST); pData.setTransactionName( (String) context.getProperty(ContextHandlerConstants.PROPERTY_NAME_JAXRPC_INBOUND_URL)); pData.setSubTransactionName( (String) context.getProperty(ContextHandlerConstants.PROPERTY_NAME_JAXRPC_SOAP_ACTION)); pData.setTransactionTime(elapsedTime); pData.setThrowable(t); pData.setMessage(detailedFaultMessage); pData.setTransactionTime(elapsedTime); pData.setGuid(perfLogContext.getGuid()); pData.setSessionId(perfLogContext.getRequestSessionId()); pData.setThreadName(perfLogContext.getThreadName()); pData.setServerName(perfLogContext.getHostId()); pData.setPerfLogContext(perfLogContext); pData.setServerIp(perfLogContext.getHostIp()); pData.setCloneName(perfLogContext.getJvmCloneId()); // set transaction date i.e. start time to the time this filter was created pData.setTransactionDate( new Date(perfLogContext.getTxnFilterCreationTime(perfLogContext.getTxnFilterDepth()))); pData.setUserId(perfLogContext.getUserId()); plogger.log(pData); }