@Private
public final class BandwidthGaugeUpdater
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
THREAD_NAME |
| Constructor | Description |
|---|---|
BandwidthGaugeUpdater(AzureFileSystemInstrumentation instrumentation) |
Create a new updater object with default values.
|
BandwidthGaugeUpdater(AzureFileSystemInstrumentation instrumentation,
int windowSizeMs,
boolean manualUpdateTrigger) |
Create a new updater object with some overrides (used in unit tests).
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
blockDownloaded(java.util.Date startDate,
java.util.Date endDate,
long length) |
Indicate that a block has been downloaded.
|
void |
blockUploaded(java.util.Date startDate,
java.util.Date endDate,
long length) |
Indicate that a block has been uploaded.
|
void |
close() |
|
void |
resumeAutoUpdate() |
Resumes auto-update (undo suppressAutoUpdate).
|
void |
suppressAutoUpdate() |
For unit test purposes, suppresses auto-update of the metrics
from the dedicated thread.
|
void |
triggerUpdate(boolean updateWrite) |
Triggers the update of the metrics gauge based on all the blocks
uploaded/downloaded so far.
|
public static final java.lang.String THREAD_NAME
public BandwidthGaugeUpdater(AzureFileSystemInstrumentation instrumentation)
instrumentation - The metrics source to update.public BandwidthGaugeUpdater(AzureFileSystemInstrumentation instrumentation, int windowSizeMs, boolean manualUpdateTrigger)
instrumentation - The metrics source to update.windowSizeMs - The window size to use for calculating bandwidth
(in milliseconds).manualUpdateTrigger - If true, then this object won't create the
auto-update threads, and will wait for manual
calls to triggerUpdate to occur.public void blockUploaded(java.util.Date startDate,
java.util.Date endDate,
long length)
startDate - The exact time the upload started.endDate - The exact time the upload ended.length - The number of bytes uploaded in the block.public void blockDownloaded(java.util.Date startDate,
java.util.Date endDate,
long length)
startDate - The exact time the download started.endDate - The exact time the download ended.length - The number of bytes downloaded in the block.public void suppressAutoUpdate()
public void resumeAutoUpdate()
public void triggerUpdate(boolean updateWrite)
updateWrite - If true, we'll update the write (upload) metrics.
Otherwise we'll update the read (download) ones.public void close()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.