File indexing completed on 2026-04-10 08:39:14
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 from os import getcwd
0011 from .services import Services
0012
0013 import logging
0014 logger = logging.getLogger(__name__)
0015
0016
0017 class MemoryMonitoring(Services):
0018 """
0019 Memory monitoring service class.
0020 """
0021
0022 user = ""
0023 pid = 0
0024 workdir = ""
0025 _cmd = ""
0026
0027 def __init__(self, **kwargs):
0028 """
0029 Init function.
0030
0031 :param kwargs:
0032 """
0033
0034 for key in kwargs:
0035 setattr(self, key, kwargs[key])
0036
0037 if not self.workdir:
0038 self.workdir = getcwd()
0039
0040 if self.user:
0041 user_utility = __import__('pilot.user.%s.utilities' % self.user, globals(), locals(), [self.user], 0)
0042 self._cmd = user_utility.get_memory_monitor_setup(self.pid, self.workdir)
0043
0044 def get_command(self):
0045 """
0046 Return the full command for the memory monitor.
0047
0048 :return: command string.
0049 """
0050
0051 return self._cmd
0052
0053 def execute(self):
0054 """
0055 Execute the memory monitor command.
0056 Return the process.
0057
0058 :return: process.
0059 """
0060
0061 return None
0062
0063 def get_filename(self):
0064 """
0065 ..
0066
0067 :return:
0068 """
0069
0070 return ""
0071
0072 def get_results(self):
0073 """
0074 ..
0075
0076 :return:
0077 """
0078
0079 return None