msmonitor 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/Alarm.py +39 -0
- WMCore/Algorithms/MathAlgos.py +274 -0
- WMCore/Algorithms/MiscAlgos.py +67 -0
- WMCore/Algorithms/ParseXMLFile.py +115 -0
- WMCore/Algorithms/Permissions.py +27 -0
- WMCore/Algorithms/Singleton.py +58 -0
- WMCore/Algorithms/SubprocessAlgos.py +129 -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/DAOFactory.py +47 -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/MathStructs/ContinuousSummaryHistogram.py +197 -0
- WMCore/DataStructs/MathStructs/DiscreteSummaryHistogram.py +92 -0
- WMCore/DataStructs/MathStructs/SummaryHistogram.py +117 -0
- WMCore/DataStructs/MathStructs/__init__.py +0 -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/ConfigDBMap.py +29 -0
- WMCore/Database/CouchUtils.py +118 -0
- WMCore/Database/DBCore.py +198 -0
- WMCore/Database/DBCreator.py +113 -0
- WMCore/Database/DBExceptionHandler.py +57 -0
- WMCore/Database/DBFactory.py +110 -0
- WMCore/Database/DBFormatter.py +177 -0
- WMCore/Database/Dialects.py +13 -0
- WMCore/Database/ExecuteDAO.py +327 -0
- WMCore/Database/MongoDB.py +241 -0
- WMCore/Database/MySQL/Destroy.py +42 -0
- WMCore/Database/MySQL/ListUserContent.py +20 -0
- WMCore/Database/MySQL/__init__.py +9 -0
- WMCore/Database/MySQLCore.py +132 -0
- WMCore/Database/Oracle/Destroy.py +56 -0
- WMCore/Database/Oracle/ListUserContent.py +19 -0
- WMCore/Database/Oracle/__init__.py +9 -0
- WMCore/Database/ResultSet.py +44 -0
- WMCore/Database/Transaction.py +91 -0
- WMCore/Database/__init__.py +9 -0
- WMCore/Database/ipy_profile_couch.py +438 -0
- WMCore/GroupUser/CouchObject.py +127 -0
- WMCore/GroupUser/Decorators.py +51 -0
- WMCore/GroupUser/Group.py +33 -0
- WMCore/GroupUser/Interface.py +73 -0
- WMCore/GroupUser/User.py +96 -0
- WMCore/GroupUser/__init__.py +11 -0
- WMCore/Lexicon.py +836 -0
- WMCore/MicroService/CherryPyThreads/HeartbeatMonitor.py +6 -0
- WMCore/MicroService/CherryPyThreads/__init__.py +0 -0
- WMCore/MicroService/DataStructs/DefaultStructs.py +101 -0
- WMCore/MicroService/DataStructs/__init__.py +0 -0
- WMCore/MicroService/MSCore/MSAuth.py +153 -0
- WMCore/MicroService/MSCore/MSCore.py +113 -0
- WMCore/MicroService/MSCore/MSManager.py +484 -0
- WMCore/MicroService/MSCore/TaskManager.py +218 -0
- WMCore/MicroService/MSCore/__init__.py +0 -0
- WMCore/MicroService/MSMonitor/MSMonitor.py +270 -0
- WMCore/MicroService/MSMonitor/__init__.py +0 -0
- WMCore/MicroService/Service/Data.py +225 -0
- WMCore/MicroService/Service/RestApiHub.py +46 -0
- WMCore/MicroService/Service/__init__.py +0 -0
- WMCore/MicroService/Tools/Common.py +579 -0
- WMCore/MicroService/Tools/PycurlRucio.py +419 -0
- WMCore/MicroService/Tools/__init__.py +0 -0
- WMCore/MicroService/WebGui/FrontPage.py +56 -0
- WMCore/MicroService/WebGui/__init__.py +0 -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/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/WMConnectionBase.py +164 -0
- WMCore/WMException.py +183 -0
- WMCore/WMExceptions.py +269 -0
- WMCore/WMFactory.py +76 -0
- WMCore/WMInit.py +228 -0
- WMCore/WMLogging.py +108 -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
- msmonitor-2.3.10.data/data/bin/wmc-dist-patch +15 -0
- msmonitor-2.3.10.data/data/bin/wmc-dist-unpatch +8 -0
- msmonitor-2.3.10.data/data/bin/wmc-httpd +3 -0
- msmonitor-2.3.10.dist-info/LICENSE +202 -0
- msmonitor-2.3.10.dist-info/METADATA +21 -0
- msmonitor-2.3.10.dist-info/NOTICE +16 -0
- msmonitor-2.3.10.dist-info/RECORD +210 -0
- msmonitor-2.3.10.dist-info/WHEEL +5 -0
- msmonitor-2.3.10.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from __future__ import (division, print_function)
|
|
2
|
+
import time
|
|
3
|
+
from pprint import pformat
|
|
4
|
+
from WMCore.REST.CherryPyPeriodicTask import CherryPyPeriodicTask
|
|
5
|
+
from WMCore.Services.WMStats.WMStatsWriter import WMStatsWriter, convertToServiceCouchDoc
|
|
6
|
+
|
|
7
|
+
# CMSMonitoring modules
|
|
8
|
+
from CMSMonitoring.StompAMQ7 import StompAMQ7 as StompAMQ
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class HeartbeatMonitorBase(CherryPyPeriodicTask):
|
|
12
|
+
|
|
13
|
+
def __init__(self, rest, config):
|
|
14
|
+
super(HeartbeatMonitorBase, self).__init__(config)
|
|
15
|
+
self.centralWMStats = WMStatsWriter(config.wmstats_url)
|
|
16
|
+
self.threadList = config.thread_list
|
|
17
|
+
self.userAMQ = getattr(config, "user_amq", None)
|
|
18
|
+
self.passAMQ = getattr(config, "pass_amq", None)
|
|
19
|
+
self.postToAMQ = getattr(config, "post_to_amq", False)
|
|
20
|
+
self.topicAMQ = getattr(config, "topic_amq", None)
|
|
21
|
+
self.hostPortAMQ = getattr(config, "host_port_amq", None)
|
|
22
|
+
|
|
23
|
+
def setConcurrentTasks(self, config):
|
|
24
|
+
"""
|
|
25
|
+
sets the list of function reference for concurrent tasks
|
|
26
|
+
"""
|
|
27
|
+
self.concurrentTasks = [{'func': self.reportToWMStats, 'duration': config.heartbeatCheckDuration}]
|
|
28
|
+
|
|
29
|
+
def reportToWMStats(self, config):
|
|
30
|
+
"""
|
|
31
|
+
report thread status and heartbeat.
|
|
32
|
+
Also can report additional monitoring information by rewriting addAdditionalMonitorReport method
|
|
33
|
+
"""
|
|
34
|
+
self.logger.info("Checking Thread status...")
|
|
35
|
+
downThreadInfo = self.logDB.wmstats_down_components_report(self.threadList)
|
|
36
|
+
monitorInfo = self.addAdditionalMonitorReport(config)
|
|
37
|
+
downThreadInfo.update(monitorInfo)
|
|
38
|
+
wqSummaryDoc = convertToServiceCouchDoc(downThreadInfo, config.log_reporter)
|
|
39
|
+
self.centralWMStats.updateAgentInfo(wqSummaryDoc)
|
|
40
|
+
|
|
41
|
+
self.logger.info("Uploaded to WMStats...")
|
|
42
|
+
|
|
43
|
+
return
|
|
44
|
+
|
|
45
|
+
def addAdditionalMonitorReport(self, config):
|
|
46
|
+
"""
|
|
47
|
+
add Additonal report with heartbeat report
|
|
48
|
+
overwite the method with each applications monitoring info. (Need to follow the format displayed in wmstats)
|
|
49
|
+
"""
|
|
50
|
+
return {}
|
|
51
|
+
|
|
52
|
+
def uploadToAMQ(self, docs, producer=None):
|
|
53
|
+
"""
|
|
54
|
+
_uploadToAMQ_
|
|
55
|
+
|
|
56
|
+
Sends data to AMQ, which ends up in elastic search.
|
|
57
|
+
:param docs: list of documents/dicts to be posted
|
|
58
|
+
:param producer: service name that's providing this info
|
|
59
|
+
"""
|
|
60
|
+
if not docs:
|
|
61
|
+
self.logger.info("There are no documents to send to AMQ")
|
|
62
|
+
return
|
|
63
|
+
|
|
64
|
+
producer = producer or self.producer
|
|
65
|
+
ts = int(time.time())
|
|
66
|
+
notifications = []
|
|
67
|
+
|
|
68
|
+
self.logger.debug("Sending the following data to AMQ %s", pformat(docs))
|
|
69
|
+
try:
|
|
70
|
+
stompSvc = StompAMQ(username=self.userAMQ,
|
|
71
|
+
password=self.passAMQ,
|
|
72
|
+
producer=producer,
|
|
73
|
+
topic=self.topicAMQ,
|
|
74
|
+
validation_schema=None,
|
|
75
|
+
host_and_ports=self.hostPortAMQ,
|
|
76
|
+
logger=self.logger)
|
|
77
|
+
|
|
78
|
+
for doc in docs:
|
|
79
|
+
singleNotif, _, _ = stompSvc.make_notification(payload=doc, doc_type=self.docTypeAMQ,
|
|
80
|
+
ts=ts, data_subfield="payload")
|
|
81
|
+
notifications.append(singleNotif)
|
|
82
|
+
|
|
83
|
+
failures = stompSvc.send(notifications)
|
|
84
|
+
msg = "%i out of %i documents successfully sent to AMQ" % (len(notifications) - len(failures),
|
|
85
|
+
len(notifications))
|
|
86
|
+
self.logger.info(msg)
|
|
87
|
+
except Exception as ex:
|
|
88
|
+
self.logger.exception("Failed to send data to StompAMQ. Error %s", str(ex))
|
|
89
|
+
|
|
90
|
+
return
|