1 
0                                                          Ref. B5
0              NCP : STATISTICS AND LOGGING  (Ref. B5)
+              ___   __________ ___ _______   ___  __
0                                               Version 2
+                                               _______ _
0                                               8 March 1982
+                                               _ _____ ____
0                                               P M Girard
+                                               _ _ ______
0  1.  Introduction
+      ____________
0       This paper relates specifically to  the VM version of NCP.
        The MVT version  uses SMF for statistics  collection,  and
        handles the logging disc in a somewhat different way.
0       A CMS-compatible minidisk is  used,  formatted entirely in
        4096-byte blocks.   Blocks 1 to 15 are used for statistics
        and the rest for logging.   The total size of the minidisk
        is currently 360 blocks.
-  2.  Statistics
+      __________
0       Blocks 1 to 7  and 8 to 14 provide storage  for 2 weeks of
        statistics, each day having its own 4096-byte block.
0       Monday always uses block 1 or block 8,  Tuesday uses block
        2 or block 9, and so on.
0       Week numbers  are calculated with  reference to  the clock
        base:  i.e:   1st January 1900 (which was a Monday).   The
        first week of January 1900 was week zero_.
+                                           ____
0       Even-numbered weeks use blocks 1 to 7;  odd-numbered weeks
        use blocks 8 to 14 (even if there are missing weeks due to
        computer shutdown, etc).
0       Block 15 is used as a  control record.   Only the first 10
        words of it are currently defined,   the rest of the block
        being liable to contain rubbish.
0       The minidisk  may be completely re-initialised  by running
        the DEFILOG  procedure.   This fills  all the  blocks with
        zeros and this is recognised as  a valid situation by NCP,
        by  the  statistics  analysis program,   and  by  the  log
        printing program.
0       When in use,  the control  block has the following defined
        contents:
0                Word 0 : Latest week no. for which statistics are
                       held.
- 
-  NCP : STATISTICS AND LOGGING                             PAGE 1
1 
0                                                          Ref. B5
0                Word 1 : Latest day no.  for which statistics are
                       held.
0                Word 2 :  Latest period no.  for which statistics
                       are held.
0                Words 3-5  :  Latest  date (day/month/year)   for
                       which statistics are held.
0                Words 6-9 : Zeros. Reserved for future use.
0       The 'day  no.' is  relative to  1st January  1900 counting
        from zero.  The 'period no.' is the period no.  (currently
        2-hour periods are used) relative to midnight,  the period
        from midnight to 2 a.m. being period zero.
0       At the beginning of a new week, all the blocks for the new
        week are re-initialised by filling  them with zeros except
        the  first word  of  each,  which  contains  the new  week
        number.  The first block is also provided with the current
        date in day/month/year form,  but  it should be noted that
        this is not necessarily the correct date for that day, for
        instance  if the  machine was  not  in use  on Monday  but
        started up on Tuesday.
0       The block used by each day is called a 'day-block' and has
        the following structure:
0                Word 0 : Week number.
0                Word 1 : Day number
0                Word 2  :  Most  recent period  number for  which
                       statistics are present.
0                Words 3-5 : Date (day/month/year)
0                Words 6-9 : Spare
0                Word 10 onwards : Accumulations
0       As  previously  stated,   a  newly  initialised  day-block
        contains zeros apart from the week number and (in the case
        of Mondays only) the date on which the initialisation took
        place.
0       The accumulations  are arranged as  follows.   The  day is
        divided into periods (currently  12 periods),  and various
+                    _______
        totals (currently 7 totals, such as CALLS,  PACKETS,  etc)
+       ______
        are  kept  for   a  number  of  protocols   (currently  11
+                                       _________
        protocols) within each period.  Each accumulation requires
        one word.
- 
0  NCP : STATISTICS AND LOGGING                             PAGE 2
1 
0                                                          Ref. B5
0       Thus the accumulations part of the block can be considered
        to form a FORTRAN array with a structure as follows:
0                INTEGER IACCUM (totals, protocols, periods)
0       The STATS process in NCP is written so that it is harmless
        to make it dispatchable at any time.   For instance it may
        be posted during termination procedures  to ensure that no
        statistics are lost.    Normally the process sets  a timer
        that should expire 5 seconds past each quarter-hour.   The
        5-second margin  eliminates all risk  of an  early posting
        due to rounding errors in calculating the interval.
0       On the first entry to STATS,   the control record is read.
        If  the   current  time  information  implies   that  some
        statistics have already been recorded for the current day,
        the day-block is  read into core and  accumulations resume
        from  that   base.    Otherwise   the  day-block   (or  if
        appropriate,    day-blocks  for   the   whole  week)    is
        initialised.  The control block is updated if necessary
0       On subsequent entries, totals accumulated by NCP are added
        into  the day-block,   at  the period  set  up during  the
        previous entry, and NCP's totals are cleared.   Everything
        is then  set up  ready for  the same  thing to  take place
        after the next posting.
0       If a disc error occurs, statistics cease to be taken,  and
        a  message is  sent  to the  operator's  console every  so
        often.    Resumption  of taking  statistics  cannot  occur
        without a program re-load,  but  this is a situation which
        should in practice never or only very rarely occur.
0       The statistics  for the  previous or  current week  can be
        printed off by means of the NSTAT procedure (Ref. F1).
-  3.  Logging
+      _______
0       The logging part of the  minidisk is used cyclically,  and
        should  have  enough  room  for  several  days  of  normal
        logging.   The NLOG  procedure (Ref.  F1)  can  be used to
        print off the  most recent 1000 lines or so  from the log,
        or to  print off  any range  of blocks  quoted explicitly.
        The LOGINDX procedure (Ref.  F1)  can be used to obtain an
        index of the  log.   When diagnostic printing  is switched
        on,  the log will of course fill up much more rapidly than
        usual.  Failure to print the log has no consequences apart
        from  loss of  the information  when NCP  begins its  next
        cycle round the file.
0       Logging information is stored in 56-byte records, of which
        up to  73 will fit into  a 4096-byte block.   The  data is
- 
   NCP : STATISTICS AND LOGGING                             PAGE 3
1 
0                                                          Ref. B5
0       encoded  in  a  special format  which  cannot  be  printed
        directly.    The NLOG  procedure interprets  the data  and
        converts it to printable form.
-  4.  References
+      __________
0       F1: VMNCP : Operators' Documentation
                         (P M Girard)
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
- 
-  NCP : STATISTICS AND LOGGING                             PAGE 4