import re

#
# MonitorMem
# author  Maurizio Nagni
# version 1.0 - 12 September 2005
#
# Base class for all the the Monitors
#
# Parameters:     
#

class MonitorMem:
    def __init__(self):
        PAT_LOADAVG = re.compile(r"([0-9]+)\.([0-9][0-9]) +([0-9]+)\.([0-9][0-9]) +([0-9]+)\.([0-9][0-9])")
        
    def get_info(self):
        fp = open("/proc/loadavg")
        m = self.PAT_LOADAVG.match(fp.readline())
        #info.extend( [m.group(1)+m.group(2), m.group(3)+m.group(4), m.group(5)+m.group(6)] )
        fp.close()
        print 
# Example of usage
#        
#bench = Level0Benchmark('/home/nagni/benchmark.csv')
#filePath = '/home/nagni/Data/'
#fileName = 'DW_050321_202.dat'

#bench.start(fileName)
#-------------------------
# Do your operations here
#-------------------------
#bench.end()
#bench.close()

