Home | Trees | Indices | Help |
---|
|
1 # -------------------------------------------------------------------------- # 2 # Copyright 2006-2009, University of Chicago # 3 # Copyright 2008-2009, Distributed Systems Architecture Group, Universidad # 4 # Complutense de Madrid (dsa-research.org) # 5 # # 6 # Licensed under the Apache License, Version 2.0 (the "License"); you may # 7 # not use this file except in compliance with the License. You may obtain # 8 # a copy of the License at # 9 # # 10 # http://www.apache.org/licenses/LICENSE-2.0 # 11 # # 12 # Unless required by applicable law or agreed to in writing, software # 13 # distributed under the License is distributed on an "AS IS" BASIS, # 14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # 15 # See the License for the specific language governing permissions and # 16 # limitations under the License. # 17 # -------------------------------------------------------------------------- # 18 19 """Accounting probes that collect data on resource utilization""" 20 21 from haizea.core.accounting import AccountingProbe, AccountingDataCollection 22 from haizea.common.utils import get_clock 2325 """ 26 Collects information on CPU utilization 27 28 * Counters 29 30 - "CPU utilization": Amount of CPU resources used in the entire site 31 at a given time. The value ranges between 0 and 1. 32 33 """ 34 COUNTER_UTILIZATION="CPU utilization" 3546 4737 """See AccountingProbe.__init__""" 38 AccountingProbe.__init__(self, accounting) 39 self.accounting.create_counter(CPUUtilizationProbe.COUNTER_UTILIZATION, AccountingDataCollection.AVERAGE_TIMEWEIGHTED)4042 """See AccountingProbe.at_timestep""" 43 util = lease_scheduler.vm_scheduler.get_utilization(get_clock().get_time()) 44 utilization = sum([v for k,v in util.items() if k != None]) 45 self.accounting.append_to_counter(CPUUtilizationProbe.COUNTER_UTILIZATION, utilization)49 """ 50 Collects information on disk usage 51 52 * Counters 53 54 - "Disk usage": Maximum disk space used across nodes. 55 56 """ 57 COUNTER_DISKUSAGE="Disk usage" 586860 """See AccountingProbe.__init__""" 61 AccountingProbe.__init__(self, accounting) 62 self.accounting.create_counter(DiskUsageProbe.COUNTER_DISKUSAGE, AccountingDataCollection.AVERAGE_NONE)6365 """See AccountingProbe.at_timestep""" 66 usage = lease_scheduler.vm_scheduler.resourcepool.get_max_disk_usage() 67 self.accounting.append_to_counter(DiskUsageProbe.COUNTER_DISKUSAGE, usage)
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Dec 17 10:59:25 2009 | http://epydoc.sourceforge.net |