Skip to content

Commit f325a8e

Browse files
authored
Merge pull request #5965 from rupozzi/gmonitor-branch
[integration] Removing gMonitor
2 parents 55ffe4d + c5310ee commit f325a8e

File tree

56 files changed

+31
-3883
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+31
-3883
lines changed

docs/source/AdministratorGuide/Configuration/ConfReference/Tips/ServicesPorts/index.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ Ordered by System / Services
2727
+------+----------------------+---------------------+
2828
| 9158 | *Framework* | BundleDelivery |
2929
+------+----------------------+---------------------+
30-
| 9142 | *Framework* | Monitoring |
31-
+------+----------------------+---------------------+
3230
| 9154 | *Framework* | Notification |
3331
+------+----------------------+---------------------+
3432
| 9157 | *Framework* | Plotting |
@@ -74,8 +72,6 @@ Ordered by port number
7472
+------+----------------------+---------------------+
7573
| 9136 | *WorkloadManagement* | JobStateUpdate |
7674
+------+----------------------+---------------------+
77-
| 9142 | *Framework* | Monitoring |
78-
+------+----------------------+---------------------+
7975
| 9143 | *RequestManagement* | RequestManager |
8076
+------+----------------------+---------------------+
8177
| 9145 | *WorkloadManagement* | WMSAdministrator |

docs/source/AdministratorGuide/HowTo/SystemAdministratorInterface.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ Show setup command allows administrators to know which components, Services and
9494
'Services': {'Accounting': ['ReportGenerator',
9595
'DataStore'],
9696
'Configuration': ['Server'],
97-
'Framework': ['Monitoring',
98-
'BundleDelivery',
97+
'Framework': ['BundleDelivery',
9998
'SecurityLogging',
10099
'Notification',
101100
'UserProfileManager',

docs/source/AdministratorGuide/Systems/Framework/Monitoring/index.rst

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,6 @@
44
The Framework/monitoring service
55
================================
66

7-
The Framework/Monitoring service collects information from all the active DIRAC services and Agents.
8-
The information are collected in *rrd* files which are keeping the monitoring information.
9-
This information is available as time dependent plots via the ActivityMonitor web portal application.
10-
You can access these plots via the "System overview plots" tab in this application. In particular, it shows the load of the services
11-
in terms of CPU/Memory but also numbers of queries served, numbers of active threads, pending queries, etc.
12-
These plots are very useful for understanding of your services behavior, for example, of your FileCatalog service.
7+
The framework system for the monitoring of services and agents has been removed and will no longer be used.
138

14-
The bookkeeping of the rrd files is kept in an sqlite database usually kept in /opt/dirac/data/monitoring/monitoring.db file.
15-
There is no cleaning procedure foreseen for the rrd files.
16-
17-
A Monitoring System based on ElasticSearch database as backend is possible,
18-
please read about it in :ref:`Monitoring <monitoring_system>`.
9+
It has been replaced by an ElasticSearch-based monitoring system. You can read about it in :ref:`Monitoring <monitoring_system>`

docs/source/DeveloperGuide/Systems/Framework/index.rst

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -107,62 +107,6 @@ The MonitoringUtilities module provides the functionality needed to store or del
107107
if not result[ 'OK' ]:
108108
print 'Something went wrong'
109109

110-
gMonitor object Internals
111-
============================
112-
This part covers the internal workings of the **gMonitor** object.
113-
**gMonitor** is a singleton object meaning its instance is only created once from the **MonitoringClient** and is used throughout in other systems for monitoring the component details like CPU, MEM, threads, etc.
114-
115-
Client - Server interactions of the **gMonitor** object (basic overview diagram):
116-
117-
.. image:: /_static/Systems/FS/gMonitorInteractions.png
118-
:alt: gMonitor Client & Server internal interactions.
119-
:align: center
120-
121-
**1) MonitoringClient (inherited by gMonitor singleton object):**
122-
This class is inherited by the gMonitor object and is used for reporting all types of components
123-
Activities.
124-
Basically, from here all the information is sent to the MonitoringHandler(server side) using methods like
125-
**registerActivity** and **addMark** and all the data is flushed periodicaly by the object **gMonitoringFlusher**
126-
every 300 seconds.
127-
128-
**2) MonitoringHandler:**
129-
This class is inherited from the **RequestHandler** class which is the base required for running any kind of services in DIRAC.
130-
This class is basically used to expose methods inside ServiceInterface which is accessed
131-
with the help of the **gServiceInterface** (singleton object) and before exposing the methods
132-
there are some filters applied like not including invalid actions, decoding view descriptions, etc.
133-
Here the methods called inside **export_** methods will be explained in depth inside the
134-
**ServiceInterface** part.
135-
136-
**3) ServiceInterface (inherited by the gServiceInterface singleton object):**
137-
This is the place where all the activity data is received from the **gMonitor** object and from here the other the internal interactions of the
138-
**Framework/MonitoringHandler** happens with components like **RRDManager** used for reporting data to the **rrdtool** which is based on command line
139-
used for generating plots, the **ComponentMonitoringDB** which is used to store the basic component information like component type, component name,
140-
number of queries performed, etc and the **MonitoringCatalog** which is used to store all the activity data inside the sqlite3 database which is lastly
141-
referred by the **rrdtool** and the Web interface i.e. the **ActivityMonitor** part.
142-
143-
**4) RRDManager (wrapper around the rrdtool):**
144-
This is class is called by the **ServiceInterface**
145-
This class is a wrap around the **rrdtool** as it is a command line based tool within this class there are several methods which take in some parameters
146-
required by the corresponding rrd command and executes it.
147-
148-
**5) MonitoringCatalog (based on sqlite3):**
149-
Here all the information about the activity of the components is maintained like which rrd file to refer for what components
150-
then other details like CPU, MEM, Queries, etc. is stored here.
151-
152-
**6) ComponentMonitoringDB (based on MySQL):**
153-
This database basically stores the basic information of the components not the activity data like **Type, ComponentName, Port, Host, etc**
154-
and this all is stored under the **compmon_Components** table inside this database.
155-
The other info like version history of the components like **VersionTimestamp, DIRACVersion, etc.** is stored under **compmon_VersionHistory**
156-
table of the database.
157-
158-
**7) PlotCache**
159-
This is basically used to cache the graphs that are generated once so if the user tries to generate them again the entire
160-
process of graph generation using **RRDManager** is not performed instead a cached version of the graph is returned to reduce the
161-
response time.
162-
163-
This was just an overview of the components that **gMonitor** object interacts with more detail can be found inside the code of that particular
164-
component.
165-
The use cases of **gMonitor** object can be found inside the **DIRAC/Core/DISET/private/Service.py, DIRAC/Core/Base/AgentModule.py, Transformation System, etc.**
166110

