Rio Project 4.2 API Documentation



org.rioproject.cybernode
Class ServiceCostCalculator

java.lang.Object
  extended by org.rioproject.cybernode.ServiceCostCalculator

public class ServiceCostCalculator
extends Object

Used to calculate resource costs for a service.

Author:
Dennis Reedy

Constructor Summary
ServiceCostCalculator()
           
 
Method Summary
 ResourceCost[] calculateCosts(long duration)
          Calculate ResourceCost instances for cpu, memory, matched platform capabilities and software downloads
 void setComputeResource(ComputeResource computeResource)
          Set the ComputeResource
 void setDownloadRecords(DownloadRecord[] downloadRecords)
          Set DownloadRecord instances
 void setServiceBeanContext(ServiceBeanContext context)
          Set the ServiceBeanContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceCostCalculator

public ServiceCostCalculator()
Method Detail

setComputeResource

public void setComputeResource(ComputeResource computeResource)
Set the ComputeResource

Parameters:
computeResource - The ComputeResource object, used to access resource cost producers

setServiceBeanContext

public void setServiceBeanContext(ServiceBeanContext context)
Set the ServiceBeanContext

Parameters:
context - The ServiceBeanContext. This is used to assist in creating ResourceCost objects for any matched platform cCapability declarations.

setDownloadRecords

public void setDownloadRecords(DownloadRecord[] downloadRecords)
Set DownloadRecord instances

Parameters:
downloadRecords - An array of DownloadRecord instances, documenting that software bundles have been installed onto the compute resource. Each DownloadRecord will be used to compute a ResourceCost for disk space use.

calculateCosts

public ResourceCost[] calculateCosts(long duration)
Calculate ResourceCost instances for cpu, memory, matched platform capabilities and software downloads

Parameters:
duration - The time between cost calculations
Returns:
An array of ResourceCost objects containing at least a ResourceCost for cpu and memory.
  • Both cpu and memory resource costs are computed as the mean of the calculated utilizations each respective MeasurableCapability has recorded over the time period provided.
  • For each matched PlatformCapability class a ResourceCost is added.
  • If there are DownloadRecord instances, a ResourceCost for disk space use is computed using the size of the downloadS() after extraction.

Copyright © Rio Project.

Copyright © 2006-2011 Rio Project. All Rights Reserved.