Class NozzleMetrics
java.lang.Object
com.tccc.kos.ext.dispense.service.nozzle.metrics.NozzleMetrics
Accumulates pour data for a
Nozzle
.- Version:
- 2024-01-29
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAction
(NozzleMetricsAction action) Add an action to the metrics.Return volume data by ingredientId.Return volume data by pump path.Get the creation date of the metrics.long
Get the creation time of the metrics.Return the list of ingredientId's that have been tracked.double
getIngredientVolume
(String ingredientId) Get the volume for the specified ingredientId.long
Return the last time the data changed in mono time.long
Return the last time the data changed.getName()
Return the name of the metricsReturn the list of pump paths that have been tracked.double
getPumpVolume
(Pump<?> pump) Get the volume for the specified pump.double
Return the total volume poured.boolean
Return true if this bean is an internally managed metrics.boolean
isLocked()
Return true if the metrics is locked and no longer recording data.boolean
Return true when the metrics have been removed from the service.void
Record data about volume of ingredients pumped.void
removeAction
(NozzleMetricsAction action) Remove an action from the metrics.void
reset()
Reset the contents of the metrics back to zero.void
Reset metrics for the specified pump.void
setLocked
(boolean locked) Change the lock state of the metric.
-
Constructor Details
-
NozzleMetrics
public NozzleMetrics()
-
-
Method Details
-
getName
Return the name of the metrics -
addAction
Add an action to the metrics.- Parameters:
action
- the action to add
-
removeAction
Remove an action from the metrics.- Parameters:
action
- the action to remove
-
isInternal
public boolean isInternal()Return true if this bean is an internally managed metrics.- Returns:
- true if can't be deleted
-
setLocked
public void setLocked(boolean locked) Change the lock state of the metric. Doesn't record data while locked.- Parameters:
locked
- the new lock value
-
isLocked
public boolean isLocked()Return true if the metrics is locked and no longer recording data.- Returns:
- true if locked
-
record
Record data about volume of ingredients pumped.- Parameters:
pump
- the pump that pouredingredientId
- the ingredientvolume
- the number of ml poured
-
getCreationDate
Get the creation date of the metrics.- Returns:
- the date the metrics was created
-
getCreationTimeMS
public long getCreationTimeMS()Get the creation time of the metrics.- Returns:
- the time the metrics was created in msec
-
getLastChangedTimeMS
public long getLastChangedTimeMS()Return the last time the data changed.- Returns:
- the last change time
-
getLastChangedTimeMono
public long getLastChangedTimeMono()Return the last time the data changed in mono time.- Returns:
- the last change time in mono time
-
getIngredientVolume
Get the volume for the specified ingredientId.- Parameters:
ingredientId
- the ingredient to return volume data for
-
getPumpVolume
Get the volume for the specified pump.- Parameters:
pump
- the pump to return volume data for
-
getTotalVolume
public double getTotalVolume()Return the total volume poured.- Returns:
- the total volume so far
-
getIngredientIds
Return the list of ingredientId's that have been tracked.- Returns:
- list of ingredientId's in this metrics
-
getPumpPaths
Return the list of pump paths that have been tracked.- Returns:
- list of pump paths in this metrics
-
getByIngredients
public Map<String,com.tccc.kos.ext.dispense.service.nozzle.metrics.NozzleMetrics.Info> getByIngredients()Return volume data by ingredientId. -
getByPumps
Return volume data by pump path. -
reset
public void reset()Reset the contents of the metrics back to zero. -
resetPump
Reset metrics for the specified pump. This doesn't adjust the total so the sum of the pump volumes will no longer match the total.- Parameters:
pump
- the pump metrics to reset
-
isRemoved
public boolean isRemoved()Return true when the metrics have been removed from the service.- Returns:
- true when removed from the service
-