public class LoadController extends Object implements ILoadController
| Modifier and Type | Field and Description |
|---|---|
protected long |
lastStatTimestamp |
protected long |
statsDelay |
| Constructor and Description |
|---|
LoadController(org.thales.punch.libraries.metrics.api.IMetricContext metricsContext)
All load controller benefit from the pending metric, that reports the current number
pf pending tuples in the topology.
|
| Modifier and Type | Method and Description |
|---|---|
void |
ack(long v)
update the controller statistics.
|
LoadController |
configure(org.thales.punch.settings.api.ISettingsMap settings)
Configure a load controller.
|
protected void |
debug()
dump some useful infos.
|
static LoadController |
factory(org.thales.punch.settings.api.ISettingsMap settings,
org.thales.punch.libraries.metrics.api.IMetricContext metricsContext)
Return a load controller as configured in the settings.
|
void |
fail(long v)
update the controller statistics.
|
int |
getCurrentRate() |
void |
regulate()
regulate the traffic, this method potentially take some time before returning.
|
ILoadController |
setMaxTimeoutSec(int v)
Set the time considered as the maximum traversal time.
|
protected long lastStatTimestamp
protected long statsDelay
public LoadController(org.thales.punch.libraries.metrics.api.IMetricContext metricsContext)
metricsContext - the metric context and registry providerpublic void ack(long v)
ILoadControllerack in interface ILoadControllerv - the traversal time of a tuple, in millisecondspublic void fail(long v)
ILoadControllerfail in interface ILoadControllerv - the traversal time of a tuple, in millisecondspublic ILoadController setMaxTimeoutSec(int v)
ILoadControllersetMaxTimeoutSec in interface ILoadControllerv - the maximum traversal timepublic void regulate()
ILoadControllerregulate in interface ILoadControllerprotected void debug()
public LoadController configure(org.thales.punch.settings.api.ISettingsMap settings)
settings - the caller load contraoller settingspublic static LoadController factory(org.thales.punch.settings.api.ISettingsMap settings, org.thales.punch.libraries.metrics.api.IMetricContext metricsContext)
settings - a settings map including a load controller configuration.metricsContext - the IMetricContext to be used.public int getCurrentRate()
getCurrentRate in interface ILoadControllerCopyright © 2023. All rights reserved.