167111
Dynamic Component Monitoring
168112
============================

docs/source/DeveloperGuide/Systems/Monitoring/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ It is based on layered architecture and is based on DIRAC architecture:
4343

4444

4545
* **Clients**
46-
* MonitoringClient is used to interact withe the Monitoring service.
4746
* Types contains all Monitoring types.
4847

4948
-------------------------------

docs/source/DeveloperGuide/Systems/RequestManagement/index.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ extend `RequestValidator` to cope with the new type. The handler should be a fun
247247
constructor (__init__) and () operator ( __call__)::
248248

249249
""" KillParrot operation handler """
250-
from DIRAC import gMonitor
251250
from DIRAC.RequestManagementSystem.private.OperationHandlerBase import OperationHandlerBase
252251
import random
253252

@@ -264,9 +263,6 @@ constructor (__init__) and () operator ( __call__)::
264263
""" constructor -- DO NOT CHANGE its arguments list """
265264
# # AND ALWAYS call BASE class constructor (or it won't work at all)
266265
OperationHandlerBase.__init__(self, request, csPath )
267-
# # put there something more if you need, i.e. gMonitor registration
268-
gMonitor.registerActivity( "ParrotsDead", ... )
269-
gMonitor.registerActivity( "ParrotsAlive", ... )
270266

271267
def __call__( self ):
272268
""" this has to be defined and should return S_OK/S_ERROR """
@@ -282,11 +278,9 @@ constructor (__init__) and () operator ( __call__)::
282278
self.log.error( "Parrot is still alive" )
283279
self.operation.Error = "It's only sleeping"
284280
self.operation.Status = "Failed"
285-
gMonitor.addMark( "ParrotsAlive" , 1 )
286281
else:
287282
self.log.info( "Parrot is stone dead")
288283
self.operation.Status = "Done"
289-
gMonitor.addMark( "ParrotsDead", 1)
290284
# # return S_OK/S_ERROR (always!!!)
291285
return S_OK()
292286

-41.2 KB
Binary file not shown.

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ console_scripts =
171171
dirac-admin-users-with-proxy = DIRAC.FrameworkSystem.scripts.dirac_admin_users_with_proxy:main [admin]
172172
dirac-install-component = DIRAC.FrameworkSystem.scripts.dirac_install_component:main [server]
173173
dirac-install-tornado-service = DIRAC.FrameworkSystem.scripts.dirac_install_tornado_service:main [server]
174-
dirac-monitoring-get-components-status = DIRAC.FrameworkSystem.scripts.dirac_monitoring_get_components_status:main [admin]
175174
dirac-myproxy-upload = DIRAC.FrameworkSystem.scripts.dirac_myproxy_upload:main
176175
dirac-populate-component-db = DIRAC.FrameworkSystem.scripts.dirac_populate_component_db:main [admin]
177176
dirac-proxy-destroy = DIRAC.FrameworkSystem.scripts.dirac_proxy_destroy:main

