New developer-console
This commit is contained in:
committed by
Marco Pesenti Gritti
parent
9a7518f230
commit
d51031d882
@@ -0,0 +1,6 @@
|
||||
|
||||
sugardir = $(pkgdatadir)/shell/console/plugins/clean_size
|
||||
sugar_PYTHON = \
|
||||
README \
|
||||
__init__.py \
|
||||
info.py
|
||||
@@ -0,0 +1,2 @@
|
||||
This plugin give support to get the clean size memory usage
|
||||
by process using the /proc/PID/maps file.
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
import info
|
||||
|
||||
INTERNALS = {
|
||||
# Basic information
|
||||
'PLGNAME': "Clean Size",
|
||||
'TABNAME': None,
|
||||
'AUTHOR': "Eduardo Silva",
|
||||
'DESC': "Print the approx real memory usage",
|
||||
|
||||
# Plugin API
|
||||
'Plg': None, # Plugin object
|
||||
|
||||
'top_data': [int], # Top data types needed by memphis core plugin
|
||||
'top_cols': ["Approx Real Usage (kb)"]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
###########################################################
|
||||
# Main function:
|
||||
# -----------------
|
||||
# self: self plugin object
|
||||
# mself: memphis object / principal class
|
||||
# pinfo: row with information about current tracing process
|
||||
############################################################
|
||||
|
||||
def plg_on_top_data_refresh(self, pinfo):
|
||||
|
||||
# Get clean size
|
||||
maps = self.INTERNALS['Plg'].proc_get_maps(pinfo['pid'])
|
||||
|
||||
size = (maps.clean_size/1024)
|
||||
return [size]
|
||||
Reference in New Issue
Block a user