Message traffic monitor

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Message traffic monitor

  • Creator
    Topic
  • #49693
    Rentian Huang
    Participant

    Greetings Cloverleafers!!!

    Anyone know a utility that can be used to monitor message traffic in Cloverleaf? For example, to find out how many messages at 1am, 4pm or 10:20am, etc.

    So far I don’t see any tool in the Engine that do that.

    Thanks in advance!

    Sam  8)

Viewing 12 reply threads
  • Author
    Replies
    • #63136
      Rentian Huang
      Participant

      Can anyone help??

    • #63137
      Jim Kosloskey
      Participant

      Rentian,

      If you cycle your SMAT files, you can write something to report on the number of records in the .idx file(s).

      If all you want to do is find out your peak demand period, that is the way I would go. It is fairly quick and is very specific.

      You will need to organize these to associate threads appropriately.

      Or you could write something dumping out the appropriate value from msi.

      I am not aware of anything that is included with Cloverleaf(R) to do the statistics reporting you desire. You will need to write your own.

      The approach I took was to have a module which dumps the msi stats to a delimited file which then could be imported into whatever analysis tool (Excel, Access, stats program, etc.) one wants to analyze the data.

      However, the effort is not in collecting the data, but rather analyzing it. I do not know that anyone who has received the module I wrote (including my employers) has ever made the effort to actually analyze the data.

      I can tell you that it is only the beginning to start counting messages. Next there will be a need to know how many Admits, and/or Micro Orders or Results, and/or distribution among departments, and/or etc. One wants to see bar charts, one wants pie charts, the next just need tabular data, the next wants trends, and on and on…

      I think you get the picture – the thirst for statistics seems to never be slaked. Once you start down that road it can quickly become a full time occupation – but not a known project.

      My philosophy – better I give the ones who want the statistics the raw data and a tool they can use and let them exhaust themselves playing with the numbers, while I go on to try and take care of the crazy integrations.

      Well that’s my .02 worth.

      Jim Kosloskey

      email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

    • #63138
      Rick Pritchett
      Participant

      could i get a copy of your stats module

    • #63139
      Rentian Huang
      Participant

      Jim,

      Thanks so much for the suggestion and sorry for the late reply, I was super busy these days. I think you depicted the picture very well, we here just want to analyse the data, using Excel to build chart base on them…

      Any chance that you can share your module with me or Rickey?

      Good day,

      Sam

    • #63140
      Huy Tran
      Participant

      The below link works for me, posted by Brad Dorr. I run this script at 11:30 pm to collect stats for my site. This script creates .csv file with tons of information. I modified it fit management needs: sitename, threadname, message_in, message_out, etc…

      The boss likes it  ðŸ˜€

      Thanks Brad.

      http://clovertech.infor.com/viewtopic.php?t=1473

    • #63141
      James Cobane
      Participant

      Rentian,

      Attached is a perl script that you can run against a SMAT file to produce a histogram of the transaction counts for the specified time interval.  It’s a nice little script that was posted some time ago by another Clovertecher (Brian Urch).

          Usage is:   histsmat.p SMATFILE.idx minutes

      where SMATFILE is the name of the saved message file to run against and minutes is the time interval (i.e. every xx minutes).

      (change the extension of the attached file from .txt to .p)

      Jim Cobane

      Henry Ford Health

    • #63142
      Bob Richardson
      Participant

      Greetings,

      James, the attachment/download feature of the Clovertech Forum does not work:  it appears that all white space is scrubbed out and the file contents are compressed.  Well, in trying to run the script on AIX Unix (after converting the embedded OD OA to OA) there are errors like unmatched braces, etc.  I suspect that critical white space is now missing.

      In a call to Quovadx tech support, the attachment feature is broken and not planned to be repaired at this time.

      Would you please do a cut and paste of the perl script to an email in this forum?  Crude but effective.

      And, thanks in advance!

    • #63143
      Rentian Huang
      Participant

      Hi all,

      Among these solutions, I found James’ script meets my need pretty beautifully. It’s very handy and the nice thing is it gives a histogram.

      I am attaching the code here since some of you could not open the attachment. You need to change the first line to reflect your environment thou. AND YES, Microsoft adds those craps at the end of all lines if you open or save it in a Window Env.

      You all have my thanks!!!

      Sam 8)

      Code:

      #!/qvdx/qdx5.4.1/integrator/bin/perl

      ########################################################################
      #
      #  Program: histSmat.p
      #
      #  Author: Brian Urch
      # Helix Health
      # Baltimore, Md
      #
      #  Description: Display a histogram that represents the number of
      # transactions over a specified time period.
      #
      #  Usage: histSmat.p filename.idx minutes
      #
      ########################################################################

      if ( $#ARGV != 1 || $ARGV[0] !~ /.idx$/ )
      {
         printUsage();
      }

      $file = $ARGV[0];
      $minutes = $ARGV[1];

      open( FH, “< $file" ) || die "cannot open $file: $!n"; %countAry = (); # #  {TIME 885359015} # while ( )
      {
         if ( /{TIME ([0-9]*)/ )
         {
      $curTime = $1;
         }

         if ( /{LENGTH ([0-9]*)/ )
         {
      $length = $1;

      if ( $length > 3 )
      {
                 ( $min, $hour ) = ( localtime( $curTime ))[1..2];
         $curMinutes = ( $hour * 60 ) + $min;

         $minIndex = ( $curMinutes + $minutes – 1 );
         $minIndex -= ( $minIndex % $minutes );

         $countAry{ $minIndex }++;
      }
         }
      }

      #
      #  Get the largest count and the first and last time.
      #
      $firstTime = -1;
      $largest = 0;

      foreach $key ( sort {$a <=> $b} ( keys( %countAry)))
      {
         if ( $firstTime == -1 )
         {
      $firstTime = $key;
         }

         if ( $countAry{ $key } > $largest )
         {
      $largest = $countAry{ $key };
         }

         $lastTime = $key;
      }
      #print “first <$firstTime> last <$lastTime> largest <$largest>n”;

      #
      #  Print the histogram.
      #
      $total = 0;

      while ( $firstTime <= $lastTime ) {    $hour = $firstTime / 60;    $min = $firstTime % 60;    if ( defined $countAry{ $firstTime } )    {        $total += $countAry{ $firstTime }; $hist = ( $countAry{ $firstTime } / $largest ) * 65;        printf "%.2d:%.2d %5d ", $hour, $min, $countAry{ $firstTime }; print "#" x $hist, "n";    }    else    { printf "%.2d:%.2d     0n", $hour, $min;    }    $firstTime += $minutes; } print "----- -----n"; printf "Total %5dn", $total; sub printUsage {    ( $program = $0 ) =~ s,.*/,,;    print "Usage: $program smat_file.idx minutesn";    exit 200; }

    • #63144

      Could you paste some example output? All I’m getting is something like this …

      Code:

      [hci@QDXTEST:bn10]> /hci/bin/histsmat.pl tmp.idx 1440
      24:00  5895 #################################################################
      —– —–
      Total  5895
      [hci@QDXTEST:bn10]>

      -- Max Drown (Infor)

    • #63145
      Scott Lee
      Participant

      Your output looks correct.

    • #63146

      Groovy.

      Code:

      [hci@cloverleaf:bn10]> /hci/bin/histsmat.pl bn10ms4_in.tin.idx 60
      01:00   111 #######
      02:00    60 ####
      03:00    61 ####
      04:00    21 #
      05:00    59 ###
      06:00   100 ######
      07:00   194 #############
      08:00   468 ###############################
      09:00   686 #############################################
      10:00   884 ###########################################################
      11:00   970 #################################################################
      12:00   710 ###############################################
      13:00   604 ########################################
      14:00   901 ############################################################
      15:00   210 ##############
      —– —–
      Total  6039

      -- Max Drown (Infor)

    • #63147
      Rentian Huang
      Participant

      That was exactly what I got, adjust the minutes to see different level of details.

    • #63148
      Kevin Crist
      Participant

      My apologies for using an old post but i have been trying to get this script to work but not sure what i’m doing wrong? Why i keep getting an error.  This isn’t my strong suit so any help is cool.

      Thanks.

Viewing 12 reply threads
  • The forum ‘Cloverleaf’ is closed to new topics and replies.

Forum Statistics

Registered Users
5,117
Forums
28
Topics
9,292
Replies
34,432
Topic Tags
286
Empty Topic Tags
10