/* Web Polygraph http://www.web-polygraph.org/ * (C) 2003-2006 The Measurement Factory * Licensed under the Apache License, Version 2.0 */ #ifndef POLYGRAPH__PROBE_POLYPROBE_H #define POLYGRAPH__PROBE_POLYPROBE_H #include "xstd/NetAddr.h" #include "xstd/String.h" #include "xstd/Array.h" #include "xstd/FileScanner.h" #include "xstd/AlarmClock.h" #include "base/CmdLine.h" #include "probe/ProbeSrv.h" class ProbeAgent; class ProbeClt; class ProbeSrv; class ProbeLinkRec; // exhanges simple messages with in mesh of like applications // to measure "raw" network performance of multiple-host benches class PolyProbe: public AlarmUser, protected FileScanner::User { public: PolyProbe(); virtual ~PolyProbe(); int run(int argc, char *argv[]); void sendStats(Socket &s, const NetAddr &to); virtual void wakeUp(const Alarm &a); protected: void start(); void step(Time tout); bool handleCmdLine(int argc, char *argv[]); void configureLogs(int prec); void configureHosts(); void configure(); void setResourceLimits(); void configureHosts(const Array &ranges, Array &allHosts, Array &lclHosts); void dumpHostSpace(const Array &clients, const Array &servers); void dumpHosts(ostream &os, const Array &hosts); void dumpHosts(ostream &os, const Array &hosts); void pullStats(); void reportCfg() const; void reportStats() const; protected: CmdLine theCmdLine; String thePrgName; Array theAllClients; Array theAllServers; Array theClients; Array theServers; Array theAgents; bool exchangingStats; bool mustStop; }; extern PolyProbe *ThePolyProbe; extern FileScanner *TheFileScanner; #endif