Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CAVERNnet_perfMonitor_c.hxx

00001 /******************************************************************
00002  * CAVERNsoft
00003  * Copyright (C) 1994-2000 Electronic Visualization Laboratory,
00004  * all rights reserved
00005  * By Jason Leigh, Yong-joo Cho, Naveen Krishnaprasad, Chris Scharver,
00006  * Stuart Bailey, Atul Nayak, Shalini Venkataraman
00007  * University of Illinois at Chicago
00008  * 
00009  * This publication and its text and code may not be copied for commercial 
00010  * use without the express written permission of the University of Illinois
00011  * at Chicago.
00012  * The contributors disclaim any representation of warranty: use this
00013  * code at your own risk.
00014  * Direct questions, comments etc to cavern@evl.uic.edu
00015  ******************************************************************/
00016 
00017 #ifndef _CAVERNNET_PERFMONITOR_C
00018 #define _CAVERNNET_PERFMONITOR_C
00019 
00020 #ifdef CAVERN_USE_GLOBUS_THREADS
00021 #include "globus_common.h"
00022 #endif
00023 
00024 #ifdef CAVERN_USE_PTHREADS
00025 #include <pthread.h>
00026 #endif
00027 
00028 #include <errno.h>
00029 
00030 #include "CAVERNnet_socketbase_c.hxx"
00031 #include "CAVERNnet_perfDaemon_c.hxx"
00032 
00033 #define DEFAULT_BUFFER_SIZE 1024
00034 #define _STREAM_INFO_SIZE 256
00035 
00036 class CAVERNnet_perfDaemonClient_c;
00037 
00038 
00056 class CAVERNnet_perfMonitor_c: public CAVERNnet_socketbase_c
00057 {
00058 public:
00059     
00061 
00062 
00063     static const int OK; //=0
00064     
00066     static const int FAILED;  //=1
00068     CAVERNnet_perfMonitor_c();
00069 
00070     ~CAVERNnet_perfMonitor_c();
00071 
00072     //set the source and destination IPs of the machines communicating over the network - not to be used by the user
00073     void setIPs(char* selfIp, char* remoteIp);
00074    
00075     //set the source and destination ports of the machines communicating over the network - not to be used by the user
00076 
00077     void setPorts(int selfPort, int remotePort);
00078     
00091     void showStats(char* streamInfo, char* comment);
00092 
00109     int logStats(char* streamInfo, char* comment, FILE* filePtr);
00110 
00127     int sendStats(char* streamInfo, char* comment);
00128     
00143     int initSendStats(char* monitorClientIP, int port = CAVERNnet_perfDaemon_c::DEFAULT_PORT);
00144     
00149     void exitSendStats();
00150     
00151 private:
00152 
00153     //source and destination IP's of the machines communicating over the network
00154     char *selfIp, *remoteIp;
00155     
00156    //source and destination ports of the machines communicating over the network    
00157 
00158     int selfPort, remotePort;
00159     
00160     //The buffer in which the resultant stats is stored in netlogger format
00161 
00162     char* resultantStats;
00163     
00164     //A perfDaemonClient used to connect to a perfDaemon to send the resultant statistics
00165 
00166     CAVERNnet_perfDaemonClient_c* aClient;
00167     
00168     //Upate the performance statistics
00169     void updateStats(char* streamInfo, char* comment);
00170     
00171     
00172 };
00173 
00174 
00175 
00176 
00177 #endif
00178 
00179 
00180 
00181 
00182 
00183 
00184 
00185 

Generated at Mon Jul 2 14:24:42 2001 for CAVERNsoft by doxygen1.2.8-20010617 written by Dimitri van Heesch, © 1997-2001