00001 #ifndef _SMProxyServer_h
00002 #define _SMProxyServer_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <string>
00019 #include <list>
00020
00021 #include "FWCore/PluginManager/interface/ProblemTracker.h"
00022 #include "FWCore/Utilities/interface/Exception.h"
00023 #include "FWCore/MessageService/interface/MessageServicePresence.h"
00024 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00025
00026 #include "EventFilter/Utilities/interface/Css.h"
00027 #include "EventFilter/Utilities/interface/RunBase.h"
00028 #include "EventFilter/Utilities/interface/StateMachine.h"
00029
00030 #include "EventFilter/SMProxyServer/interface/DataProcessManager.h"
00031 #include "EventFilter/StorageManager/interface/SMPerformanceMeter.h"
00032 #include "EventFilter/StorageManager/interface/SMFUSenderList.h"
00033
00034 #include "xdaq/Application.h"
00035 #include "xdaq/ApplicationContext.h"
00036
00037 #include "xdata/String.h"
00038 #include "xdata/UnsignedInteger32.h"
00039 #include "xdata/Integer.h"
00040 #include "xdata/Double.h"
00041 #include "xdata/Boolean.h"
00042 #include "xdata/Vector.h"
00043
00044 #include "xgi/Input.h"
00045 #include "xgi/Output.h"
00046 #include "xgi/exception/Exception.h"
00047
00048 #include "boost/shared_ptr.hpp"
00049 #include "boost/thread/thread.hpp"
00050
00051 namespace stor {
00052
00053 class SMProxyServer: public xdaq::Application,
00054 public xdata::ActionListener,
00055 public evf::RunBase
00056 {
00057 public:
00058 SMProxyServer(xdaq::ApplicationStub* s) throw (xdaq::exception::Exception);
00059
00060 ~SMProxyServer();
00061
00062
00063 xoap::MessageReference ParameterGet(xoap::MessageReference message)
00064 throw (xoap::exception::Exception);
00065
00066
00067 void setupFlashList();
00068 void actionPerformed(xdata::Event& e);
00069
00070
00071 bool configuring(toolbox::task::WorkLoop* wl);
00072 bool enabling(toolbox::task::WorkLoop* wl);
00073 bool stopping(toolbox::task::WorkLoop* wl);
00074 bool halting(toolbox::task::WorkLoop* wl);
00075
00076
00077 xoap::MessageReference fsmCallback(xoap::MessageReference msg)
00078 throw (xoap::exception::Exception);
00079
00080
00082 private:
00083 void checkDirectoryOK(std::string dir);
00084
00085 void defaultWebPage
00086 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00087 void css(xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception)
00088 {css_.css(in,out);}
00089 void smsenderWebPage
00090 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00091 void DQMOutputWebPage
00092 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00093 void eventdataWebPage
00094 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00095 void headerdataWebPage
00096 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00097 void consumerWebPage
00098 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00099 void consumerListWebPage
00100 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00101 void eventServerWebPage
00102 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00103 void DQMeventdataWebPage
00104 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00105 void DQMconsumerWebPage
00106 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00107
00108 void receiveEventWebPage
00109 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00110 void receiveDQMEventWebPage
00111 (xgi::Input *in, xgi::Output *out) throw (xgi::exception::Exception);
00112
00113 evf::StateMachine fsm_;
00114 std::string reasonForFailedState_;
00115
00116 edm::AssertHandler *ah_;
00117 edm::service::MessageServicePresence theMessageServicePresence;
00118
00119 boost::shared_ptr<stor::DataProcessManager> dpm_;
00120 boost::mutex halt_lock_;
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131 xdata::Boolean collateDQM_;
00132 xdata::Boolean archiveDQM_;
00133 xdata::Integer archiveIntervalDQM_;
00134 xdata::String filePrefixDQM_;
00135 xdata::Integer purgeTimeDQM_;
00136 xdata::Integer readyTimeDQM_;
00137 xdata::Boolean useCompressionDQM_;
00138 xdata::Integer compressionLevelDQM_;
00139
00140 evf::Css css_;
00141 xdata::UnsignedInteger32 receivedEvents_;
00142 xdata::UnsignedInteger32 receivedDQMEvents_;
00143
00144
00145 std::vector<unsigned char> mybuffer_;
00146 xdata::Vector<xdata::String> smRegList_;
00147 xdata::String consumerName_;
00148 xdata::String DQMconsumerName_;
00149
00150 xdata::Double maxESEventRate_;
00151 xdata::Double maxESDataRate_;
00152 xdata::Double maxEventRequestRate_;
00153 xdata::Integer activeConsumerTimeout_;
00154 xdata::Integer idleConsumerTimeout_;
00155 xdata::Integer consumerQueueSize_;
00156 xdata::Boolean fairShareES_;
00157 xdata::Double DQMmaxESEventRate_;
00158 xdata::Double maxDQMEventRequestRate_;
00159 xdata::Integer DQMactiveConsumerTimeout_;
00160 xdata::Integer DQMidleConsumerTimeout_;
00161 xdata::Integer DQMconsumerQueueSize_;
00162 xdata::String esSelectedHLTOutputModule_;
00163
00164 std::map< std::string, bool > smsenders_;
00165 xdata::UnsignedInteger32 connectedSMs_;
00166
00167 xdata::UnsignedInteger32 storedDQMEvents_;
00168 xdata::UnsignedInteger32 sentEvents_;
00169 xdata::UnsignedInteger32 sentDQMEvents_;
00170
00171
00172
00173
00174
00175
00176 void addMeasurement(unsigned long size);
00177 void addOutMeasurement(unsigned long size);
00178 stor::SMPerformanceMeter *outpmeter_;
00179
00180
00181 xdata::UnsignedInteger32 samples_;
00182 xdata::Double instantBandwidth_;
00183 xdata::Double instantRate_;
00184 xdata::Double instantLatency_;
00185 xdata::Double maxBandwidth_;
00186 xdata::Double minBandwidth_;
00187 xdata::Double outinstantBandwidth_;
00188 xdata::Double outinstantRate_;
00189 xdata::Double outinstantLatency_;
00190 xdata::Double outmaxBandwidth_;
00191 xdata::Double outminBandwidth_;
00192 xdata::Double receivedVolume_;
00193 xdata::Double outreceivedVolume_;
00194
00195
00196 xdata::Double duration_;
00197 xdata::UnsignedInteger32 totalSamples_;
00198 xdata::Double meanBandwidth_;
00199 xdata::Double meanRate_;
00200 xdata::Double meanLatency_;
00201 xdata::Double outduration_;
00202 xdata::UnsignedInteger32 outtotalSamples_;
00203 xdata::Double outmeanBandwidth_;
00204 xdata::Double outmeanRate_;
00205 xdata::Double outmeanLatency_;
00206
00207
00208 xdata::UnsignedInteger32 period4samples_;
00209 xdata::Double instantBandwidth2_;
00210 xdata::Double instantRate2_;
00211 xdata::Double instantLatency2_;
00212 xdata::Double maxBandwidth2_;
00213 xdata::Double minBandwidth2_;
00214 xdata::Double outinstantBandwidth2_;
00215 xdata::Double outinstantRate2_;
00216 xdata::Double outinstantLatency2_;
00217 xdata::Double outmaxBandwidth2_;
00218 xdata::Double outminBandwidth2_;
00219
00220
00221 xdata::Double duration2_;
00222 xdata::UnsignedInteger32 totalSamples2_;
00223 xdata::Double meanBandwidth2_;
00224 xdata::Double meanRate2_;
00225 xdata::Double meanLatency2_;
00226 xdata::Double outduration2_;
00227 xdata::UnsignedInteger32 outtotalSamples2_;
00228 xdata::Double outmeanBandwidth2_;
00229 xdata::Double outmeanRate2_;
00230 xdata::Double outmeanLatency2_;
00231
00232
00233 xdata::String class_;
00234 xdata::UnsignedInteger32 instance_;
00235 xdata::String url_;
00236
00237 xdata::Double storedVolume_;
00238 xdata::UnsignedInteger32 memoryUsed_;
00239 xdata::String progressMarker_;
00240 enum
00241 {
00242 DEFAULT_PURGE_TIME = 120,
00243 DEFAULT_READY_TIME = 30
00244 };
00245 };
00246 }
00247
00248
00249 #endif