public abstract class LinuxNetworkWorkerMetricBase extends Object implements WorkerMetric
WorkerMetric.WorkerMetricValue| Modifier and Type | Field and Description |
|---|---|
protected static String |
DEFAULT_INTERFACE_NAME |
protected static String |
DEFAULT_NETWORK_STAT_FILE |
| Constructor and Description |
|---|
LinuxNetworkWorkerMetricBase(OperatingRange operatingRange,
String interfaceName,
String statFile,
double maxBandwidthInMBps,
com.google.common.base.Stopwatch stopwatch) |
| Modifier and Type | Method and Description |
|---|---|
WorkerMetric.WorkerMetricValue |
capture()
Reads the stat file and find the total bytes (in and out) and divide it by the time elapsed since last read to
get the bytes per second.
|
OperatingRange |
getOperatingRange()
Gets the operating range for this workerMetrics
|
String |
getShortName()
WorkerMetricStats short name that is used as attribute name for it in storage.
|
protected abstract WorkerMetricType |
getWorkerMetricsType() |
WorkerMetricType |
getWorkerMetricType()
Type of the current WorkerMetricStats.
|
protected static final String DEFAULT_NETWORK_STAT_FILE
protected static final String DEFAULT_INTERFACE_NAME
public LinuxNetworkWorkerMetricBase(OperatingRange operatingRange, String interfaceName, String statFile, double maxBandwidthInMBps, com.google.common.base.Stopwatch stopwatch)
public String getShortName()
WorkerMetricgetShortName in interface WorkerMetricpublic OperatingRange getOperatingRange()
WorkerMetricgetOperatingRange in interface WorkerMetricpublic WorkerMetricType getWorkerMetricType()
WorkerMetricgetWorkerMetricType in interface WorkerMetricpublic WorkerMetric.WorkerMetricValue capture()
capture in interface WorkerMetricprotected abstract WorkerMetricType getWorkerMetricsType()
Copyright © 2024. All rights reserved.