Class UsageInfo
- java.lang.Object
-
- jadex.platform.service.globalservicepool.UsageInfo
-
public class UsageInfo extends java.lang.ObjectInformation about service usage.
-
-
Field Summary
Fields Modifier and Type Field Description protected IServiceIdentifiersidThe service id.protected longstarttimeThe start time.protected doubleusagesThe number of usages in the last time interval.
-
Constructor Summary
Constructors Constructor Description UsageInfo()Create a new UsageInfo.UsageInfo(IServiceIdentifier sid, long starttime, double usages)Create a new UsageInfo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doublecalculateEma(double newval, double val)Calculate the exponential moving average.IServiceIdentifiergetServiceIdentifier()Get the serviceIdentifier.longgetStartTime()Get the startTime.doublegetUsages()Get the usages.voidintegrateUsage(UsageInfo ui)Integrate a new usage info.voidsetServiceIdentifier(IServiceIdentifier sid)Set the serviceIdentifier.voidsetStartTime(long startTime)Set the startTime.voidsetUsages(double usages)Set the usages.
-
-
-
Field Detail
-
sid
protected IServiceIdentifier sid
The service id.
-
starttime
protected long starttime
The start time.
-
usages
protected double usages
The number of usages in the last time interval.
-
-
Constructor Detail
-
UsageInfo
public UsageInfo()
Create a new UsageInfo.
-
UsageInfo
public UsageInfo(IServiceIdentifier sid, long starttime, double usages)
Create a new UsageInfo.
-
-
Method Detail
-
getServiceIdentifier
public IServiceIdentifier getServiceIdentifier()
Get the serviceIdentifier.- Returns:
- the serviceIdentifier
-
getStartTime
public long getStartTime()
Get the startTime.- Returns:
- the startTime
-
setStartTime
public void setStartTime(long startTime)
Set the startTime.- Parameters:
startTime- The startTime to set
-
setServiceIdentifier
public void setServiceIdentifier(IServiceIdentifier sid)
Set the serviceIdentifier.- Parameters:
sid- The serviceIdentifier to set
-
getUsages
public double getUsages()
Get the usages.- Returns:
- the usages
-
setUsages
public void setUsages(double usages)
Set the usages.- Parameters:
usages- The usages to set
-
integrateUsage
public void integrateUsage(UsageInfo ui)
Integrate a new usage info. Uses ema to average the values.
-
calculateEma
protected double calculateEma(double newval, double val)Calculate the exponential moving average.
-
-