Class AzureFileSystemInstrumentation
java.lang.Object
org.apache.hadoop.fs.azure.metrics.AzureFileSystemInstrumentation
- All Implemented Interfaces:
MetricsSource
@Metrics(about="Metrics for WASB",
context="azureFileSystem")
@Public
@Evolving
public final class AzureFileSystemInstrumentation
extends Object
implements MetricsSource
A metrics source for the WASB file system to track all the metrics we care
about for getting a clear picture of the performance/reliability/interaction
of the Hadoop cluster with Azure Storage.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidblockDownloaded(long latency) Indicate that we just downloaded a block and record its latency.voidblockUploaded(long latency) Indicate that we just uploaded a block and record its latency.voidIndicate that we just encountered a client-side error.voidcurrentDownloadBytesPerSecond(long bytesPerSecond) Record the current bytes-per-second download rate seen.voidcurrentUploadBytesPerSecond(long bytesPerSecond) Record the current bytes-per-second upload rate seen.voidIndicate that we just created a directory through WASB.voidIndicate that we just deleted a directory through WASB.voidIndicate that we just created a file through WASB.voidIndicate that we just deleted a file through WASB.longGet the current rolling average of the download latency.longGet the current rolling average of the upload latency.longGet the current maximum download bandwidth.longGet the current maximum upload bandwidth.longGets the current number of web responses obtained from Azure Storage.The unique identifier for this file system in the metrics.voidgetMetrics(MetricsCollector builder, boolean all) Get metrics from the metrics sourceGet the metrics registry information.voidrawBytesDownloaded(long numberOfBytes) Indicate that we just downloaded some data to Azure storage.voidrawBytesUploaded(long numberOfBytes) Indicate that we just uploaded some data to Azure storage.voidIndicate that we just encountered a server-caused error.voidsetAccountName(String accountName) Sets the account name to tag all the metrics with.voidsetContainerName(String containerName) Sets the container name to tag all the metrics with.voidupdateBytesReadInLastSecond(long currentBytesRead) Sets the current gauge value for how many bytes were read in the last second.voidupdateBytesWrittenInLastSecond(long currentBytesWritten) Sets the current gauge value for how many bytes were written in the last second.voidIndicate that we just got a web response from Azure Storage.
-
Field Details
-
METRIC_TAG_FILESYSTEM_ID
- See Also:
-
METRIC_TAG_ACCOUNT_NAME
- See Also:
-
METRIC_TAG_CONTAINTER_NAME
- See Also:
-
WASB_WEB_RESPONSES
- See Also:
-
WASB_BYTES_WRITTEN
- See Also:
-
WASB_BYTES_READ
- See Also:
-
WASB_RAW_BYTES_UPLOADED
- See Also:
-
WASB_RAW_BYTES_DOWNLOADED
- See Also:
-
WASB_FILES_CREATED
- See Also:
-
WASB_FILES_DELETED
- See Also:
-
WASB_DIRECTORIES_CREATED
- See Also:
-
WASB_DIRECTORIES_DELETED
- See Also:
-
WASB_UPLOAD_RATE
- See Also:
-
WASB_DOWNLOAD_RATE
- See Also:
-
WASB_UPLOAD_LATENCY
- See Also:
-
WASB_DOWNLOAD_LATENCY
- See Also:
-
WASB_CLIENT_ERRORS
- See Also:
-
WASB_SERVER_ERRORS
- See Also:
-
-
Constructor Details
-
AzureFileSystemInstrumentation
-
-
Method Details
-
getFileSystemInstanceId
The unique identifier for this file system in the metrics.- Returns:
- The unique identifier.
-
getMetricsRegistryInfo
Get the metrics registry information.- Returns:
- The metrics registry information.
-
setAccountName
Sets the account name to tag all the metrics with.- Parameters:
accountName- The account name.
-
setContainerName
Sets the container name to tag all the metrics with.- Parameters:
containerName- The container name.
-
webResponse
public void webResponse()Indicate that we just got a web response from Azure Storage. This should be called for every web request/response we do (to get accurate metrics of how we're hitting the storage service). -
getCurrentWebResponses
public long getCurrentWebResponses()Gets the current number of web responses obtained from Azure Storage.- Returns:
- The number of web responses.
-
fileCreated
public void fileCreated()Indicate that we just created a file through WASB. -
fileDeleted
public void fileDeleted()Indicate that we just deleted a file through WASB. -
directoryCreated
public void directoryCreated()Indicate that we just created a directory through WASB. -
directoryDeleted
public void directoryDeleted()Indicate that we just deleted a directory through WASB. -
updateBytesWrittenInLastSecond
public void updateBytesWrittenInLastSecond(long currentBytesWritten) Sets the current gauge value for how many bytes were written in the last second.- Parameters:
currentBytesWritten- The number of bytes.
-
updateBytesReadInLastSecond
public void updateBytesReadInLastSecond(long currentBytesRead) Sets the current gauge value for how many bytes were read in the last second.- Parameters:
currentBytesRead- The number of bytes.
-
currentUploadBytesPerSecond
public void currentUploadBytesPerSecond(long bytesPerSecond) Record the current bytes-per-second upload rate seen.- Parameters:
bytesPerSecond- The bytes per second.
-
currentDownloadBytesPerSecond
public void currentDownloadBytesPerSecond(long bytesPerSecond) Record the current bytes-per-second download rate seen.- Parameters:
bytesPerSecond- The bytes per second.
-
rawBytesUploaded
public void rawBytesUploaded(long numberOfBytes) Indicate that we just uploaded some data to Azure storage.- Parameters:
numberOfBytes- The raw number of bytes uploaded (including overhead).
-
rawBytesDownloaded
public void rawBytesDownloaded(long numberOfBytes) Indicate that we just downloaded some data to Azure storage.- Parameters:
numberOfBytes- The raw number of bytes downloaded (including overhead).
-
blockUploaded
public void blockUploaded(long latency) Indicate that we just uploaded a block and record its latency.- Parameters:
latency- The latency in milliseconds.
-
blockDownloaded
public void blockDownloaded(long latency) Indicate that we just downloaded a block and record its latency.- Parameters:
latency- The latency in milliseconds.
-
clientErrorEncountered
public void clientErrorEncountered()Indicate that we just encountered a client-side error. -
serverErrorEncountered
public void serverErrorEncountered()Indicate that we just encountered a server-caused error. -
getBlockUploadLatency
public long getBlockUploadLatency()Get the current rolling average of the upload latency.- Returns:
- rolling average of upload latency in milliseconds.
-
getBlockDownloadLatency
public long getBlockDownloadLatency()Get the current rolling average of the download latency.- Returns:
- rolling average of download latency in milliseconds.
-
getCurrentMaximumUploadBandwidth
public long getCurrentMaximumUploadBandwidth()Get the current maximum upload bandwidth.- Returns:
- maximum upload bandwidth in bytes per second.
-
getCurrentMaximumDownloadBandwidth
public long getCurrentMaximumDownloadBandwidth()Get the current maximum download bandwidth.- Returns:
- maximum download bandwidth in bytes per second.
-
getMetrics
Description copied from interface:MetricsSourceGet metrics from the metrics source- Specified by:
getMetricsin interfaceMetricsSource- Parameters:
builder- to contain the resulting metrics snapshotall- if true, return all metrics even if unchanged.
-