@InterfaceAudience.Private @InterfaceStability.Evolving public class S3AInstrumentation extends Object implements Closeable, org.apache.hadoop.metrics2.MetricsSource
AzureFileSystemInstrumentation.
Counters and metrics are generally addressed in code by their name or
Statistic key. There may be some Statistics which do
not have an entry here. To avoid attempts to access such counters failing,
the operations to increment/query metric values are designed to handle
lookup failures.| Modifier and Type | Class and Description |
|---|---|
class |
S3AInstrumentation.CommitterStatistics
Instrumentation exported to S3Guard Committers.
|
class |
S3AInstrumentation.InputStreamStatistics
Statistics updated by an input stream during its actual operation.
|
class |
S3AInstrumentation.OutputStreamStatistics
Statistics updated by an output stream during its actual operation.
|
class |
S3AInstrumentation.S3GuardInstrumentation
Instrumentation exported to S3Guard.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
CONTEXT
"s3aFileSystem" Currently all s3a metrics are placed in a single
"context".
|
static String |
METRIC_TAG_BUCKET
"bucket" The name of a field added to metrics records
that indicates the hostname portion of the FS URL.
|
static String |
METRIC_TAG_FILESYSTEM_ID
"s3aFileSystemId" The name of a field added to metrics
records that uniquely identifies a specific FileSystem instance.
|
static String |
METRICS_SYSTEM_NAME
"s3a-file-system" The name of the s3a-specific metrics
system instance used for s3a metrics.
|
| Constructor and Description |
|---|
S3AInstrumentation(URI name) |
| Modifier and Type | Method and Description |
|---|---|
void |
addValueToQuantiles(Statistic op,
long value)
Add a value to a quantiles statistic.
|
void |
close() |
protected org.apache.hadoop.metrics2.lib.MutableCounterLong |
counter(Statistic op)
Create a counter in the registry.
|
protected org.apache.hadoop.metrics2.lib.MutableCounterLong |
counter(String name,
String desc)
Create a counter in the registry.
|
void |
decrementGauge(Statistic op,
long count)
Decrement a specific gauge.
|
void |
directoryCreated()
Indicate that S3A created a directory.
|
void |
directoryDeleted()
Indicate that S3A just deleted a directory.
|
String |
dump(String prefix,
String separator,
String suffix,
boolean all)
Dump all the metrics to a string.
|
void |
errorIgnored()
Note that an error was ignored.
|
void |
fakeDirsDeleted(int count)
Indicate that fake directory request was made.
|
void |
fileCreated()
Indicate that S3A created a file.
|
void |
fileDeleted(int count)
Indicate that S3A deleted one or more files.
|
void |
filesCopied(int files,
long size)
Indicate that S3A copied some files within the store.
|
protected org.apache.hadoop.metrics2.lib.MutableGaugeLong |
gauge(String name,
String desc)
Create a gauge in the registry.
|
long |
getCounterValue(Statistic statistic)
Get the value of a counter.
|
long |
getCounterValue(String name)
Get the value of a counter.
|
void |
getMetrics(org.apache.hadoop.metrics2.MetricsCollector collector,
boolean all) |
org.apache.hadoop.metrics2.MetricsSystem |
getMetricsSystem() |
org.apache.hadoop.metrics2.lib.MetricsRegistry |
getRegistry()
Get the metrics registry.
|
S3AInstrumentation.S3GuardInstrumentation |
getS3GuardInstrumentation()
Create a S3Guard instrumentation instance.
|
void |
incrementCounter(Statistic op,
AtomicLong count)
Increment a specific counter.
|
void |
incrementCounter(Statistic op,
long count)
Increment a specific counter.
|
void |
incrementGauge(Statistic op,
long count)
Increment a specific gauge.
|
org.apache.hadoop.metrics2.lib.MutableGaugeLong |
lookupGauge(String name)
Look up a gauge.
|
org.apache.hadoop.metrics2.lib.MutableMetric |
lookupMetric(String name)
Look up a metric from both the registered set and the lighter weight
stream entries.
|
org.apache.hadoop.metrics2.lib.MutableQuantiles |
lookupQuantiles(String name)
Look up a quantiles.
|
protected org.apache.hadoop.metrics2.lib.MutableQuantiles |
quantiles(Statistic op,
String sampleName,
String valueName,
int interval)
Create a quantiles in the registry.
|
Map<String,Long> |
toMap()
Copy all the metrics to a map of (name, long-value).
|
public static final String METRICS_SYSTEM_NAME
public static final String CONTEXT
public static final String METRIC_TAG_FILESYSTEM_ID
public static final String METRIC_TAG_BUCKET
public S3AInstrumentation(URI name)
public org.apache.hadoop.metrics2.MetricsSystem getMetricsSystem()
protected final org.apache.hadoop.metrics2.lib.MutableCounterLong counter(String name, String desc)
name - counter namedesc - counter descriptionprotected final org.apache.hadoop.metrics2.lib.MutableCounterLong counter(Statistic op)
op - statistic to countprotected final org.apache.hadoop.metrics2.lib.MutableGaugeLong gauge(String name, String desc)
name - name gauge namedesc - descriptionprotected final org.apache.hadoop.metrics2.lib.MutableQuantiles quantiles(Statistic op, String sampleName, String valueName, int interval)
op - statistic to collectsampleName - sample name of the quantilesvalueName - value name of the quantilesinterval - interval of the quantiles in secondspublic org.apache.hadoop.metrics2.lib.MetricsRegistry getRegistry()
public String dump(String prefix, String separator, String suffix, boolean all)
prefix - prefix before every entryseparator - separator between name and valuesuffix - suffixall - get all the metrics even if the values are not changed.public long getCounterValue(Statistic statistic)
statistic - the operationpublic long getCounterValue(String name)
name - the name of the counterpublic org.apache.hadoop.metrics2.lib.MutableGaugeLong lookupGauge(String name)
name - gauge nameClassCastException - if the metric is not a Gauge.public org.apache.hadoop.metrics2.lib.MutableQuantiles lookupQuantiles(String name)
name - quantiles nameClassCastException - if the metric is not a Quantiles.public org.apache.hadoop.metrics2.lib.MutableMetric lookupMetric(String name)
name - metric namepublic void fileCreated()
public void fileDeleted(int count)
count - number of files.public void fakeDirsDeleted(int count)
count - number of directory entries included in the delete request.public void directoryCreated()
public void directoryDeleted()
public void filesCopied(int files,
long size)
files - number of filessize - total size in bytespublic void errorIgnored()
public void incrementCounter(Statistic op, long count)
op - operationcount - increment valuepublic void addValueToQuantiles(Statistic op, long value)
op - operation to look up.value - value to add.ClassCastException - if the metric is not a Quantiles.public void incrementCounter(Statistic op, AtomicLong count)
op - operationcount - atomic long containing valuepublic void incrementGauge(Statistic op, long count)
op - operationcount - increment valueClassCastException - if the metric is of the wrong typepublic void decrementGauge(Statistic op, long count)
op - operationcount - increment valueClassCastException - if the metric is of the wrong typepublic S3AInstrumentation.S3GuardInstrumentation getS3GuardInstrumentation()
public void getMetrics(org.apache.hadoop.metrics2.MetricsCollector collector,
boolean all)
getMetrics in interface org.apache.hadoop.metrics2.MetricsSourcepublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2008–2021 Apache Software Foundation. All rights reserved.