Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

NML_DIAGNOSTICS_INFO Class Reference

#include <nmldiag.hh>

Inheritance diagram for NML_DIAGNOSTICS_INFO:

Inheritance graph
[legend]
Collaboration diagram for NML_DIAGNOSTICS_INFO:

Collaboration graph
[legend]

Public Methods

void print ()

Member Function Documentation

void NML_DIAGNOSTICS_INFO::print  
 

Definition at line 23 of file nmldiag.cc.

Referenced by nml_print_diag_list().

00024 {
00025   if (NULL != last_writer_dpi)
00026     {
00027       rcs_print ("Last writer = %d (%s)\n", last_writer,
00028                  last_writer_dpi->name);
00029     }
00030   if (NULL != last_reader_dpi)
00031     {
00032       rcs_print ("Last reader = %d (%s)\n", last_reader,
00033                  last_reader_dpi->name);
00034     }
00035   if (NULL == dpis)
00036     {
00037       return;
00038     }
00039   CMS_DIAG_PROC_INFO *dpi = (CMS_DIAG_PROC_INFO *) dpis->get_head ();
00040   while (NULL != dpi)
00041     {
00042       rcs_print ("\n");
00043       rcs_print ("Info for process %s:\n", dpi->name);
00044       rcs_print ("\t Host and system info: %s\n", dpi->host_sysinfo);
00045       rcs_print ("\t Process Id: %d\n", dpi->pid);
00046       rcs_print ("\t RCS Library Version: %f\n", dpi->rcslib_ver);
00047       if (dpi->access_type >= 0 && dpi->access_type <= 9)
00048         {
00049           rcs_print ("\t Last operation:  %d (%s)\n", dpi->access_type,
00050                      access_name[dpi->access_type]);
00051         }
00052       rcs_print ("\t msg_id: %d\n", dpi->msg_id);
00053       rcs_print ("\t msg_size: %d\n", dpi->msg_size);
00054       rcs_print ("\t msg_type: %d\n", dpi->msg_type);
00055       rcs_print ("\t number_of_accesses: %d\n", dpi->number_of_accesses);
00056       rcs_print ("\t number_of_new_messages: %d\n",
00057                  dpi->number_of_new_messages);
00058       rcs_print ("\t bytes_moved: %f\n", dpi->bytes_moved);
00059       time_t t = 0;
00060 #ifndef VXWORKS
00061       char *ctime_ret = "";
00062       if (dpi->first_access_time > 0.0)
00063         {
00064           t = (time_t) dpi->first_access_time;
00065           ctime_ret = ctime (&t);
00066           if (NULL == ctime_ret)
00067             {
00068               ctime_ret = "";
00069             }
00070         }
00071       rcs_print ("\t first_access_time: %f :  %s\n", dpi->first_access_time,
00072                  ctime_ret);
00073       ctime_ret = "";
00074       if (dpi->last_access_time > 0.0)
00075         {
00076           t = (time_t) dpi->last_access_time;
00077           ctime_ret = ctime (&t);
00078           if (NULL == ctime_ret)
00079             {
00080               ctime_ret = "";
00081             }
00082         }
00083       rcs_print ("\t last_access_time: %f  : %s\n", dpi->last_access_time,
00084                  ctime_ret);
00085 #else
00086       rcs_print ("\t first_access_time: %f\n", dpi->first_access_time);
00087       rcs_print ("\t last_access_time: %f\n", dpi->last_access_time);
00088 #endif
00089 
00090       if (dpi->max_difference >= dpi->min_difference)
00091         {
00092           rcs_print ("\t Maximum time between accesses: %f\n",
00093                      dpi->max_difference);
00094           rcs_print ("\t Minumum time between accesses: %f\n",
00095                      dpi->min_difference);
00096         }
00097       double total_time = dpi->last_access_time - dpi->first_access_time;
00098       if (total_time > 0)
00099         {
00100           int h, m, s;
00101           h = ((int) total_time) / 3600;
00102           m = ((int) total_time - h * 60) / 60;
00103           s = ((int) total_time - h * 3600 - m * 60);
00104           rcs_print
00105             ("\t Time between first and last access: %f -- %02.2d:%02.2d:%02.2d\n",
00106              total_time, h, m, s);
00107           if (dpi->number_of_accesses > 0)
00108             {
00109               rcs_print ("\t Average time between accesses: %f\n",
00110                          (total_time) / dpi->number_of_accesses);
00111             }
00112           if (dpi->number_of_new_messages > 0)
00113             {
00114               rcs_print ("\t Average time between new messages: %f\n",
00115                          (total_time) / dpi->number_of_new_messages);
00116             }
00117           if (dpi->bytes_moved > 0)
00118             {
00119               rcs_print ("\t Average bytes moved per second: %f\n",
00120                          dpi->bytes_moved / (total_time));
00121             }
00122         }
00123       if (dpi->bytes_moved > 0 && dpi->number_of_new_messages > 0)
00124         {
00125           rcs_print ("\t Average bytes moved per message: %f\n",
00126                      dpi->bytes_moved / (dpi->number_of_new_messages));
00127         }
00128       dpi = (CMS_DIAG_PROC_INFO *) dpis->get_next ();
00129     }
00130 }


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 15:58:46 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001