Friday, November 6, 2015

TM1Top

What is TM1Top?


TM1Top is command line utility used to understand what activity is occurring in a TM1 model, It displays a list of threads running. TM1Top will display details for each thread running on the TM1 server. A thread is either a user that is connected to the TM1 server or a Ti processes running as a chore. The thread information provided by TM1Top is often critical to diagnosing lock contention problem and understanding how users are using the TM1 model. These details are ONLY found in TM1Top, not the TM1 model messaging log (tm1server.log file).

Unfortunately TM1Top is not enabled by default and must be configured for each TM1 model. It's strongly recommended that TM1Top be configured and running at all times. Most importantly TM1Top should be configured to output a log files. If and when a TM1 server problem occurs, both the tm1server.log file and the log file from TM1Top should be reviewed.

Some TM1Top history

TM1Top was the only option provided by IBM to examine thread activity in TM1 in version 9.5.x. In version 10.1 IBM introduced a web based version of TM1Top known as Operations Console,. While Operations Console does have some advantages over TM1Top it came with it's own set of problems and was not well received. TM1 Operations Console did show a bit more thread detail than TM1Top. IBM decided to remove TM1Top in versions 10.2 and 10.2.2. However, previous versions of TM1Top still worked correctly with TM1 10.2 and 10.2.2. An updated version of TM1Top was reintroduced in Fixpack 4 for TM1 10.2.2.

The version of TM1Top included with TM1 10.2.2 Fixpack 4 is strongly recommended as it provides slightly more detail than previous versions. The level of thread detail in this version matches TM1 Operations Console.

How do I run TM1Top?


The IBM Cognos documentation talks about creating a tm1top.ini file. There is a much simpler method to starting TM1Top.

Create a Windows shortcut to the tm1top.exe file in the TM1 bin64 directory with the following target:

tm1top.exe -adminhost localhost -servername "Planning Sample -logfile C:\TM1\Models\MyModel\Logs\tm1top.log -logperiod 2 -logappend T -refresh 2

A shortcut can be created for each TM1 model in use. The above shortcut uses the logfile parameter which will create and update a tm1top.log file. The logperiod parameter indicates the log file is updated every 2 seconds and logappend prevents TM1Top from overwriting the log file if TM1Top is restarted.

How do I start TM1Top automatically when the TM1 server is started or restarted?


This technique is useful when the TM1 model has a scheduled automatic restart and tm1top logging is required.

1 - Create a Ti process that uses the ExecuteCommand function to start tm1top. In this example we name the Ti process tm1top.

ExecuteCommand('C:\Program Files\ibm\cognos\tm1_64\bin64\tm1top.exe', 0);

This assumes that a tm1top.ini file already exists in the C:\Program Files\ibm\cognos\tm1_64\bin64 directory. You can avoid using an tm1top.ini file with an ExecuteCommand function such as this:

ExecuteCommand('C:\Progra~1\ibm\cognos\tm1_64\bin64\tm1top.exe -adminhost tm1admin.domain.com -servername tm1model -logfile C:\tm1top.log -logperiod 2 -logappend T -refresh 2 ', 0);

2 - Create an inactive Chore that runs the Ti process created in step 1. In this example we will call the Chore tm1top. Here we can see both the Ti process and Chore with the same name



















3 - In the tm1s.cfg file set the following parameter:

StartupChores=tm1top

When the TM1 service is restarted tm1top.exe will start automatically. Note that the tm1top.exe process will not automatically end when the TM1 server next restarts. A scheduled chore to restart the TM1 server should first run an ExecuteCommand function to end the tm1top.exe process. For example:

ExecuteCommand('taskkill /f /im tm1top.exe', 0);

TM1Top does not include a date in the timestamp or logging!

This makes it difficult to know which section of the TM1Top log file to review when the TM1Top log file spans multiple days.

It is useful to compare logging at the same time from the TM1top and tm1server log files. Since the date isn't displayed in the TM1Top log file it can be difficult to determine what section of the tm1top log file to examine.

To make the TM1Top log file easier to understand we can generate a separate TM1Top log file for each day. This can be done using a scheduled Chore in the TM1 server as follows. The Chore can scheduled to run at the start of each day (e.g 12:01 AM).

Here is the prolog section of a Ti process that restarts TM1Top .

# 1- Location of TM1 bin64 directory
vTM1BinDir = 'C:\Program Files\ibm\cognos\tm1_64\bin64';
# 2- Host name of system running the TM1 Admin Server
vTM1AdminHost = 'localhost';
# 3 - TM1 model name
vTM1ServerName = 'Planning Sample';
# 4- Logging directory to store TM1Top log files
vLogDirectory = 'C:\TM1\Models\MyModel\logs';

vCommand = vTM1BinDir | '\tm1top.exe -adminhost ' | vTM1AdminHost | ' -servername "' | vTM1ServerName | '" -logfile "' | vLogDirectory | '\' | vTM1ServerName | '_tm1top_' | TODAY(0) | '.log" -logperiod 2 -logappend T -refresh 2';

# This stops any currently running tm1top.exe processes
ExecuteCommand('taskkill /f /im tm1top.exe', 1);
# This start the tm1top.exe process
ExecuteCommand(vCommand, 0);

Replace the four variables so they match the the TM1 server where this Chore is run.


1 comment: