CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/EventFilter/StorageManager/interface/SMWebPageHelper.h

Go to the documentation of this file.
00001 // $Id: SMWebPageHelper.h,v 1.4 2011/11/18 14:47:56 mommsen Exp $
00003 
00004 #ifndef EventFilter_StorageManager_SMWebPageHelper_h
00005 #define EventFilter_StorageManager_SMWebPageHelper_h
00006 
00007 #include <string>
00008 #include <map>
00009 
00010 #include "toolbox/mem/Pool.h"
00011 #include "xdaq/ApplicationDescriptor.h"
00012 #include "xgi/Output.h"
00013 
00014 #include "EventFilter/Utilities/interface/Css.h"
00015 
00016 #include "EventFilter/StorageManager/interface/ConsumerWebPageHelper.h"
00017 #include "EventFilter/StorageManager/interface/RegistrationCollection.h"
00018 #include "EventFilter/StorageManager/interface/SharedResources.h"
00019 #include "EventFilter/StorageManager/interface/StatisticsReporter.h"
00020 #include "EventFilter/StorageManager/interface/Utils.h"
00021 #include "EventFilter/StorageManager/interface/WebPageHelper.h"
00022 #include "EventFilter/StorageManager/interface/XHTMLMaker.h"
00023 
00024 
00025 namespace stor {
00026 
00027   class DQMEventMonitorCollection;
00028   class FilesMonitorCollection;
00029   class FragmentMonitorCollection;
00030   class ResourceMonitorCollection;
00031   class RunMonitorCollection;
00032   class StreamsMonitorCollection;
00033 
00034 
00043   class SMWebPageHelper : public WebPageHelper<SMWebPageHelper>
00044   {
00045   public:
00046 
00047     SMWebPageHelper
00048     (
00049       xdaq::ApplicationDescriptor*,
00050       SharedResourcesPtr
00051     );
00052 
00056     void defaultWebPage(xgi::Output*) const;
00057 
00061     void inputWebPage(xgi::Output*) const;
00062 
00066     void storedDataWebPage(xgi::Output*) const;
00067 
00071     void filesWebPage(xgi::Output*) const;
00072 
00076     void consumerStatistics(xgi::Output*) const;
00077 
00081     void resourceBrokerOverview(xgi::Output*) const;
00082 
00086     void resourceBrokerDetail(xgi::Output*, const long long& uniqueRBID) const;
00087 
00091     void dqmEventWebPage(xgi::Output*) const;
00092 
00096     void throughputWebPage(xgi::Output*) const;
00097         
00098     
00099   private:
00100 
00104     XHTMLMaker::Node* createWebPageBody
00105     (
00106       XHTMLMaker&,
00107       const std::string& pageTitle,
00108       const StateMachineMonitorCollection&
00109     ) const;
00110     
00114     void addDOMforHyperLinks(XHTMLMaker&, XHTMLMaker::Node* parent) const;
00115 
00119     void addDOMforSummaryInformation
00120     (
00121       XHTMLMaker&,
00122       XHTMLMaker::Node* parent,
00123       DataSenderMonitorCollection const&,
00124       StreamsMonitorCollection const&,
00125       EventConsumerMonitorCollection const&,
00126       DQMEventMonitorCollection const&,
00127       RegistrationCollectionPtr
00128     ) const;
00129 
00133     void addDOMforResourceUsage
00134     (
00135       XHTMLMaker&,
00136       XHTMLMaker::Node* parent,
00137       ResourceMonitorCollection const&,
00138       ThroughputMonitorCollection const&
00139     ) const;
00140 
00144     void addDOMforFragmentMonitor
00145     (
00146       XHTMLMaker& maker,
00147       XHTMLMaker::Node* parent,
00148       FragmentMonitorCollection const&
00149     ) const;
00150 
00154     void addDOMforRunMonitor
00155     (
00156       XHTMLMaker& maker,
00157       XHTMLMaker::Node* parent,
00158       RunMonitorCollection const&
00159     ) const;
00160 
00164     void addDOMforStoredData
00165     (
00166       XHTMLMaker& maker,
00167       XHTMLMaker::Node* parent,
00168       StreamsMonitorCollection const&
00169     ) const;
00170 
00174     void addDOMforConfigString
00175     (
00176       XHTMLMaker& maker,
00177       XHTMLMaker::Node* parent,
00178       DiskWritingParams const&
00179     ) const;
00180 
00184     void addDOMforFiles
00185     (
00186       XHTMLMaker& maker,
00187       XHTMLMaker::Node* parent,
00188       FilesMonitorCollection const&
00189     ) const;
00190 
00194     void addDOMforThroughputStatistics
00195     (
00196       XHTMLMaker& maker,
00197       XHTMLMaker::Node* parent,
00198       ThroughputMonitorCollection const&
00199     ) const;
00200     
00205     double getServedConsumerBandwidth
00206     (
00207       const std::string& label,
00208       RegistrationCollectionPtr,
00209       const EventConsumerMonitorCollection& eventConsumerCollection
00210     ) const;
00211     
00215     void addRowForThroughputStatistics
00216     (
00217       XHTMLMaker& maker,
00218       XHTMLMaker::Node* table,
00219       const ThroughputMonitorCollection::Stats::Snapshot&,
00220       bool const isAverage = false
00221     ) const;
00222 
00226     void listStreamRecordsStats
00227     (
00228       XHTMLMaker& maker,
00229       XHTMLMaker::Node* table,
00230       StreamsMonitorCollection const&,
00231       const MonitoredQuantity::DataSetType
00232     ) const;
00233 
00237     void addFragmentStats
00238     (
00239       XHTMLMaker& maker,
00240       XHTMLMaker::Node* table,
00241       FragmentMonitorCollection::FragmentStats const&,
00242       const MonitoredQuantity::DataSetType
00243     ) const;
00244     
00248     void addRowForFramesReceived
00249     (
00250       XHTMLMaker& maker,
00251       XHTMLMaker::Node* table,
00252       FragmentMonitorCollection::FragmentStats const&,
00253       const MonitoredQuantity::DataSetType
00254     ) const;
00255 
00259     void addRowForBandwidth
00260     (
00261       XHTMLMaker& maker,
00262       XHTMLMaker::Node* table,
00263       FragmentMonitorCollection::FragmentStats const&,
00264       const MonitoredQuantity::DataSetType
00265     ) const;
00266 
00270     void addRowForRate
00271     (
00272       XHTMLMaker& maker,
00273       XHTMLMaker::Node* table,
00274       FragmentMonitorCollection::FragmentStats const&,
00275       const MonitoredQuantity::DataSetType
00276     ) const;
00277 
00281     void addRowForLatency
00282     (
00283       XHTMLMaker& maker,
00284       XHTMLMaker::Node* table,
00285       FragmentMonitorCollection::FragmentStats const&,
00286       const MonitoredQuantity::DataSetType
00287     ) const;
00288 
00292     void addRowForTotalVolume
00293     (
00294       XHTMLMaker& maker,
00295       XHTMLMaker::Node* table,
00296       FragmentMonitorCollection::FragmentStats const&,
00297       const MonitoredQuantity::DataSetType
00298     ) const;
00299 
00303     void addRowForMaxBandwidth
00304     (
00305       XHTMLMaker& maker,
00306       XHTMLMaker::Node* table,
00307       FragmentMonitorCollection::FragmentStats const&,
00308       const MonitoredQuantity::DataSetType
00309     ) const;
00310 
00314     void addRowForMinBandwidth
00315     (
00316       XHTMLMaker& maker,
00317       XHTMLMaker::Node* table,
00318       FragmentMonitorCollection::FragmentStats const&,
00319       const MonitoredQuantity::DataSetType
00320     ) const;
00321 
00325     void addOutputModuleTables
00326     (
00327       XHTMLMaker& maker,
00328       XHTMLMaker::Node* parent,
00329       DataSenderMonitorCollection const&
00330     ) const;
00331 
00336     void addOutputModuleStatistics
00337     (
00338       XHTMLMaker& maker,
00339       XHTMLMaker::Node* parent,
00340       long long uniqueRBID,
00341       DataSenderMonitorCollection const&
00342     ) const;
00343 
00347     void addOutputModuleStatistics
00348     (
00349       XHTMLMaker& maker,
00350       XHTMLMaker::Node* parent,
00351       DataSenderMonitorCollection::OutputModuleResultsList const&
00352     ) const;
00353 
00357     void addOutputModuleSummary
00358     (
00359       XHTMLMaker& maker,
00360       XHTMLMaker::Node* parent,
00361       DataSenderMonitorCollection::OutputModuleResultsList const&
00362     ) const;
00363 
00368     void addResourceBrokerList
00369     (
00370       XHTMLMaker& maker,
00371       XHTMLMaker::Node* parent,
00372       DataSenderMonitorCollection const&
00373     ) const;
00374 
00379     void addResourceBrokerDetails
00380     (
00381       XHTMLMaker& maker,
00382       XHTMLMaker::Node* parent,
00383       long long uniqueRBID,
00384       DataSenderMonitorCollection const&
00385     ) const;
00386 
00391     void addFilterUnitList
00392     (
00393       XHTMLMaker& maker,
00394       XHTMLMaker::Node* parent,
00395       long long uniqueRBID,
00396       DataSenderMonitorCollection const&
00397     ) const;
00398 
00402     void addTableForResourceUsages
00403     (
00404       XHTMLMaker& maker,
00405       XHTMLMaker::Node* parent,
00406       ThroughputMonitorCollection::Stats const&,
00407       ResourceMonitorCollection::Stats const&
00408     ) const;
00409 
00413     void addRowsForThroughputUsage
00414     (
00415       XHTMLMaker& maker,
00416       XHTMLMaker::Node* table,
00417       ThroughputMonitorCollection::Stats const&
00418     ) const;
00419 
00423     void addRowsForWorkers
00424     (
00425       XHTMLMaker& maker,
00426       XHTMLMaker::Node* table,
00427       ResourceMonitorCollection::Stats const&
00428     ) const;
00429 
00433     void addRowsForSataBeast
00434     (
00435       XHTMLMaker& maker,
00436       XHTMLMaker::Node* table,
00437       ResourceMonitorCollection::Stats const&
00438     ) const;
00439 
00443     void addTableForDiskUsages
00444     (
00445       XHTMLMaker& maker,
00446       XHTMLMaker::Node* parent,
00447       ResourceMonitorCollection::Stats const&
00448     ) const;
00449 
00450 
00451   private:
00452 
00453     //Prevent copying of the SMWebPageHelper
00454     SMWebPageHelper(SMWebPageHelper const&);
00455     SMWebPageHelper& operator=(SMWebPageHelper const&);
00456 
00457     SharedResourcesPtr sharedResources_;
00458 
00459     typedef ConsumerWebPageHelper<SMWebPageHelper,
00460                                   EventQueueCollection,
00461                                   StatisticsReporter> ConsumerWebPageHelper_t;
00462     ConsumerWebPageHelper_t consumerWebPageHelper_;
00463 
00464   };
00465 
00466 } // namespace stor
00467 
00468 #endif // EventFilter_StorageManager_SMWebPageHelper_h 
00469 
00470