Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.threads = MultiAssignableMetrics()
# number of open file descriptors
self.fd_nums = AssignableMetrics(0)
# number of threads
self.num_threads = AssignableMetrics([])
# rss: aka "Resident Set Size"
# this is the non-swapped physical memory a process has used.
self.physical_memory = AssignableMetrics(0)
# vms: "Virtual Memory Size", this is the total
# amount of virtual memory used by the process.
self.virtual_memory = AssignableMetrics(0)
# stats about three generations of GC
# count is the number of objects in one generation
# threshold is the collect frequency of one generation
self.g1_count, self.g1_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g2_count, self.g2_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g3_count, self.g3_threshold = AssignableMetrics(0), AssignableMetrics(0)
PY_SYS_CPU_TIME = '__py-sys-cpu-time-secs'
PY_USER_CPU_TIME = '__py-user-cpu-time-secs'
PY_FD_NUMS = '__py-file-descriptors-number'
PY_PHYSICAL_MEMORY = '__py-physical-memory-byte'
PY_VIRTUAL_MEMORY = '__py-virtual-memory-byte'
PY_GC_GENERATION_1_COUNT = '__py-generation-1-count'
PY_GC_GENERATION_2_COUNT = '__py-generation-2-count'
PY_GC_GENERATION_3_COUNT = '__py-generation-3-count'
PY_GC_GENERATION_1_THRESHOLD = '__py-generation-1-collection-threshold'
PY_GC_GENERATION_2_THRESHOLD = '__py-generation-2-collection-threshold'
PY_GC_GENERATION_3_THRESHOLD = '__py-generation-3-collection-threshold'
self.metrics = {PY_SYS_CPU_TIME: self.sys_cpu_time,
PY_USER_CPU_TIME: self.user_cpu_time,
PY_FD_NUMS: self.fd_nums,
PY_PHYSICAL_MEMORY: self.physical_memory,
# threads cpu usage
self.threads = MultiAssignableMetrics()
# number of open file descriptors
self.fd_nums = AssignableMetrics(0)
# number of threads
self.num_threads = AssignableMetrics([])
# rss: aka "Resident Set Size"
# this is the non-swapped physical memory a process has used.
self.physical_memory = AssignableMetrics(0)
# vms: "Virtual Memory Size", this is the total
# amount of virtual memory used by the process.
self.virtual_memory = AssignableMetrics(0)
# stats about three generations of GC
# count is the number of objects in one generation
# threshold is the collect frequency of one generation
self.g1_count, self.g1_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g2_count, self.g2_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g3_count, self.g3_threshold = AssignableMetrics(0), AssignableMetrics(0)
PY_SYS_CPU_TIME = '__py-sys-cpu-time-secs'
PY_USER_CPU_TIME = '__py-user-cpu-time-secs'
PY_FD_NUMS = '__py-file-descriptors-number'
PY_PHYSICAL_MEMORY = '__py-physical-memory-byte'
PY_VIRTUAL_MEMORY = '__py-virtual-memory-byte'
PY_GC_GENERATION_1_COUNT = '__py-generation-1-count'
PY_GC_GENERATION_2_COUNT = '__py-generation-2-count'
PY_GC_GENERATION_3_COUNT = '__py-generation-3-count'
PY_GC_GENERATION_1_THRESHOLD = '__py-generation-1-collection-threshold'
PY_GC_GENERATION_2_THRESHOLD = '__py-generation-2-collection-threshold'
PY_GC_GENERATION_3_THRESHOLD = '__py-generation-3-collection-threshold'
self.metrics = {PY_SYS_CPU_TIME: self.sys_cpu_time,
PY_USER_CPU_TIME: self.user_cpu_time,
PY_FD_NUMS: self.fd_nums,
def __init__(self, metrics_collector):
self.process = psutil.Process()
# total sys cpu time
self.sys_cpu_time = AssignableMetrics(0)
# total user cpu time
self.user_cpu_time = AssignableMetrics(0)
# threads cpu usage
self.threads = MultiAssignableMetrics()
# number of open file descriptors
self.fd_nums = AssignableMetrics(0)
# number of threads
self.num_threads = AssignableMetrics([])
# rss: aka "Resident Set Size"
# this is the non-swapped physical memory a process has used.
self.physical_memory = AssignableMetrics(0)
# vms: "Virtual Memory Size", this is the total
# amount of virtual memory used by the process.
self.virtual_memory = AssignableMetrics(0)
# stats about three generations of GC
# count is the number of objects in one generation
# threshold is the collect frequency of one generation
self.g1_count, self.g1_threshold = AssignableMetrics(0), AssignableMetrics(0)
def __init__(self, metrics_collector):
self.process = psutil.Process()
# total sys cpu time
self.sys_cpu_time = AssignableMetrics(0)
# total user cpu time
self.user_cpu_time = AssignableMetrics(0)
# threads cpu usage
self.threads = MultiAssignableMetrics()
# number of open file descriptors
self.fd_nums = AssignableMetrics(0)
# number of threads
self.num_threads = AssignableMetrics([])
# rss: aka "Resident Set Size"
# this is the non-swapped physical memory a process has used.
self.physical_memory = AssignableMetrics(0)
# vms: "Virtual Memory Size", this is the total
# amount of virtual memory used by the process.
self.virtual_memory = AssignableMetrics(0)
# stats about three generations of GC
# count is the number of objects in one generation
# threshold is the collect frequency of one generation
self.g1_count, self.g1_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g2_count, self.g2_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g3_count, self.g3_threshold = AssignableMetrics(0), AssignableMetrics(0)
PY_SYS_CPU_TIME = '__py-sys-cpu-time-secs'
PY_USER_CPU_TIME = '__py-user-cpu-time-secs'
# total sys cpu time
self.sys_cpu_time = AssignableMetrics(0)
# total user cpu time
self.user_cpu_time = AssignableMetrics(0)
# threads cpu usage
self.threads = MultiAssignableMetrics()
# number of open file descriptors
self.fd_nums = AssignableMetrics(0)
# number of threads
self.num_threads = AssignableMetrics([])
# rss: aka "Resident Set Size"
# this is the non-swapped physical memory a process has used.
self.physical_memory = AssignableMetrics(0)
# vms: "Virtual Memory Size", this is the total
# amount of virtual memory used by the process.
self.virtual_memory = AssignableMetrics(0)
# stats about three generations of GC
# count is the number of objects in one generation
# threshold is the collect frequency of one generation
self.g1_count, self.g1_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g2_count, self.g2_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g3_count, self.g3_threshold = AssignableMetrics(0), AssignableMetrics(0)
PY_SYS_CPU_TIME = '__py-sys-cpu-time-secs'
PY_USER_CPU_TIME = '__py-user-cpu-time-secs'
PY_FD_NUMS = '__py-file-descriptors-number'
PY_PHYSICAL_MEMORY = '__py-physical-memory-byte'
PY_VIRTUAL_MEMORY = '__py-virtual-memory-byte'
PY_GC_GENERATION_1_COUNT = '__py-generation-1-count'
PY_GC_GENERATION_2_COUNT = '__py-generation-2-count'
PY_GC_GENERATION_3_COUNT = '__py-generation-3-count'
PY_GC_GENERATION_1_THRESHOLD = '__py-generation-1-collection-threshold'
PY_GC_GENERATION_2_THRESHOLD = '__py-generation-2-collection-threshold'
def __init__(self, metrics_collector):
self.process = psutil.Process()
# total sys cpu time
self.sys_cpu_time = AssignableMetrics(0)
# total user cpu time
self.user_cpu_time = AssignableMetrics(0)
# threads cpu usage
self.threads = MultiAssignableMetrics()
# number of open file descriptors
self.fd_nums = AssignableMetrics(0)
# number of threads
self.num_threads = AssignableMetrics([])
# rss: aka "Resident Set Size"
# this is the non-swapped physical memory a process has used.
self.physical_memory = AssignableMetrics(0)
# vms: "Virtual Memory Size", this is the total
# amount of virtual memory used by the process.
self.virtual_memory = AssignableMetrics(0)
# stats about three generations of GC
# count is the number of objects in one generation
# threshold is the collect frequency of one generation
self.g1_count, self.g1_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g2_count, self.g2_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g3_count, self.g3_threshold = AssignableMetrics(0), AssignableMetrics(0)
PY_SYS_CPU_TIME = '__py-sys-cpu-time-secs'
PY_USER_CPU_TIME = '__py-user-cpu-time-secs'
PY_FD_NUMS = '__py-file-descriptors-number'
PY_PHYSICAL_MEMORY = '__py-physical-memory-byte'
def __init__(self, metrics_collector):
self.process = psutil.Process()
# total sys cpu time
self.sys_cpu_time = AssignableMetrics(0)
# total user cpu time
self.user_cpu_time = AssignableMetrics(0)
# threads cpu usage
self.threads = MultiAssignableMetrics()
# number of open file descriptors
self.fd_nums = AssignableMetrics(0)
# number of threads
self.num_threads = AssignableMetrics([])
# rss: aka "Resident Set Size"
# this is the non-swapped physical memory a process has used.
self.physical_memory = AssignableMetrics(0)
# vms: "Virtual Memory Size", this is the total
# amount of virtual memory used by the process.
self.virtual_memory = AssignableMetrics(0)
# stats about three generations of GC
# count is the number of objects in one generation
# threshold is the collect frequency of one generation
self.g1_count, self.g1_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g2_count, self.g2_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g3_count, self.g3_threshold = AssignableMetrics(0), AssignableMetrics(0)
PY_SYS_CPU_TIME = '__py-sys-cpu-time-secs'
PY_USER_CPU_TIME = '__py-user-cpu-time-secs'
PY_FD_NUMS = '__py-file-descriptors-number'
PY_PHYSICAL_MEMORY = '__py-physical-memory-byte'
PY_VIRTUAL_MEMORY = '__py-virtual-memory-byte'
PY_GC_GENERATION_1_COUNT = '__py-generation-1-count'
PY_GC_GENERATION_2_COUNT = '__py-generation-2-count'
# number of open file descriptors
self.fd_nums = AssignableMetrics(0)
# number of threads
self.num_threads = AssignableMetrics([])
# rss: aka "Resident Set Size"
# this is the non-swapped physical memory a process has used.
self.physical_memory = AssignableMetrics(0)
# vms: "Virtual Memory Size", this is the total
# amount of virtual memory used by the process.
self.virtual_memory = AssignableMetrics(0)
# stats about three generations of GC
# count is the number of objects in one generation
# threshold is the collect frequency of one generation
self.g1_count, self.g1_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g2_count, self.g2_threshold = AssignableMetrics(0), AssignableMetrics(0)
self.g3_count, self.g3_threshold = AssignableMetrics(0), AssignableMetrics(0)
PY_SYS_CPU_TIME = '__py-sys-cpu-time-secs'
PY_USER_CPU_TIME = '__py-user-cpu-time-secs'
PY_FD_NUMS = '__py-file-descriptors-number'
PY_PHYSICAL_MEMORY = '__py-physical-memory-byte'
PY_VIRTUAL_MEMORY = '__py-virtual-memory-byte'
PY_GC_GENERATION_1_COUNT = '__py-generation-1-count'
PY_GC_GENERATION_2_COUNT = '__py-generation-2-count'
PY_GC_GENERATION_3_COUNT = '__py-generation-3-count'
PY_GC_GENERATION_1_THRESHOLD = '__py-generation-1-collection-threshold'
PY_GC_GENERATION_2_THRESHOLD = '__py-generation-2-collection-threshold'
PY_GC_GENERATION_3_THRESHOLD = '__py-generation-3-collection-threshold'
self.metrics = {PY_SYS_CPU_TIME: self.sys_cpu_time,
PY_USER_CPU_TIME: self.user_cpu_time,
PY_FD_NUMS: self.fd_nums,
PY_PHYSICAL_MEMORY: self.physical_memory,
PY_VIRTUAL_MEMORY: self.virtual_memory,
def __init__(self, metrics_collector):
self.process = psutil.Process()
# total sys cpu time
self.sys_cpu_time = AssignableMetrics(0)
# total user cpu time
self.user_cpu_time = AssignableMetrics(0)
# threads cpu usage
self.threads = MultiAssignableMetrics()
# number of open file descriptors
self.fd_nums = AssignableMetrics(0)
# number of threads
self.num_threads = AssignableMetrics([])
# rss: aka "Resident Set Size"
# this is the non-swapped physical memory a process has used.
self.physical_memory = AssignableMetrics(0)
# vms: "Virtual Memory Size", this is the total
# amount of virtual memory used by the process.
self.virtual_memory = AssignableMetrics(0)
# stats about three generations of GC
# count is the number of objects in one generation