Class UsageInfo
- java.lang.Object
-
- jadex.platform.service.globalservicepool.UsageInfo
-
public class UsageInfo extends java.lang.Object
Information about service usage.
-
-
Field Summary
Fields Modifier and Type Field Description protected IServiceIdentifier
sid
The service id.protected long
starttime
The start time.protected double
usages
The 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 double
calculateEma(double newval, double val)
Calculate the exponential moving average.IServiceIdentifier
getServiceIdentifier()
Get the serviceIdentifier.long
getStartTime()
Get the startTime.double
getUsages()
Get the usages.void
integrateUsage(UsageInfo ui)
Integrate a new usage info.void
setServiceIdentifier(IServiceIdentifier sid)
Set the serviceIdentifier.void
setStartTime(long startTime)
Set the startTime.void
setUsages(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.
-
-