clwTxnTracer
clwTxnTracer <threshold> <duration>
다음은 각 요소에 대한 설명입니다.
threshold는 트랜잭션 실행 시간 임계값(초)입니다.
duration은 세션 기간(초)입니다.
clwTxnTracer 1 600
실행 시간이 1초보다 오래 걸리는 트랜잭션에 대해 기간이 600초인 트랜잭션 추적 세션이 실행되도록 합니다.
트랜잭션 추적 데이터가 다음과 같이 현재 날짜에 해당하는 디렉터리의 단일 파일에 기록됩니다.
<EM_Home>/traces\<year>\<month>\<day>\<agents> _<threshold>secs_for<duration>secs.<start_time>.xml
예:
C:\introscope\traces\2004\11\11\AllAgents_1secs_for600secs.
14091705.xml
@ECHO OFF
SETLOCAL
TITLE Introscope -- Transaction Tracer Session
REM ****
REM Sets the current working directory with quotes around it
REM This enables this file to execute correctly if it is
REM invoked somewhere other than its location.
REM ****
FOR /f "tokens=1 delims=" %%a in ('cd') DO SET PWD=%%a
REM ****
REM Set the command directory to the command argument itself,
REM namely the full path of this file or the relative path
REM to where the file was invoked.
SET CMD_DIR=%0
REM Now simply strip out the name of this file to get dir
REM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
REM Use current filename
SET CMD_DIR=%CMD_DIR:clwTxnTracer.cmd=%
REM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
REM Strip the quotes
REM add quotes if they're not there
SET CMD_DIR="%CMD_DIR%"
REM if not add quotes, then this statement chokes
SET CMD_DIR=%CMD_DIR:"=%
REM if the current dir wasn't determined, just set it to working dir
IF NOT EXIST "%CMD_DIR%" SET CMD_DIR=.
IF "%CMD_DIR%" == %0 SET CMD_DIR=.
IF "%CMD_DIR%" == "%0" SET CMD_DIR=.
REM ****
REM Now set the home directory for Introscope, and others
IF NOT EXIST "%CMD_DIR%\setIscEnv.cmd" goto noSetEnvFile
call "%CMD_DIR%\setIscEnv.cmd"
SET TT_THRESHOLD_IN_SECS=%1
SET TT_DURATION_IN_SECS=%2
IF "X%TT_THRESHOLD_IN_SECS%" == "X" SET TT_THRESHOLD_IN_SECS=10000
IF "X%TT_DURATION_IN_SECS%" == "X" SET TT_DURATION_IN_SECS=600
IF %TT_THRESHOLD_IN_SECS% LEQ 0 GOTO badArg
IF %TT_DURATION_IN_SECS% LEQ 0 GOTO badArg
SET TT_AGENTS=(.*)
REM Java Settings (e.g. increase Max heap size )
SET JAVA_OPTS=-Xms64m -Xmx512m
SET JAVA_OPTS=%JAVA_OPTS% %CLW_USER_OPT% %CLW_PASSWORD_OPT% %CLW_EM_HOST_OPT% %CLW_EM_PORT_OPT%
SET COMMAND=trace transactions exceeding %TT_THRESHOLD_IN_SECS% seconds in agents matching \"%TT_AGENTS%\" for %TT_DURATION_IN_SECS% seconds
SET AGENT_STR=%TT_AGENTS%
REM Remove the spaces, parentheses
SET AGENT_STR=%AGENT_STR:(=%
SET AGENT_STR=%AGENT_STR:)=%
SET AGENT_STR=%AGENT_STR: =%
if "X%TT_AGENTS%" == "X(.*)" SET AGENT_STR=AllAgents
FOR /f "tokens=1-4 delims=:." %%a in ("%time%") DO SET SECS_STR=%%a%%b%%c%%d
FOR /f "tokens=1-4 delims=/ " %%a in ("%date%") DO SET TRACES_DIR=%ISC_TRACES%\%%d\%%b\%%c
REM Create the traces dir, if not exist
IF NOT EXIST "%TRACES_DIR%" MKDIR "%TRACES_DIR%"
SET TT_FILE=%TRACES_DIR%\%AGENT_STR%_%TT_THRESHOLD_IN_SECS%secs_for%TT_DURATION_IN_SECS%secs.%SECS_STR%.xml
TITLE Introscope -- Transaction Tracer for %TT_DURATION_IN_SECS% secs with threshold %TT_THRESHOLD_IN_SECS% secs
REM send stderr to null b/c there are meaningless disconnect excepts that might be *scary-looking*
ECHO Saving session output to %TT_FILE%
"%ISC_JAVA_HOME%\bin\java" %JAVA_OPTS% -jar "%CLW_JAR%" %COMMAND% > "%TT_FILE%" 2>NUL
goto finish
:badArg
ECHO Arguments should be greater than zero.
ECHO Syntax: $0 "threshold in secs" "duration in secs"
goto finish
:noSetEnvFile
ECHO There is no environment setup file: setIscEnv.cmd
ECHO Please re-run configureWily.cmd in installation directory!
goto finish
:finish
ENDLOCAL
|
Copyright © 2013 CA.
All rights reserved.
|
|