1 2 /* Web Polygraph http://www.web-polygraph.org/ 3 * Copyright 2003-2011 The Measurement Factory 4 * Licensed under the Apache License, Version 2.0 */ 5 6 #ifndef POLYGRAPH__LOGANALYZERS_LOADSTEXES_H 7 #define POLYGRAPH__LOGANALYZERS_LOADSTEXES_H 8 9 #include "loganalyzers/LoadStex.h" 10 11 // total side load (all requests or all responses) 12 class SideLoadStex: public LoadStex { 13 public: 14 typedef double (StatIntvlRec::*StatPtr)() const; 15 16 public: 17 SideLoadStex(const String &aKey, const String &aName, StatPtr aRate, StatPtr aBwidth); 18 19 virtual double rate(const StatIntvlRec &rec) const; 20 virtual double bwidth(const StatIntvlRec &rec) const; 21 22 protected: 23 StatPtr theRateStats; 24 StatPtr theBwidthStats; 25 }; 26 27 // load based on TmSzStex 28 class TmSzLoadStex: public LoadStex { 29 public: 30 TmSzLoadStex(const Stex *aStex); 31 32 virtual double rate(const StatIntvlRec &rec) const; 33 virtual double bwidth(const StatIntvlRec &rec) const; 34 35 protected: 36 const Stex *theStex; 37 }; 38 39 40 #if FUTURE_CODE 41 // load based on TmSzStat data 42 class TmSzLoadStex: public LoadStex { 43 public: 44 typedef TmSzStat (StatIntvlRec::*StatPtr); 45 46 public: TmSzLoadStex(const String & aKey,const String & aName,StatPtr aStats)47 TmSzLoadStex(const String &aKey, const String &aName, StatPtr aStats): 48 LoadStex(aKey, aName), theStats(aStats) {} 49 50 virtual double rate(const StatIntvlRec &rec) const; 51 virtual double bwidth(const StatIntvlRec &rec) const; 52 53 protected: 54 StatPtr theStats; 55 }; 56 57 // load based on HRStat data 58 class HrLoadStex: public LoadStex { 59 public: 60 typedef HRStat (StatIntvlRec::*StatPtr); 61 62 public: HrLoadStex(const String & aKey,const String & aName,StatPtr aStats)63 HrLoadStex(const String &aKey, const String &aName, StatPtr aStats): 64 LoadStex(aKey, aName), theStats(aStats) {} 65 66 virtual double rate(const StatIntvlRec &rec) const; 67 virtual double bwidth(const StatIntvlRec &rec) const; 68 69 protected: 70 StatPtr theStats; 71 }; 72 #endif 73 74 // total protocol-specific side load (all protocol messages) 75 class ProtoSideLoadStex: public LoadStex { 76 public: 77 typedef double (ProtoIntvlStat::*StatPtr)(Time) const; 78 typedef ProtoIntvlStat StatIntvlRec::*ProtoPtr; 79 80 public: 81 ProtoSideLoadStex(const String &aKey, const String &aName, 82 ProtoPtr aProto, StatPtr aRate, StatPtr aBwidth); 83 84 virtual double rate(const StatIntvlRec &rec) const; 85 virtual double bwidth(const StatIntvlRec &rec) const; 86 87 protected: 88 ProtoPtr theProto; 89 StatPtr theRateStats; 90 StatPtr theBwidthStats; 91 }; 92 93 #endif 94