Installation

Extraction

  • All files related to the profiler are packaged in a ZIP file (the agent, server and the client). You can extract the content of this ZIP file to whatever folder you like, for example "D:\apps\profiler".

  • After extracting these files, you must copy the file "profiler-server.jar" into the "WEB-INF/lib" folder of the application you intend to profile. The other files can remain in the "D:\apps\profiler" folder.

Modifications to web.xml

  • Some modifications to the web.xml file of the application is required.

    • Add a servlet filter and a mapping to this filter.

The filter definition and mapping should be defined as below:

<filter>
    <filter-name>ProfilerAgentRequestFilter</filter-name>
    <filter-class>com.technia.tva.profiler.server.web.HttpRequestFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>ProfilerAgentRequestFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
The filter definition should be added after the "Set Character Encoding Filter", which should be enabled if you are using Tomcat/TomEE.

Modifying application server start script

  • The JVM used by the application server needs to be configured to be aware of the Profiler Agent.

  • The following JVM arguments are required.

-javaagent:D:/apps/profiler/profiler-agent.jar
-Dprofiler.db.user=creator
-Dprofiler.db.password=pass
  • -javaagent should point to the location where the profiler-agent.jar file was saved.

  • profiler.db.user is required to use the ENOVIA API to for example monitor the memory usage periodically. It does not have to be creator, but it needs to be a user that has system privileges.

  • profiler.db.password should be set for the user specified by profiler.db.user.

The user and password parameters may for security reasons not be defined in clear text. You can use the "encrypt password" feature in MQL do encrypt the user name and/or the password value. If so, then you must use the argument names
"-Dprofiler.db.user.encrypted" and "-Dprofiler.db.password.encrypted".
  • The following JVM aruments are optional.

-Dprofiler.port=8000
-Dprofiler.host=nameofhost
  • profiler.port to change the port that the Profiler agent uses.

  • profiler.host to change the host that the Profiler agent uses.

Example

  • How you pass in these JVM arguments varies based on your application server and operating system. For windows either update startup script and for Linux update in mxEnvCAS.sh or startup.sh file

  • Example for Windows: when using Apache Tomcat on Windows you will need to create/edit the file <TOMCAT_DIR>/bin/setenv.bat or service startup script and add this to the file:

REM ----------------------------
REM Profiler Agent Configuration
REM ----------------------------
SET CATALINA_OPTS=%CATALINA_OPTS% -javaagent:C:/apps/profiler/profiler-agent.jar
SET CATALINA_OPTS=%CATALINA_OPTS% -Dprofiler.db.user=creator
SET CATALINA_OPTS=%CATALINA_OPTS% -Dprofiler.db.password.encrypted==usIVNfm2
CATALINA_OPTS is used so that these JVM arguments are only passed in when tomcat is being started.

Example for Linux

(mxEnvCAS.sh MX_JAVA_OPTIONS parameter)

-javaagent:/home/technia/profiler/profiler-agent-2021.2.0.jar -Dprofiler.db.user=creator -Dprofiler.db.password=
-Dprofiler.port=9000 -Dprofiler.host=hostname

Tomcat startup.sh

export CATALINA_OPTS="$CATALINA_OPTS -javaagent:/app/apache/profiler/profiler-agent-2021.2.0.jar"
export CATALINA_OPTS="$CATALINA_OPTS -Dprofiler.db.user=creator"
export CATALINA_OPTS="$CATALINA_OPTS -Dprofiler.db.password="