00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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;
00064
00066 static const int FAILED;
00068
00069
00070 ~CAVERNnet_perfMonitor_c();
00071
00072
00073 void setIPs(char* selfIp, char* remoteIp);
00074
00075
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
00154 char *selfIp, *remoteIp;
00155
00156
00157
00158 int selfPort, remotePort;
00159
00160
00161
00162 char* resultantStats;
00163
00164
00165
00166 CAVERNnet_perfDaemonClient_c* aClient;
00167
00168
00169 void updateStats(char* streamInfo, char* comment);
00170
00171
00172 };
00173
00174
00175
00176
00177 #endif
00178
00179
00180
00181
00182
00183
00184
00185