Changed all tabs to 4 spaces for python style

This commit is contained in:
Justin Gallardo
2006-12-04 11:12:24 -08:00
parent f5ae066248
commit b9f9ef0fe9
110 changed files with 9987 additions and 9987 deletions
+10 -10
View File
@@ -2,15 +2,15 @@
import info
INTERNALS = {
# Basic information
'PLGNAME': "Clean Size",
'TABNAME': None,
'AUTHOR': "Eduardo Silva",
'DESC': "Print the approx real memory usage",
# Basic information
'PLGNAME': "Clean Size",
'TABNAME': None,
'AUTHOR': "Eduardo Silva",
'DESC': "Print the approx real memory usage",
# Plugin API
'Plg': None, # Plugin object
# Plugin API
'Plg': None, # Plugin object
'top_data': [int], # Top data types needed by memphis core plugin
'top_cols': ["Approx Real Usage (kb)"]
}
'top_data': [int], # Top data types needed by memphis core plugin
'top_cols': ["Approx Real Usage (kb)"]
}
+5 -5
View File
@@ -7,9 +7,9 @@
############################################################
def plg_on_top_data_refresh(self, pinfo):
# Get clean size
maps = self.INTERNALS['Plg'].proc_get_maps(pinfo['pid'])
# Get clean size
maps = self.INTERNALS['Plg'].proc_get_maps(pinfo['pid'])
size = (maps.clean_size/1024)
return [size]
size = (maps.clean_size/1024)
return [size]
+12 -12
View File
@@ -2,20 +2,20 @@ import os
import info
INTERNALS = {
'PLGNAME': "cpu",
'TABNAME': None,
'AUTHOR': "Eduardo Silva",
'DESC': "Print CPU usage",
'PLGNAME': "cpu",
'TABNAME': None,
'AUTHOR': "Eduardo Silva",
'DESC': "Print CPU usage",
# Plugin API
'Plg': None, # Plugin object
'current_plg': None, # Current plugin object
'current_page': None, # Current page number
# Plugin API
'Plg': None, # Plugin object
'current_plg': None, # Current plugin object
'current_page': None, # Current page number
# Top process view requirements
'top_data': [int], # Top data types needed by memphis core plugin
'top_cols': ["%CPU "] # Column names
}
# Top process view requirements
'top_data': [int], # Top data types needed by memphis core plugin
'top_cols': ["%CPU "] # Column names
}
# Get CPU frequency
cpu_hz = os.sysconf(2)
+32 -32
View File
@@ -7,42 +7,42 @@
############################################################
def plg_on_top_data_refresh(self, pinfo):
PI = self.INTERNALS['Plg'].proc
pid = pinfo['pid']
# Get JIFFIES CPU usage
used_jiffies = pinfo['utime'] + pinfo['stime']
last_ujiffies = get_pid_ujiffies(self, pid)
cpu_usage = PI.get_CPU_usage(self.cpu_hz, used_jiffies, pinfo['start_time'])
PI = self.INTERNALS['Plg'].proc
pid = pinfo['pid']
# Get JIFFIES CPU usage
used_jiffies = pinfo['utime'] + pinfo['stime']
last_ujiffies = get_pid_ujiffies(self, pid)
cpu_usage = PI.get_CPU_usage(self.cpu_hz, used_jiffies, pinfo['start_time'])
# Get PERCENT CPU usage
if last_ujiffies == 0.0:
pcpu = 0.0
set_pid_ujiffies(self, pid, cpu_usage['used_jiffies'])
data = [int(pcpu)]
return data
used_jiffies = cpu_usage['used_jiffies'] - last_ujiffies
# Get PERCENT CPU usage
if last_ujiffies == 0.0:
pcpu = 0.0
set_pid_ujiffies(self, pid, cpu_usage['used_jiffies'])
data = [int(pcpu)]
return data
used_jiffies = cpu_usage['used_jiffies'] - last_ujiffies
# Available jiffies are
avail_jiffies = (500/1000.0)*self.cpu_hz # 500 = 0.5 second
pcpu = ((used_jiffies*100)/avail_jiffies)
set_pid_ujiffies(self, pid, cpu_usage['used_jiffies'])
data = [int(pcpu)]
return data
# Available jiffies are
avail_jiffies = (500/1000.0)*self.cpu_hz # 500 = 0.5 second
pcpu = ((used_jiffies*100)/avail_jiffies)
set_pid_ujiffies(self, pid, cpu_usage['used_jiffies'])
data = [int(pcpu)]
return data
def get_pid_ujiffies(self, pid):
if pid in self.pids_ujiffies:
return self.pids_ujiffies[pid]
else:
set_pid_ujiffies(self, pid, 0)
return self.pids_ujiffies[pid]
if pid in self.pids_ujiffies:
return self.pids_ujiffies[pid]
else:
set_pid_ujiffies(self, pid, 0)
return self.pids_ujiffies[pid]
def set_pid_ujiffies(self, pid, ujiffies):
self.pids_ujiffies[pid] = ujiffies
self.pids_ujiffies[pid] = ujiffies
+10 -10
View File
@@ -3,15 +3,15 @@ import info
INTERNALS = {
# Basic information
'PLGNAME': "Dirty Size",
'TABNAME': None, # No tabbed plugin
'AUTHOR': "Eduardo Silva",
'DESC': "Get dirty size memory usage",
# Basic information
'PLGNAME': "Dirty Size",
'TABNAME': None, # No tabbed plugin
'AUTHOR': "Eduardo Silva",
'DESC': "Get dirty size memory usage",
# Plugin API
'Plg': None, # Plugin object
# Plugin API
'Plg': None, # Plugin object
'top_data': [int], # Top data types needed by memphis core plugin
'top_cols': ["PDRSS (kb)"]
}
'top_data': [int], # Top data types needed by memphis core plugin
'top_cols': ["PDRSS (kb)"]
}
+6 -6
View File
@@ -9,12 +9,12 @@
def plg_on_top_data_refresh(self, ppinfo):
dirty_sizes = get_dirty(self, ppinfo['pid'])
# memhis need an array
return [dirty_sizes['private']]
dirty_sizes = get_dirty(self, ppinfo['pid'])
# memhis need an array
return [dirty_sizes['private']]
def get_dirty(pself, pid):
ProcAnalysis = pself.INTERNALS['Plg'].proc_analysis(pid)
ProcAnalysis = pself.INTERNALS['Plg'].proc_analysis(pid)
return ProcAnalysis.DirtyRSS()
return ProcAnalysis.DirtyRSS()
+10 -10
View File
@@ -1,15 +1,15 @@
import info
INTERNALS = {
'PLGNAME': "memphis",
'TABNAME': None,
'AUTHOR': "Eduardo Silva",
'DESC': "Print basic process information",
'PLGNAME': "memphis",
'TABNAME': None,
'AUTHOR': "Eduardo Silva",
'DESC': "Print basic process information",
# Plugin API
'Plg': None, # Plugin object
# Plugin API
'Plg': None, # Plugin object
# Top process view requirements
'top_data': [int, str, str], # Top data types needed by memphis core plugin
'top_cols': ["PID", "Process Name", "Status"] # Column names
}
# Top process view requirements
'top_data': [int, str, str], # Top data types needed by memphis core plugin
'top_cols': ["PID", "Process Name", "Status"] # Column names
}
+3 -3
View File
@@ -8,6 +8,6 @@
def plg_on_top_data_refresh(self, ppinfo):
data = [ppinfo['pid'], ppinfo['name'], ppinfo['state_name']]
return data
data = [ppinfo['pid'], ppinfo['name'], ppinfo['state_name']]
return data