Beware of Performance Monitor defaults spamming transaction log

The Performance Monitor in TM1 is a great tool to gather helpful statistics about your system and pinpoint all sorts of bottlenecks.

You can start the Performance Monitor in 2 ways:

Once performance monitor is turned on, it starts populating the }Stats control cubes and it updates them every minute.
Well, so far so good...
BUT by default in TM1, ALL cubes in }CubeProperties are set to log ALL transactions. That seems like a sane default, nobody wants to lose track of whom, when and by how much changed a cell in a cube.
So by default, the Performance Monitor will start spamming the transaction log, every minute of your entire server uptime. The problem is most acute with }StatsByCube, it logs one line for every cube, and for every }Element_Attributes_dimension cube.

There is a simple remedy: turn off logging in }CubeProperties for all }Stats cubes (IBM documentation is incomplete)
A quick Turbo Integrator process can do the job too:

CellPutS('NO', '}CubeProperties', '}StatsByClient',       'LOGGING');
CellPutS('NO', '}CubeProperties', '}StatsByCube',         'LOGGING');
CellPutS('NO', '}CubeProperties', '}StatsByCubeByClient', 'LOGGING');
CellPutS('NO', '}CubeProperties', '}StatsByRule',         'LOGGING');
CellPutS('NO', '}CubeProperties', '}StatsByProcess',      'LOGGING');
CellPutS('NO', '}CubeProperties', '}StatsByChore',        'LOGGING');
CellPutS('NO', '}CubeProperties', '}StatsForServer',      'LOGGING');

The size of the spamming could be just a few megabytes per day, though it will have an impact on how long your transaction searches take.
Also, the transaction log does not log rotate for a good reason, you don't want to lose any precious transactions. So, it will happily fill up the local drive and after a few months or years the server finally crashes.
If you notice the issue only now, it's not all lost. You don't have to keep all this spam thanks to this bash one-liner that will clean up your 50 gigabyte logs:

for f in tm1s20*log; do awk -F, '$8 != "\"}StatsByCube\""' "$f" > "$f".tmp && mv "$f".tmp "$f"; done # one line to rule them all

You will notice it is removing only "}StatsByCube". I could have added the other }StatsBy cubes, but these are literally 2 orders of magnitude less spammy than }StatsByCube on its own.

Challenge for you: try to achieve the same as the bash one-liner above in any language in less than the 79 characters above. I made it easy, I left a lot of superfluous characters. Constructive comments and answers are welcome.



Add new comment

The content of this field is kept private and will not be shown publicly.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.