reqmon 2.3.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Utils/CPMetrics.py +270 -0
- Utils/CertTools.py +62 -0
- Utils/EmailAlert.py +50 -0
- Utils/ExtendedUnitTestCase.py +62 -0
- Utils/FileTools.py +182 -0
- Utils/IteratorTools.py +80 -0
- Utils/MathUtils.py +31 -0
- Utils/MemoryCache.py +119 -0
- Utils/Patterns.py +24 -0
- Utils/Pipeline.py +137 -0
- Utils/PortForward.py +97 -0
- Utils/ProcessStats.py +103 -0
- Utils/PythonVersion.py +17 -0
- Utils/Signals.py +36 -0
- Utils/TemporaryEnvironment.py +27 -0
- Utils/Throttled.py +227 -0
- Utils/Timers.py +130 -0
- Utils/Timestamps.py +86 -0
- Utils/TokenManager.py +143 -0
- Utils/Tracing.py +60 -0
- Utils/TwPrint.py +98 -0
- Utils/Utilities.py +308 -0
- Utils/__init__.py +11 -0
- WMCore/Algorithms/Permissions.py +27 -0
- WMCore/Algorithms/__init__.py +7 -0
- WMCore/Cache/GenericDataCache.py +98 -0
- WMCore/Cache/WMConfigCache.py +572 -0
- WMCore/Cache/__init__.py +0 -0
- WMCore/Configuration.py +651 -0
- WMCore/DataStructs/File.py +177 -0
- WMCore/DataStructs/Fileset.py +140 -0
- WMCore/DataStructs/Job.py +182 -0
- WMCore/DataStructs/JobGroup.py +142 -0
- WMCore/DataStructs/JobPackage.py +49 -0
- WMCore/DataStructs/LumiList.py +734 -0
- WMCore/DataStructs/Mask.py +219 -0
- WMCore/DataStructs/Pickleable.py +24 -0
- WMCore/DataStructs/Run.py +256 -0
- WMCore/DataStructs/Subscription.py +175 -0
- WMCore/DataStructs/WMObject.py +47 -0
- WMCore/DataStructs/WorkUnit.py +112 -0
- WMCore/DataStructs/Workflow.py +60 -0
- WMCore/DataStructs/__init__.py +8 -0
- WMCore/Database/CMSCouch.py +1349 -0
- WMCore/Database/CouchUtils.py +118 -0
- WMCore/Database/__init__.py +9 -0
- WMCore/Lexicon.py +836 -0
- WMCore/REST/Auth.py +202 -0
- WMCore/REST/CherryPyPeriodicTask.py +166 -0
- WMCore/REST/Error.py +333 -0
- WMCore/REST/Format.py +642 -0
- WMCore/REST/HeartbeatMonitorBase.py +90 -0
- WMCore/REST/Main.py +623 -0
- WMCore/REST/Server.py +2435 -0
- WMCore/REST/Services.py +24 -0
- WMCore/REST/Test.py +120 -0
- WMCore/REST/Tools.py +38 -0
- WMCore/REST/Validation.py +250 -0
- WMCore/REST/__init__.py +1 -0
- WMCore/ReqMgr/DataStructs/AuthzByStatus.py +113 -0
- WMCore/ReqMgr/DataStructs/DefaultConfig/CAMPAIGN_CONFIG.py +116 -0
- WMCore/ReqMgr/DataStructs/DefaultConfig/DAS_RESULT_FILTER.py +3 -0
- WMCore/ReqMgr/DataStructs/DefaultConfig/EDITABLE_SPLITTING_PARAM_CONFIG.py +42 -0
- WMCore/ReqMgr/DataStructs/DefaultConfig/UNIFIED_CONFIG.py +240 -0
- WMCore/ReqMgr/DataStructs/DefaultConfig/__init__.py +0 -0
- WMCore/ReqMgr/DataStructs/ReqMgrConfigDataCache.py +65 -0
- WMCore/ReqMgr/DataStructs/Request.py +293 -0
- WMCore/ReqMgr/DataStructs/RequestError.py +21 -0
- WMCore/ReqMgr/DataStructs/RequestStatus.py +209 -0
- WMCore/ReqMgr/DataStructs/RequestType.py +13 -0
- WMCore/ReqMgr/DataStructs/__init__.py +0 -0
- WMCore/ReqMgr/__init__.py +1 -0
- WMCore/Services/AlertManager/AlertManagerAPI.py +111 -0
- WMCore/Services/AlertManager/__init__.py +0 -0
- WMCore/Services/CRIC/CRIC.py +238 -0
- WMCore/Services/CRIC/__init__.py +0 -0
- WMCore/Services/DBS/DBS3Reader.py +1044 -0
- WMCore/Services/DBS/DBSConcurrency.py +44 -0
- WMCore/Services/DBS/DBSErrors.py +113 -0
- WMCore/Services/DBS/DBSReader.py +23 -0
- WMCore/Services/DBS/DBSUtils.py +139 -0
- WMCore/Services/DBS/DBSWriterObjects.py +381 -0
- WMCore/Services/DBS/ProdException.py +133 -0
- WMCore/Services/DBS/__init__.py +8 -0
- WMCore/Services/FWJRDB/FWJRDBAPI.py +118 -0
- WMCore/Services/FWJRDB/__init__.py +0 -0
- WMCore/Services/HTTPS/HTTPSAuthHandler.py +66 -0
- WMCore/Services/HTTPS/__init__.py +0 -0
- WMCore/Services/LogDB/LogDB.py +201 -0
- WMCore/Services/LogDB/LogDBBackend.py +191 -0
- WMCore/Services/LogDB/LogDBExceptions.py +11 -0
- WMCore/Services/LogDB/LogDBReport.py +85 -0
- WMCore/Services/LogDB/__init__.py +0 -0
- WMCore/Services/MSPileup/__init__.py +0 -0
- WMCore/Services/MSUtils/MSUtils.py +54 -0
- WMCore/Services/MSUtils/__init__.py +0 -0
- WMCore/Services/McM/McM.py +173 -0
- WMCore/Services/McM/__init__.py +8 -0
- WMCore/Services/MonIT/Grafana.py +133 -0
- WMCore/Services/MonIT/__init__.py +0 -0
- WMCore/Services/PyCondor/PyCondorAPI.py +154 -0
- WMCore/Services/PyCondor/PyCondorUtils.py +105 -0
- WMCore/Services/PyCondor/__init__.py +0 -0
- WMCore/Services/ReqMgr/ReqMgr.py +261 -0
- WMCore/Services/ReqMgr/__init__.py +0 -0
- WMCore/Services/ReqMgrAux/ReqMgrAux.py +419 -0
- WMCore/Services/ReqMgrAux/__init__.py +0 -0
- WMCore/Services/RequestDB/RequestDBReader.py +267 -0
- WMCore/Services/RequestDB/RequestDBWriter.py +39 -0
- WMCore/Services/RequestDB/__init__.py +0 -0
- WMCore/Services/Requests.py +624 -0
- WMCore/Services/Rucio/Rucio.py +1287 -0
- WMCore/Services/Rucio/RucioUtils.py +74 -0
- WMCore/Services/Rucio/__init__.py +0 -0
- WMCore/Services/RucioConMon/RucioConMon.py +128 -0
- WMCore/Services/RucioConMon/__init__.py +0 -0
- WMCore/Services/Service.py +400 -0
- WMCore/Services/StompAMQ/__init__.py +0 -0
- WMCore/Services/TagCollector/TagCollector.py +155 -0
- WMCore/Services/TagCollector/XMLUtils.py +98 -0
- WMCore/Services/TagCollector/__init__.py +0 -0
- WMCore/Services/UUIDLib.py +13 -0
- WMCore/Services/UserFileCache/UserFileCache.py +160 -0
- WMCore/Services/UserFileCache/__init__.py +8 -0
- WMCore/Services/WMAgent/WMAgent.py +63 -0
- WMCore/Services/WMAgent/__init__.py +0 -0
- WMCore/Services/WMArchive/CMSSWMetrics.py +526 -0
- WMCore/Services/WMArchive/DataMap.py +463 -0
- WMCore/Services/WMArchive/WMArchive.py +33 -0
- WMCore/Services/WMArchive/__init__.py +0 -0
- WMCore/Services/WMBS/WMBS.py +97 -0
- WMCore/Services/WMBS/__init__.py +0 -0
- WMCore/Services/WMStats/DataStruct/RequestInfoCollection.py +300 -0
- WMCore/Services/WMStats/DataStruct/__init__.py +0 -0
- WMCore/Services/WMStats/WMStatsPycurl.py +145 -0
- WMCore/Services/WMStats/WMStatsReader.py +445 -0
- WMCore/Services/WMStats/WMStatsWriter.py +273 -0
- WMCore/Services/WMStats/__init__.py +0 -0
- WMCore/Services/WMStatsServer/WMStatsServer.py +134 -0
- WMCore/Services/WMStatsServer/__init__.py +0 -0
- WMCore/Services/WorkQueue/WorkQueue.py +492 -0
- WMCore/Services/WorkQueue/__init__.py +0 -0
- WMCore/Services/__init__.py +8 -0
- WMCore/Services/pycurl_manager.py +574 -0
- WMCore/WMBase.py +50 -0
- WMCore/WMException.py +183 -0
- WMCore/WMExceptions.py +269 -0
- WMCore/WMFactory.py +76 -0
- WMCore/WMLogging.py +108 -0
- WMCore/WMStats/CherryPyThreads/CleanUpTask.py +46 -0
- WMCore/WMStats/CherryPyThreads/DataCacheUpdate.py +45 -0
- WMCore/WMStats/CherryPyThreads/HeartbeatMonitor.py +6 -0
- WMCore/WMStats/CherryPyThreads/LogDBTasks.py +29 -0
- WMCore/WMStats/CherryPyThreads/__init__.py +0 -0
- WMCore/WMStats/DataStructs/DataCache.py +92 -0
- WMCore/WMStats/DataStructs/__init__.py +0 -0
- WMCore/WMStats/Service/ActiveRequestJobInfo.py +123 -0
- WMCore/WMStats/Service/MetaDataInfo.py +26 -0
- WMCore/WMStats/Service/RequestInfo.py +127 -0
- WMCore/WMStats/Service/RestApiHub.py +51 -0
- WMCore/WMStats/Service/__init__.py +0 -0
- WMCore/WMStats/T0/CherryPyThreads/T0DataCacheUpdate.py +35 -0
- WMCore/WMStats/T0/CherryPyThreads/__init__.py +0 -0
- WMCore/WMStats/T0/Service/T0RestApiHub.py +37 -0
- WMCore/WMStats/T0/Service/__init__.py +0 -0
- WMCore/WMStats/T0/__init__.py +0 -0
- WMCore/WMStats/WebGui/FrontPage.py +59 -0
- WMCore/WMStats/WebGui/__init__.py +0 -0
- WMCore/WMStats/__init__.py +1 -0
- WMCore/Wrappers/JsonWrapper/JSONThunker.py +342 -0
- WMCore/Wrappers/JsonWrapper/__init__.py +7 -0
- WMCore/Wrappers/__init__.py +6 -0
- WMCore/__init__.py +10 -0
- reqmon-2.3.10.data/data/bin/wmc-dist-patch +15 -0
- reqmon-2.3.10.data/data/bin/wmc-dist-unpatch +8 -0
- reqmon-2.3.10.data/data/bin/wmc-httpd +3 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/_id +1 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/couchapp.json +5 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/filters/filterDeletedDocs.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/validate_doc_update.js +6 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/views/logByRequest/map.js +9 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/views/logByRequestAndThread/map.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/views/requests/map.js +5 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/views/requests/reduce.js +1 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/views/tstamp/map.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/_id +1 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/couchapp.json +5 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/filters/repfilter.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/updates/updaterequest.js +79 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/validate_doc_update.js +6 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/views/byrequest/map.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/views/bystatus/map.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/views/bystatusandtime/map.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/ColVis.css +76 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/font-awesome.min.css +4 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-circle-check-16.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-circle-cross-16.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-circle-plus-16.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-square-check-16.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/cms_logo.gif +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/cms_logo.jpeg +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_100_e4f1fb_1x400.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_80_d7ebf9_1x400.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_highlight-hard_55_5c9ccc_1x100.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_inset-soft_100_fcfdfd_1x100.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_217bc0_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_2694e8_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_2e83ff_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_469bdd_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_6da8d5_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_cd0a0a_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_d8e7f3_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_f9bd01_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/warning-16.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/jquery-ui-1.12.0.css +1312 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/jquery.dataTables.css +241 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/logdb.css +60 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/main_layout.css +565 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/FontAwesome.otf +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.eot +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.svg +565 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.ttf +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.woff +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.woff2 +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/Sorting icons.psd +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/back_disabled.jpg +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/back_enabled.jpg +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/error.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/favicon.ico +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/forward_disabled.jpg +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/forward_enabled.jpg +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/loader-1.gif +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/module.caption.backg.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/module.caption.backg.rolledup.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/rollup.gif +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_asc.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_asc_disabled.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_both.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_desc.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_desc_disabled.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/stable.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/warning.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/index.html +105 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/index.html.min +106 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/index.html.org +125 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/WMStats.ActiveRequestController.js +61 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/WMStats.GenericController.js +38 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/WMStats.WorkloadSummaryController.js +12 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/import.js +6 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T0/WMStats.RequestSummary.js +71 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T0/WMStats.RunSummary.js +70 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.AgentRequestSummary.js +28 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.CMSSWSummary.js +28 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.CampaignSummary.js +28 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.ReqMgrRequest.js +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.RequestSummary.js +190 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Agents.js +98 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Alerts.js +21 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Campaigns.js +25 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.GenericRequests.js +728 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.History.js +78 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.JobDetails.js +19 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.JobSummary.js +32 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.LogDBData.js +93 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.LogMessage.js +38 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.SiteSummary.js +24 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Sites.js +25 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Tasks.js +107 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.WorkloadSummary.js +20 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats._StructBase.js +37 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/import.js +29 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.ActiveRequestModel.js +9 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestLogDetailModel.js +17 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestLogModel.js +14 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestModel.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestSearchModel.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.ActiveRequestModel.js +9 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.ReqMgrRequestModel.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.RequestLogDetailModel.js +18 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.RequestLogModel.js +14 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.RequestSearchModel.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.AgentModel.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.AlertModel.js +6 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.HistoryModel.js +14 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.JobDetailModel.js +22 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.JobSummaryModel.js +18 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.WorkloadSummaryModel.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats._AjaxModelBase.js +55 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats._ModelBase.js +77 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats._RequestModelBase.js +127 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/import.js +26 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/ViewModels/WMStats.ViewModel.js +511 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/ViewModels/import.js +2 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/T0/WMStats.Controls.js +117 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/T1/WMStats.Controls.js +158 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/WMStats.CommonControls.js +100 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/import.js +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Graphs/WMStats.SiteHistoryGraph.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Graphs/import.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.CategoryDetailList.js +38 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestAlertGUI.js +128 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestDataList.js +25 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestDetailList.js +68 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestSummaryList.js +31 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.CategoryDetailList.js +54 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestAlertGUI.js +81 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestDataList.js +26 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestDetailList.js +122 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestSummaryList.js +35 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.ResubmissionList.js +64 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.AgentDetailList.js +137 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.CategoryTitle.js +20 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.HTMLList.js +12 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.JobDetailList.js +178 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.RequestLogList.js +88 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.RequestTitle.js +33 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/import.js +25 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/WMStats.ActiveRequestTable.js +142 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/WMStats.RunSummaryTable.js +77 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/WMStats.TaskSummaryTable.js +127 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/addCategoryMap.js +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.ActiveRequestTable.js +132 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.ActiveRequestTableWithJob.js +164 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.AgentRequestSummaryTable.js +78 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.CMSSWSummaryTable.js +76 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.CampaignSummaryTable.js +76 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.SiteSummaryTable.js +63 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.TaskSummaryTable.js +124 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/addCategoryMap.js +17 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.JobSummaryTable.js +71 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.Table.js +70 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.TableController.js +130 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.WorkloadSummaryTable.js +62 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/import.js +26 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/WMStats.CategoryMap.js +45 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/WMStats.View.IndexHTML.js +137 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/import.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Ajax.js +74 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Couch.js +83 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Globals.js +200 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Utils.js +283 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/import-all.min.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/loader.js +27 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/minified/global.min.js +639 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/minified/import-all-t0.min.js +4317 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/minified/import-all-t1.min.js +4972 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/lib/jquery.dataTables.columnFilter.js +732 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/lib/namespace.js +23 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/filters/deleteFatDocFilter.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/filters/filterDeletedDocs.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/filters/repfilter.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/rewrites.json +110 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/shows/redirect.js +23 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/agentInfo.js +17 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/generalFields.js +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/insertRequest.js +13 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/jobLogArchiveLocation.js +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/jobStateTransition.js +17 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/jobSummaryState.js +5 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/totalStats.js +39 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/validate_doc_update.js +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl/views/requestAgentUrl/map.erl +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl/views/requestAgentUrl/reduce.erl +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl1/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl1/views/byAgentURL/map.erl +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl2/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl2/views/allWorkflows/map.erl +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl2/views/allWorkflows/reduce.erl +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl3/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl3/views/jobsByStatusWorkflow/map.erl +32 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl3/views/jobsByStatusWorkflow/reduce.erl +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl4/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl4/views/cooledoffRequests/map.erl +16 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl4/views/cooledoffRequests/reduce.erl +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl5/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl5/views/time/map.erl +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl6/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl6/views/requestHistory/map.erl +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl6/views/requestHistory/reduce.erl +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl7/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl7/views/agentInfo/map.erl +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl7/views/latestRequest/map.erl +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/index.html +44 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/container/histogram.js +141 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/container/tree.js +67 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/dataMap/errorData.js +69 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/htmlFormatter/listFormatter.js +79 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/layout/gridLayout.js +77 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/performanceHistogram.html +46 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/style/main.css +17 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/couchapp.json +4 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/filters/repfilter.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lib/mustache.js +333 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lib/validate.js +29 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lists/completedWorkflows.js +27 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lists/performanceHistogram.js +15 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/rewrites.json +65 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/shows/histogramByWorkflow.js +75 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/shows/lumiMissingByWorkflow.js +97 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/templates/histogramByWorkflow.html +126 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/templates/performanceData.html +44 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/updates/updateacdc.js +6 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/updates/updatecollection.js +5 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/validate_doc_update.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/vendor/protovis/_attachments/protovis-r3.2.js +277 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/outputDataByPrimDs/map.js +21 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/performanceDataByCampaign/map.js +19 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/summaryByInputdataset/map.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/summaryByOutputdataset/map.js +7 -0
- reqmon-2.3.10.dist-info/LICENSE +202 -0
- reqmon-2.3.10.dist-info/METADATA +24 -0
- reqmon-2.3.10.dist-info/NOTICE +16 -0
- reqmon-2.3.10.dist-info/RECORD +424 -0
- reqmon-2.3.10.dist-info/WHEEL +5 -0
- reqmon-2.3.10.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
from __future__ import (division, print_function)
|
|
2
|
+
|
|
3
|
+
import traceback
|
|
4
|
+
from WMCore.REST.CherryPyPeriodicTask import CherryPyPeriodicTask
|
|
5
|
+
from WMCore.Services.WMStats.WMStatsWriter import WMStatsWriter
|
|
6
|
+
|
|
7
|
+
class CleanUpTask(CherryPyPeriodicTask):
|
|
8
|
+
"""
|
|
9
|
+
This class is used for both T0WMStats and WMStats
|
|
10
|
+
controlled by config.reqdb_couch_app value
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
def __init__(self, rest, config):
|
|
14
|
+
|
|
15
|
+
super(CleanUpTask, self).__init__(config)
|
|
16
|
+
self.wmstatsDB = WMStatsWriter(config.wmstats_url, reqdbURL=config.reqmgrdb_url,
|
|
17
|
+
reqdbCouchApp=config.reqdb_couch_app)
|
|
18
|
+
|
|
19
|
+
def setConcurrentTasks(self, config):
|
|
20
|
+
"""
|
|
21
|
+
sets the list of functions which runs concurrently
|
|
22
|
+
"""
|
|
23
|
+
self.concurrentTasks = [{'func': self.cleanUpArchivedRequests, 'duration': config.archivedCleanUpDuration}]
|
|
24
|
+
|
|
25
|
+
def cleanUpArchivedRequests(self, config):
|
|
26
|
+
"""
|
|
27
|
+
loop through the workflows in couchdb, if archived delete all the data in couchdb
|
|
28
|
+
"""
|
|
29
|
+
self.logger.info("getting archived data")
|
|
30
|
+
requestNames = self.wmstatsDB.getArchivedRequests()
|
|
31
|
+
self.logger.info("archived list %s", requestNames)
|
|
32
|
+
|
|
33
|
+
for req in requestNames:
|
|
34
|
+
self.logger.info("Deleting data for: %s", req)
|
|
35
|
+
try:
|
|
36
|
+
result = self.wmstatsDB.deleteDocsByWorkflow(req)
|
|
37
|
+
except Exception as ex:
|
|
38
|
+
self.logger.error("deleting %s failed: %s", req, str(ex))
|
|
39
|
+
for line in traceback.format_exc().rstrip().split("\n"):
|
|
40
|
+
self.logger.error(" " + line)
|
|
41
|
+
else:
|
|
42
|
+
if result is None:
|
|
43
|
+
self.logger.info("there were no documents to delete.")
|
|
44
|
+
else:
|
|
45
|
+
self.logger.info("%s docs deleted", len(result))
|
|
46
|
+
return
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from __future__ import (division, print_function)
|
|
2
|
+
|
|
3
|
+
import time
|
|
4
|
+
from WMCore.REST.CherryPyPeriodicTask import CherryPyPeriodicTask
|
|
5
|
+
from WMCore.WMStats.DataStructs.DataCache import DataCache
|
|
6
|
+
from WMCore.Services.WMStats.WMStatsReader import WMStatsReader
|
|
7
|
+
from WMCore.ReqMgr.DataStructs.RequestStatus import WMSTATS_JOB_INFO, WMSTATS_NO_JOB_INFO
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DataCacheUpdate(CherryPyPeriodicTask):
|
|
11
|
+
|
|
12
|
+
def __init__(self, rest, config):
|
|
13
|
+
self.getJobInfo = getattr(config, "getJobInfo", False)
|
|
14
|
+
|
|
15
|
+
super(DataCacheUpdate, self).__init__(config)
|
|
16
|
+
|
|
17
|
+
def setConcurrentTasks(self, config):
|
|
18
|
+
"""
|
|
19
|
+
sets the list of functions which
|
|
20
|
+
"""
|
|
21
|
+
self.concurrentTasks = [{'func': self.gatherActiveDataStats,
|
|
22
|
+
'duration': config.dataCacheUpdateDuration}]
|
|
23
|
+
|
|
24
|
+
def gatherActiveDataStats(self, config):
|
|
25
|
+
"""
|
|
26
|
+
gather active data statistics
|
|
27
|
+
"""
|
|
28
|
+
self.logger.info("Starting gatherActiveDataStats with jobInfo set to: %s", self.getJobInfo)
|
|
29
|
+
try:
|
|
30
|
+
tStart = time.time()
|
|
31
|
+
if DataCache.islatestJobDataExpired():
|
|
32
|
+
wmstatsDB = WMStatsReader(config.wmstats_url, reqdbURL=config.reqmgrdb_url,
|
|
33
|
+
reqdbCouchApp="ReqMgr", logger=self.logger)
|
|
34
|
+
self.logger.info("Getting active data with job info for statuses: %s", WMSTATS_JOB_INFO)
|
|
35
|
+
jobData = wmstatsDB.getActiveData(WMSTATS_JOB_INFO, jobInfoFlag=self.getJobInfo)
|
|
36
|
+
self.logger.info("Getting active data with NO job info for statuses: %s", WMSTATS_NO_JOB_INFO)
|
|
37
|
+
tempData = wmstatsDB.getActiveData(WMSTATS_NO_JOB_INFO, jobInfoFlag=False)
|
|
38
|
+
jobData.update(tempData)
|
|
39
|
+
self.logger.info("Running setlatestJobData...")
|
|
40
|
+
DataCache.setlatestJobData(jobData)
|
|
41
|
+
self.logger.info("DataCache is up-to-date with %d requests data", len(jobData))
|
|
42
|
+
except Exception as ex:
|
|
43
|
+
self.logger.exception("Exception updating DataCache. Error: %s", str(ex))
|
|
44
|
+
self.logger.info("Total time loading data from ReqMgr2 and WMStats: %s", time.time() - tStart)
|
|
45
|
+
return
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Created on Aug 13, 2014
|
|
3
|
+
@author: sryu
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import (division, print_function)
|
|
7
|
+
|
|
8
|
+
from WMCore.REST.CherryPyPeriodicTask import CherryPyPeriodicTask
|
|
9
|
+
|
|
10
|
+
class LogDBTasks(CherryPyPeriodicTask):
|
|
11
|
+
|
|
12
|
+
def __init__(self, rest, config):
|
|
13
|
+
super(LogDBTasks, self).__init__(config)
|
|
14
|
+
|
|
15
|
+
def setConcurrentTasks(self, config):
|
|
16
|
+
"""
|
|
17
|
+
Set logDBCleanUp method to be executed in a polling cycle
|
|
18
|
+
"""
|
|
19
|
+
self.concurrentTasks = [{'func': self.logDBCleanUp, 'duration': config.logDBCleanDuration}]
|
|
20
|
+
|
|
21
|
+
def logDBCleanUp(self, config):
|
|
22
|
+
"""
|
|
23
|
+
gather active data statistics
|
|
24
|
+
"""
|
|
25
|
+
self.logger.info("Cleaning documents from LogDB WMStats")
|
|
26
|
+
docs = self.logDB.cleanup(config.keepDocsAge)
|
|
27
|
+
self.logger.info("Deleted %d old documents", len(docs))
|
|
28
|
+
|
|
29
|
+
return
|
|
File without changes
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
from builtins import object, str, bytes
|
|
2
|
+
from future.utils import viewitems
|
|
3
|
+
|
|
4
|
+
import time
|
|
5
|
+
from WMCore.ReqMgr.DataStructs.Request import RequestInfo, protectedLFNs
|
|
6
|
+
|
|
7
|
+
class DataCache(object):
|
|
8
|
+
# TODO: need to change to store in db instead of storing in the memory
|
|
9
|
+
# When mulitple server run for load balancing it could have different result
|
|
10
|
+
# from each server.
|
|
11
|
+
_duration = 300 # 5 minitues
|
|
12
|
+
_lastedActiveDataFromAgent = {}
|
|
13
|
+
|
|
14
|
+
@staticmethod
|
|
15
|
+
def getDuration():
|
|
16
|
+
return DataCache._duration
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def setDuration(sec):
|
|
20
|
+
DataCache._duration = sec
|
|
21
|
+
|
|
22
|
+
@staticmethod
|
|
23
|
+
def getlatestJobData():
|
|
24
|
+
if (DataCache._lastedActiveDataFromAgent):
|
|
25
|
+
return DataCache._lastedActiveDataFromAgent["data"]
|
|
26
|
+
else:
|
|
27
|
+
return {}
|
|
28
|
+
|
|
29
|
+
@staticmethod
|
|
30
|
+
def isEmpty():
|
|
31
|
+
# simple check to see if the data cache is populated
|
|
32
|
+
return not DataCache._lastedActiveDataFromAgent.get("data")
|
|
33
|
+
|
|
34
|
+
@staticmethod
|
|
35
|
+
def setlatestJobData(jobData):
|
|
36
|
+
DataCache._lastedActiveDataFromAgent["time"] = int(time.time())
|
|
37
|
+
DataCache._lastedActiveDataFromAgent["data"] = jobData
|
|
38
|
+
|
|
39
|
+
@staticmethod
|
|
40
|
+
def islatestJobDataExpired():
|
|
41
|
+
if not DataCache._lastedActiveDataFromAgent:
|
|
42
|
+
return True
|
|
43
|
+
|
|
44
|
+
if (int(time.time()) - DataCache._lastedActiveDataFromAgent["time"]) > DataCache._duration:
|
|
45
|
+
return True
|
|
46
|
+
return False
|
|
47
|
+
|
|
48
|
+
@staticmethod
|
|
49
|
+
def filterData(filterDict, maskList):
|
|
50
|
+
reqData = DataCache.getlatestJobData()
|
|
51
|
+
|
|
52
|
+
for _, reqInfo in viewitems(reqData):
|
|
53
|
+
reqData = RequestInfo(reqInfo)
|
|
54
|
+
if reqData.andFilterCheck(filterDict):
|
|
55
|
+
for prop in maskList:
|
|
56
|
+
result = reqData.get(prop, [])
|
|
57
|
+
|
|
58
|
+
if isinstance(result, list):
|
|
59
|
+
for value in result:
|
|
60
|
+
yield value
|
|
61
|
+
elif result is not None and result != "":
|
|
62
|
+
yield result
|
|
63
|
+
|
|
64
|
+
@staticmethod
|
|
65
|
+
def filterDataByRequest(filterDict, maskList=None):
|
|
66
|
+
reqData = DataCache.getlatestJobData()
|
|
67
|
+
|
|
68
|
+
if maskList is not None:
|
|
69
|
+
if isinstance(maskList, (str, bytes)):
|
|
70
|
+
maskList = [maskList]
|
|
71
|
+
if "RequestName" not in maskList:
|
|
72
|
+
maskList.append("RequestName")
|
|
73
|
+
|
|
74
|
+
for _, reqDict in viewitems(reqData):
|
|
75
|
+
reqInfo = RequestInfo(reqDict)
|
|
76
|
+
if reqInfo.andFilterCheck(filterDict):
|
|
77
|
+
|
|
78
|
+
if maskList is None:
|
|
79
|
+
yield reqDict
|
|
80
|
+
else:
|
|
81
|
+
resultItem = {}
|
|
82
|
+
for prop in maskList:
|
|
83
|
+
resultItem[prop] = reqInfo.get(prop, None)
|
|
84
|
+
yield resultItem
|
|
85
|
+
|
|
86
|
+
@staticmethod
|
|
87
|
+
def getProtectedLFNs():
|
|
88
|
+
reqData = DataCache.getlatestJobData()
|
|
89
|
+
|
|
90
|
+
for _, reqInfo in viewitems(reqData):
|
|
91
|
+
for dirPath in protectedLFNs(reqInfo):
|
|
92
|
+
yield dirPath
|
|
File without changes
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Gets the cache data from server cache. This shouldn't update the server cache.
|
|
3
|
+
Just wait for the server cache to be updated
|
|
4
|
+
"""
|
|
5
|
+
from __future__ import (division, print_function)
|
|
6
|
+
from WMCore.REST.Server import RESTEntity, restcall, rows
|
|
7
|
+
from WMCore.REST.Tools import tools
|
|
8
|
+
from WMCore.REST.Error import DataCacheEmpty
|
|
9
|
+
from WMCore.WMStats.DataStructs.DataCache import DataCache
|
|
10
|
+
from WMCore.REST.Format import JSONFormat, PrettyJSONFormat
|
|
11
|
+
from WMCore.ReqMgr.DataStructs.RequestStatus import ACTIVE_STATUS_FILTER
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ActiveRequestJobInfo(RESTEntity):
|
|
15
|
+
"""
|
|
16
|
+
get all the active requests with job information attatched
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
def __init__(self, app, api, config, mount):
|
|
20
|
+
# main CouchDB database where requests/workloads are stored
|
|
21
|
+
RESTEntity.__init__(self, app, api, config, mount)
|
|
22
|
+
|
|
23
|
+
def validate(self, apiobj, method, api, param, safe):
|
|
24
|
+
return
|
|
25
|
+
|
|
26
|
+
@restcall(formats=[('text/plain', PrettyJSONFormat()), ('application/json', JSONFormat())])
|
|
27
|
+
@tools.expires(secs=-1)
|
|
28
|
+
def get(self):
|
|
29
|
+
# This assumes DataCahe is periodically updated.
|
|
30
|
+
# If data is not updated, need to check, dataCacheUpdate log
|
|
31
|
+
return rows([DataCache.getlatestJobData()])
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class FilteredActiveRequestJobInfo(RESTEntity):
|
|
35
|
+
"""
|
|
36
|
+
get all the active requests with job information attatched
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def __init__(self, app, api, config, mount):
|
|
40
|
+
# main CouchDB database where requests/workloads are stored
|
|
41
|
+
RESTEntity.__init__(self, app, api, config, mount)
|
|
42
|
+
|
|
43
|
+
def validate(self, apiobj, method, api, param, safe):
|
|
44
|
+
|
|
45
|
+
for prop in param.kwargs:
|
|
46
|
+
safe.kwargs[prop] = param.kwargs[prop]
|
|
47
|
+
|
|
48
|
+
for prop in safe.kwargs:
|
|
49
|
+
del param.kwargs[prop]
|
|
50
|
+
|
|
51
|
+
return
|
|
52
|
+
|
|
53
|
+
@restcall(formats=[('text/plain', PrettyJSONFormat()), ('application/json', JSONFormat())])
|
|
54
|
+
@tools.expires(secs=-1)
|
|
55
|
+
def get(self, mask=None, **input_condition):
|
|
56
|
+
# This assumes DataCahe is periodically updated.
|
|
57
|
+
# If data is not updated, need to check, dataCacheUpdate log
|
|
58
|
+
return rows(DataCache.filterDataByRequest(input_condition, mask))
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class ProtectedLFNList(RESTEntity):
|
|
62
|
+
"""
|
|
63
|
+
API which provides a list of ALL possible unmerged LFN bases (including
|
|
64
|
+
transient datasets/LFNs).
|
|
65
|
+
"""
|
|
66
|
+
|
|
67
|
+
def __init__(self, app, api, config, mount):
|
|
68
|
+
# main CouchDB database where requests/workloads are stored
|
|
69
|
+
RESTEntity.__init__(self, app, api, config, mount)
|
|
70
|
+
|
|
71
|
+
def validate(self, apiobj, method, api, param, safe):
|
|
72
|
+
return
|
|
73
|
+
|
|
74
|
+
@restcall(formats=[('text/plain', PrettyJSONFormat()), ('application/json', JSONFormat())])
|
|
75
|
+
@tools.expires(secs=-1)
|
|
76
|
+
def get(self):
|
|
77
|
+
# This assumes DataCahe is periodically updated.
|
|
78
|
+
# If data is not updated, need to check, dataCacheUpdate log
|
|
79
|
+
if DataCache.isEmpty():
|
|
80
|
+
raise DataCacheEmpty()
|
|
81
|
+
else:
|
|
82
|
+
return rows(DataCache.filterData(ACTIVE_STATUS_FILTER, ["OutputModulesLFNBases"]))
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
class ProtectedLFNListOnlyFinalOutput(RESTEntity):
|
|
86
|
+
"""
|
|
87
|
+
Same as ProtectedLFNList API, however this one only provides LFNs that are not
|
|
88
|
+
transient, so only final output LFNs.
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
def __init__(self, app, api, config, mount):
|
|
92
|
+
# main CouchDB database where requests/workloads are stored
|
|
93
|
+
RESTEntity.__init__(self, app, api, config, mount)
|
|
94
|
+
|
|
95
|
+
def validate(self, apiobj, method, api, param, safe):
|
|
96
|
+
return
|
|
97
|
+
|
|
98
|
+
@restcall(formats=[('text/plain', PrettyJSONFormat()), ('application/json', JSONFormat())])
|
|
99
|
+
@tools.expires(secs=-1)
|
|
100
|
+
def get(self):
|
|
101
|
+
# This assumes DataCahe is periodically updated.
|
|
102
|
+
# If data is not updated, need to check, dataCacheUpdate log
|
|
103
|
+
return rows(DataCache.getProtectedLFNs())
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class GlobalLockList(RESTEntity):
|
|
107
|
+
def __init__(self, app, api, config, mount):
|
|
108
|
+
# main CouchDB database where requests/workloads are stored
|
|
109
|
+
RESTEntity.__init__(self, app, api, config, mount)
|
|
110
|
+
|
|
111
|
+
def validate(self, apiobj, method, api, param, safe):
|
|
112
|
+
return
|
|
113
|
+
|
|
114
|
+
@restcall(formats=[('text/plain', PrettyJSONFormat()), ('application/json', JSONFormat())])
|
|
115
|
+
@tools.expires(secs=-1)
|
|
116
|
+
def get(self):
|
|
117
|
+
# This assumes DataCahe is periodically updated.
|
|
118
|
+
# If data is not updated, need to check, dataCacheUpdate log
|
|
119
|
+
if DataCache.isEmpty():
|
|
120
|
+
raise DataCacheEmpty()
|
|
121
|
+
else:
|
|
122
|
+
return rows(DataCache.filterData(ACTIVE_STATUS_FILTER,
|
|
123
|
+
["InputDataset", "OutputDatasets", "MCPileup", "DataPileup"]))
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Meta data information API.
|
|
3
|
+
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import WMCore
|
|
7
|
+
|
|
8
|
+
from WMCore.REST.Server import RESTEntity, restcall
|
|
9
|
+
from WMCore.REST.Tools import tools
|
|
10
|
+
from WMCore.REST.Format import JSONFormat
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ServerInfo(RESTEntity):
|
|
14
|
+
def validate(self, apiobj, method, api, param, safe):
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
"""
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
@restcall(formats = [('application/json', JSONFormat())])
|
|
21
|
+
@tools.expires(secs=-1)
|
|
22
|
+
def get(self):
|
|
23
|
+
"""
|
|
24
|
+
"""
|
|
25
|
+
wmstats_version = WMCore.__version__
|
|
26
|
+
return "version: %s" % wmstats_version
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Hello world example using WMCore.REST handling framework.
|
|
3
|
+
Info class giving information about ReqMgr database.
|
|
4
|
+
Teams, Groups, Software versions handling for ReqMgr.
|
|
5
|
+
|
|
6
|
+
"""
|
|
7
|
+
import cherrypy
|
|
8
|
+
from WMCore.REST.Server import RESTEntity, restcall, rows
|
|
9
|
+
from WMCore.REST.Tools import tools
|
|
10
|
+
from WMCore.Services.WMStats.WMStatsReader import WMStatsReader
|
|
11
|
+
|
|
12
|
+
from WMCore.REST.Format import PrettyJSONFormat, PrettyJSONHTMLFormat, JSONFormat
|
|
13
|
+
|
|
14
|
+
class RequestInfo(RESTEntity):
|
|
15
|
+
"""
|
|
16
|
+
This class need to move under WMStats server when wmstats server created
|
|
17
|
+
"""
|
|
18
|
+
def __init__(self, app, api, config, mount):
|
|
19
|
+
# main CouchDB database where requests/workloads are stored
|
|
20
|
+
RESTEntity.__init__(self, app, api, config, mount)
|
|
21
|
+
wmstats_url = "%s/%s" % (self.config.couch_host, self.config.couch_wmstats_db)
|
|
22
|
+
reqdb_url = "%s/%s" % (self.config.couch_host, self.config.couch_reqmgr_db)
|
|
23
|
+
self.wmstats = WMStatsReader(wmstats_url, reqdbURL=reqdb_url, reqdbCouchApp="ReqMgr")
|
|
24
|
+
|
|
25
|
+
def validate(self, apiobj, method, api, param, safe):
|
|
26
|
+
args_length = len(param.args)
|
|
27
|
+
if args_length == 1:
|
|
28
|
+
safe.args.append(param.args[0])
|
|
29
|
+
param.args.pop()
|
|
30
|
+
return
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@restcall(formats = [('application/json', JSONFormat())])
|
|
34
|
+
@tools.expires(secs=-1)
|
|
35
|
+
def get(self, request_name):
|
|
36
|
+
result = self.wmstats.getRequestSummaryWithJobInfo(request_name)
|
|
37
|
+
return rows([result])
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class FinishedStatusInfo(RESTEntity):
|
|
41
|
+
"""
|
|
42
|
+
This class need to move under WMStats server when wmstats server created
|
|
43
|
+
"""
|
|
44
|
+
def __init__(self, app, api, config, mount):
|
|
45
|
+
# main CouchDB database where requests/workloads are stored
|
|
46
|
+
RESTEntity.__init__(self, app, api, config, mount)
|
|
47
|
+
wmstats_url = "%s/%s" % (self.config.couch_host, self.config.couch_wmstats_db)
|
|
48
|
+
reqdb_url = "%s/%s" % (self.config.couch_host, self.config.couch_reqmgr_db)
|
|
49
|
+
self.wmstats = WMStatsReader(wmstats_url, reqdbURL=reqdb_url, reqdbCouchApp="ReqMgr")
|
|
50
|
+
|
|
51
|
+
def validate(self, apiobj, method, api, param, safe):
|
|
52
|
+
args_length = len(param.args)
|
|
53
|
+
if args_length == 1:
|
|
54
|
+
safe.args.append(param.args[0])
|
|
55
|
+
param.args.pop()
|
|
56
|
+
return
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@restcall(formats = [('application/json', JSONFormat())])
|
|
60
|
+
@tools.expires(secs=-1)
|
|
61
|
+
def get(self, request_name):
|
|
62
|
+
|
|
63
|
+
try:
|
|
64
|
+
result = self.wmstats.isWorkflowCompletedWithLogCollectAndCleanUp(request_name)
|
|
65
|
+
except KeyError:
|
|
66
|
+
raise cherrypy.HTTPError(404, "Cannot find request: %s" % request_name)
|
|
67
|
+
|
|
68
|
+
return rows([result])
|
|
69
|
+
|
|
70
|
+
class JobDetailInfo(RESTEntity):
|
|
71
|
+
"""
|
|
72
|
+
This class need to move under WMStats server when wmstats server created
|
|
73
|
+
"""
|
|
74
|
+
def __init__(self, app, api, config, mount, t0flag=False):
|
|
75
|
+
# main CouchDB database where requests/workloads are stored
|
|
76
|
+
RESTEntity.__init__(self, app, api, config, mount)
|
|
77
|
+
wmstats_url = "%s/%s" % (self.config.couch_host, self.config.couch_wmstats_db)
|
|
78
|
+
reqdb_url = "%s/%s" % (self.config.couch_host, self.config.couch_reqmgr_db)
|
|
79
|
+
if t0flag:
|
|
80
|
+
couchAppName = "T0Request"
|
|
81
|
+
else:
|
|
82
|
+
couchAppName = "ReqMgr"
|
|
83
|
+
self.wmstats = WMStatsReader(wmstats_url, reqdbURL=reqdb_url, reqdbCouchApp=couchAppName)
|
|
84
|
+
|
|
85
|
+
def validate(self, apiobj, method, api, param, safe):
|
|
86
|
+
args_length = len(param.args)
|
|
87
|
+
if args_length == 1:
|
|
88
|
+
safe.args.append(param.args[0])
|
|
89
|
+
param.args.pop()
|
|
90
|
+
|
|
91
|
+
prop = 'sample_size'
|
|
92
|
+
safe.kwargs[prop] = int(param.kwargs.get(prop, 1))
|
|
93
|
+
if prop in param.kwargs:
|
|
94
|
+
del param.kwargs[prop]
|
|
95
|
+
return
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@restcall(formats=[('text/plain', PrettyJSONFormat()), ('text/html', PrettyJSONHTMLFormat()), ('application/json', JSONFormat())])
|
|
99
|
+
@tools.expires(secs=-1)
|
|
100
|
+
def get(self, request_name, sample_size):
|
|
101
|
+
|
|
102
|
+
result = self.wmstats.getTaskJobSummaryByRequest(request_name, sample_size, usePycurl=True)
|
|
103
|
+
return rows([result])
|
|
104
|
+
|
|
105
|
+
class TeamInfo(RESTEntity):
|
|
106
|
+
"""
|
|
107
|
+
This class need to move under WMStats server when wmstats server created
|
|
108
|
+
"""
|
|
109
|
+
def __init__(self, app, api, config, mount):
|
|
110
|
+
# main CouchDB database where requests/workloads are stored
|
|
111
|
+
RESTEntity.__init__(self, app, api, config, mount)
|
|
112
|
+
wmstats_url = "%s/%s" % (self.config.couch_host, self.config.couch_wmstats_db)
|
|
113
|
+
self.wmstats = WMStatsReader(wmstats_url)
|
|
114
|
+
|
|
115
|
+
def validate(self, apiobj, method, api, param, safe):
|
|
116
|
+
args_length = len(param.args)
|
|
117
|
+
if args_length == 1:
|
|
118
|
+
safe.args.append(param.args[0])
|
|
119
|
+
param.args.pop()
|
|
120
|
+
return
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
@restcall(formats = [('application/json', JSONFormat())])
|
|
124
|
+
@tools.expires(secs=-1)
|
|
125
|
+
def get(self):
|
|
126
|
+
result = self.wmstats.agentsByTeam(filterDrain=False)
|
|
127
|
+
return rows(result)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Module defines REST API methods and their handles.
|
|
3
|
+
Implementation of handles is in corresponding modules, not here.
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import cherrypy
|
|
8
|
+
|
|
9
|
+
from WMCore.Configuration import Configuration
|
|
10
|
+
from WMCore.REST.Server import RESTApi
|
|
11
|
+
from WMCore.REST.Format import JSONFormat
|
|
12
|
+
from WMCore.REST.Services import ProcessMatrix
|
|
13
|
+
|
|
14
|
+
from WMCore.WMStats.Service.MetaDataInfo import ServerInfo
|
|
15
|
+
from WMCore.WMStats.Service.RequestInfo import (RequestInfo, FinishedStatusInfo,
|
|
16
|
+
TeamInfo, JobDetailInfo)
|
|
17
|
+
from WMCore.WMStats.Service.ActiveRequestJobInfo import (ActiveRequestJobInfo, GlobalLockList,
|
|
18
|
+
ProtectedLFNList, ProtectedLFNListOnlyFinalOutput,
|
|
19
|
+
FilteredActiveRequestJobInfo)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class RestApiHub(RESTApi):
|
|
23
|
+
"""
|
|
24
|
+
Server object for REST data access API.
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
def __init__(self, app, config, mount):
|
|
29
|
+
"""
|
|
30
|
+
:arg app: reference to application object; passed to all entities.
|
|
31
|
+
:arg config: reference to configuration; passed to all entities.
|
|
32
|
+
:arg str mount: API URL mount point; passed to all entities."""
|
|
33
|
+
|
|
34
|
+
RESTApi.__init__(self, app, config, mount)
|
|
35
|
+
|
|
36
|
+
cherrypy.log("WMStats entire configuration:\n%s" % Configuration.getInstance())
|
|
37
|
+
cherrypy.log("WMStats REST hub configuration subset:\n%s" % config)
|
|
38
|
+
# only allows json format for return value
|
|
39
|
+
self.formats = [('application/json', JSONFormat())]
|
|
40
|
+
self._add({"info": ServerInfo(app, self, config, mount),
|
|
41
|
+
"teams": TeamInfo(app, self, config, mount),
|
|
42
|
+
"request": RequestInfo(app, self, config, mount),
|
|
43
|
+
"isfinished": FinishedStatusInfo(app, self, config, mount),
|
|
44
|
+
"jobdetail": JobDetailInfo(app, self, config, mount),
|
|
45
|
+
"requestcache": ActiveRequestJobInfo(app, self, config, mount),
|
|
46
|
+
"filtered_requests": FilteredActiveRequestJobInfo(app, self, config, mount),
|
|
47
|
+
"protectedlfns": ProtectedLFNList(app, self, config, mount),
|
|
48
|
+
"protectedlfns_final": ProtectedLFNListOnlyFinalOutput(app, self, config, mount),
|
|
49
|
+
"globallocks": GlobalLockList(app, self, config, mount),
|
|
50
|
+
"proc_status": ProcessMatrix(app, self, config, mount)
|
|
51
|
+
})
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'''
|
|
2
|
+
|
|
3
|
+
'''
|
|
4
|
+
from __future__ import (division, print_function)
|
|
5
|
+
|
|
6
|
+
from WMCore.REST.CherryPyPeriodicTask import CherryPyPeriodicTask
|
|
7
|
+
from WMCore.WMStats.DataStructs.DataCache import DataCache
|
|
8
|
+
from WMCore.Services.WMStats.WMStatsReader import WMStatsReader
|
|
9
|
+
|
|
10
|
+
class T0DataCacheUpdate(CherryPyPeriodicTask):
|
|
11
|
+
|
|
12
|
+
def __init__(self, rest, config):
|
|
13
|
+
|
|
14
|
+
CherryPyPeriodicTask.__init__(self, config)
|
|
15
|
+
|
|
16
|
+
def setConcurrentTasks(self, config):
|
|
17
|
+
"""
|
|
18
|
+
sets the list of functions which
|
|
19
|
+
"""
|
|
20
|
+
self.concurrentTasks = [{'func': self.gatherT0ActiveDataStats, 'duration': 300}]
|
|
21
|
+
|
|
22
|
+
def gatherT0ActiveDataStats(self, config):
|
|
23
|
+
"""
|
|
24
|
+
gather active data statistics
|
|
25
|
+
"""
|
|
26
|
+
try:
|
|
27
|
+
if DataCache.islatestJobDataExpired():
|
|
28
|
+
wmstatsDB = WMStatsReader(config.wmstats_url, reqdbURL=config.reqmgrdb_url,
|
|
29
|
+
reqdbCouchApp = "T0Request")
|
|
30
|
+
jobData = wmstatsDB.getT0ActiveData(jobInfoFlag = True)
|
|
31
|
+
DataCache.setlatestJobData(jobData)
|
|
32
|
+
self.logger.info("DataCache is updated: %s", len(jobData))
|
|
33
|
+
except Exception as ex:
|
|
34
|
+
self.logger.error(str(ex))
|
|
35
|
+
return
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Module defines REST API methods and their handles.
|
|
3
|
+
Implementation of handles is in corresponding modules, not here.
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import (division, print_function)
|
|
7
|
+
import cherrypy
|
|
8
|
+
|
|
9
|
+
from WMCore.Configuration import Configuration
|
|
10
|
+
from WMCore.REST.Server import RESTApi
|
|
11
|
+
from WMCore.REST.Format import JSONFormat
|
|
12
|
+
|
|
13
|
+
from WMCore.WMStats.Service.MetaDataInfo import ServerInfo
|
|
14
|
+
from WMCore.WMStats.Service.ActiveRequestJobInfo import ActiveRequestJobInfo
|
|
15
|
+
from WMCore.WMStats.Service.RequestInfo import JobDetailInfo
|
|
16
|
+
|
|
17
|
+
class T0RestApiHub(RESTApi):
|
|
18
|
+
"""
|
|
19
|
+
Server object for REST data access API.
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
def __init__(self, app, config, mount):
|
|
23
|
+
"""
|
|
24
|
+
:arg app: reference to application object; passed to all entities.
|
|
25
|
+
:arg config: reference to configuration; passed to all entities.
|
|
26
|
+
:arg str mount: API URL mount point; passed to all entities."""
|
|
27
|
+
|
|
28
|
+
RESTApi.__init__(self, app, config, mount)
|
|
29
|
+
|
|
30
|
+
cherrypy.log("T0WMStats entire configuration:\n%s" % Configuration.getInstance())
|
|
31
|
+
cherrypy.log("T0WMStats REST hub configuration subset:\n%s" % config)
|
|
32
|
+
# only allows json format for return value
|
|
33
|
+
self.formats = [('application/json', JSONFormat())]
|
|
34
|
+
self._add({"info": ServerInfo(app, self, config, mount),
|
|
35
|
+
"requestcache": ActiveRequestJobInfo(app, self, config, mount),
|
|
36
|
+
"jobdetail": JobDetailInfo(app, self, config, mount, t0flag=True),
|
|
37
|
+
})
|
|
File without changes
|
|
File without changes
|