Class NozzleMetricsService
java.lang.Object
com.kosdev.kos.ext.dispense.service.nozzle.metrics.NozzleMetricsService
Manages all the pour metrics.
- Since:
- 1
- Version:
- 1
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddGlobalMetrics(String name) Register global metrics with the service.addMetrics(Nozzle nozzle, String name) Register metrics with the service relative to the specified nozzle.Return all the active metricsgetAllMetrics(Nozzle nozzle) Return all the active metrics for the specified nozzle.getGlobalMetrics(String name) Return the global metrics with the specified name.Return the list of global metrics names.getLastBeveragePourMetrics(Nozzle nozzle) Return the metrics that track the most recent beverage pour.getMetrics(Nozzle nozzle, String name) Return the metrics with the specified name for the specified nozzle.getMetricsNames(Nozzle nozzle) Return the list of metrics names for the specified nozzle.Return the metrics that track total volume poured.removeGlobalMetrics(String name) Remove global metrics with the specified name.removeMetrics(Nozzle nozzle, String name) Remove metrics with the specified name from the nozzle.
-
Field Details
-
NO_INGREDIENT_ID
- See Also:
-
-
Method Details
-
getTotalMetrics
Return the metrics that track total volume poured.- Returns:
- total pour metrics
- Since:
- 1
-
getLastBeveragePourMetrics
Return the metrics that track the most recent beverage pour.- Parameters:
nozzle- the nozzle to return metrics for- Returns:
- last pour metrics
- Since:
- 1
-
addGlobalMetrics
Register global metrics with the service. These will be updated with pour data regardless of how the ingredient is poured (both beverage and ingredient pours). Adding a name that already exists will simply callreset()on the existing metrics.Global metrics will track all pour data across all nozzles.
Internal metrics cannot be replaced and will throw
InvalidMetricsException.- Parameters:
name- name of the metrics to add / replace- Returns:
- the new metrics object
- Since:
- 1
-
addMetrics
Register metrics with the service relative to the specified nozzle. These will be updated with pour data regardless of how the ingredient is poured (both beverage and ingredient pours). Adding a name that already exists will simply callreset()on the existing metrics.This will track metrics specific to the specified nozzle.
Internal metrics cannot be replaced and will throw
InvalidMetricsException.- Parameters:
nozzle- the nozzle the metrics are relative toname- name of the metrics to add / replace- Returns:
- the new metrics object
- Since:
- 1
-
removeGlobalMetrics
Remove global metrics with the specified name.Internal metrics cannot be removed and will throw
InvalidMetricsException- Parameters:
name- name of the metrics to remove- Returns:
- the metrics that were removed
- Since:
- 1
-
removeMetrics
Remove metrics with the specified name from the nozzle.Internal metrics cannot be removed and will throw
InvalidMetricsException- Parameters:
nozzle- the nozzle to remove metrics fromname- name of the metrics to remove- Returns:
- the metrics that were removed
- Since:
- 1
-
getGlobalMetricsNames
Return the list of global metrics names.- Returns:
- the list of global metrics names
- Since:
- 1
-
getAllGlobalMetrics
Return all the active metrics- Since:
- 1
-
getGlobalMetrics
Return the global metrics with the specified name.- Parameters:
name- name of the metrics- Returns:
- the named metrics
- Since:
- 1
-
getMetricsNames
Return the list of metrics names for the specified nozzle.- Parameters:
nozzle- the nozzle to return names for- Returns:
- the list of metrics names
- Since:
- 1
-
getAllMetrics
Return all the active metrics for the specified nozzle.- Parameters:
nozzle- the nozzle to return metrics for- Returns:
- the list of metrics
- Since:
- 1
-
getMetrics
Return the metrics with the specified name for the specified nozzle.- Parameters:
nozzle- the nozzle to queryname- name of the metrics- Returns:
- the named metrics
- Since:
- 1
-