src/DIRAC/AccountingSystem/DB/AccountingDB.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
from DIRAC.Core.Base.DB import DB
99
from DIRAC import S_OK, S_ERROR, gConfig
10-
from DIRAC.FrameworkSystem.Client.MonitoringClient import gMonitor
1110
from DIRAC.Core.Utilities import List, ThreadSafe, Time, DEncode
1211
from DIRAC.Core.Utilities.Plotting.TypeLoader import TypeLoader
1312
from DIRAC.Core.Utilities.ThreadPool import ThreadPool
@@ -48,9 +47,6 @@ def __init__(self, name="Accounting/AccountingDB", readOnly=False):
4847
}
4948
)
5049
self.__loadCatalogFromDB()
51-
gMonitor.registerActivity("registeradded", "Register added", "Accounting", "entries", gMonitor.OP_ACUM)
52-
gMonitor.registerActivity("insertiontime", "Record insertion time", "Accounting", "seconds", gMonitor.OP_MEAN)
53-
gMonitor.registerActivity("querytime", "Records query time", "Accounting", "seconds", gMonitor.OP_MEAN)
5450

5551
self.__compactTime = datetime.time(hour=2, minute=random.randint(0, 59), second=random.randint(0, 59))
5652
lcd = Time.dateTime()
@@ -281,20 +277,6 @@ def registerType(self, name, definitionKeyFields, definitionAccountingFields, bu
281277
"""
282278
Register a new type
283279
"""
284-
gMonitor.registerActivity(
285-
"registerwaiting:%s" % name,
286-
"Records waiting for insertion for %s" % " ".join(name.split("_")),
287-
"Accounting",
288-
"records",
289-
gMonitor.OP_MEAN,
290-
)
291-
gMonitor.registerActivity(
292-
"registeradded:%s" % name,
293-
"Register added for %s" % " ".join(name.split("_")),
294-
"Accounting",
295-
"entries",
296-
gMonitor.OP_ACUM,
297-
)
298280

299281
result = self.__loadTablesCreated()
300282
if not result["OK"]:
@@ -628,16 +610,13 @@ def __insertFromINTable(self, recordTuples):
628610
result = self._update("DELETE FROM `%s` WHERE id=%s" % (_getTableName("in", typeName), iD))
629611
if not result["OK"]:
630612
self.log.error("Can't delete row from the IN table", result["Message"])
631-
gMonitor.addMark("insertiontime", Time.toEpoch() - insertionEpoch)
632613

633614
def insertRecordDirectly(self, typeName, startTime, endTime, valuesList):
634615
"""
635616
Add an entry to the type contents
636617
"""
637618
if self.__readOnly:
638619
return S_ERROR("ReadOnly mode enabled. No modification allowed")
639-
gMonitor.addMark("registeradded", 1)
640-
gMonitor.addMark("registeradded:%s" % typeName, 1)
641620
self.log.info(
642621
"Adding record", "for type %s\n [%s -> %s]" % (typeName, Time.fromEpoch(startTime), Time.fromEpoch(endTime))
643622
)
@@ -977,7 +956,6 @@ def retrieveBucketedData(
977956
result = self.__queryType(
978957
typeName, startTime, endTime, selectFields, condDict, groupFields, orderFields, "bucket", connObj=connObj
979958
)
980-
gMonitor.addMark("querytime", Time.toEpoch() - startQueryEpoch)
981959
return result
982960

983961
def __queryType(

src/DIRAC/AccountingSystem/Service/ReportGeneratorHandler.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from DIRAC import S_OK, S_ERROR, rootPath, gConfig, gLogger
1313
from DIRAC.Core.Utilities.File import mkDir
1414
from DIRAC.Core.Utilities import Time
15-
from DIRAC.FrameworkSystem.Client.MonitoringClient import gMonitor
1615
from DIRAC.AccountingSystem.DB.MultiAccountingDB import MultiAccountingDB
1716
from DIRAC.Core.Utilities.Plotting import gDataCache
1817
from DIRAC.AccountingSystem.private.MainReporter import MainReporter
@@ -59,10 +58,6 @@ def initializeHandler(cls, serviceInfo):
5958
gLogger.fatal("Can't write to %s" % dataPath)
6059
return S_ERROR("Data location is not writable")
6160
gDataCache.setGraphsLocation(dataPath)
62-
gMonitor.registerActivity("plotsDrawn", "Drawn plot images", "Accounting reports", "plots", gMonitor.OP_SUM)
63-
gMonitor.registerActivity(
64-
"reportsRequested", "Generated reports", "Accounting reports", "reports", gMonitor.OP_SUM
65-
)
6661
return S_OK()
6762

6863
def __checkPlotRequest(self, reportRequest):
@@ -121,7 +116,6 @@ def export_generatePlot(self, reportRequest):
121116
if not retVal["OK"]:
122117
return retVal
123118
reporter = MainReporter(self.__acDB, self.serviceInfoDict["clientSetup"])
124-
gMonitor.addMark("plotsDrawn")
125119
reportRequest["generatePlot"] = True
126120
return reporter.generate(reportRequest, self.getRemoteCredentials())
127121

@@ -143,7 +137,6 @@ def export_getReport(self, reportRequest):
143137
if not retVal["OK"]:
144138
return retVal
145139
reporter = MainReporter(self.__acDB, self.serviceInfoDict["clientSetup"])
146-
gMonitor.addMark("reportsRequested")
147140
reportRequest["generatePlot"] = False
148141
return reporter.generate(reportRequest, self.getRemoteCredentials())
149142

0 commit comments

Comments
 (0)