@Metrics(about="Metrics for S3a",
context="S3AFileSystem")
@InterfaceAudience.Private
@InterfaceStability.Evolving
public class S3AInstrumentation
extends Object
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.InputStreamStatistics
Statistics updated by an input stream during its actual operation.
|
class |
S3AInstrumentation.OutputStreamStatistics
Statistics updated by an output stream during its actual operation.
|
| Constructor and Description |
|---|
S3AInstrumentation(URI name) |
| Modifier and Type | Method and Description |
|---|---|
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 file.s
|
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.
|
org.apache.hadoop.metrics2.lib.MetricsRegistry |
getRegistry()
Get the metrics registry.
|
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.
|
protected org.apache.hadoop.metrics2.lib.MutableCounterLong |
streamCounter(Statistic op)
Create a counter in the stream map: these are unregistered in the public
metrics.
|
protected org.apache.hadoop.metrics2.lib.MutableCounterLong |
streamCounter(String name,
String desc)
Create a counter in the stream map: these are unregistered in the public
metrics.
|
public static final String CONTEXT
public S3AInstrumentation(URI name)
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 streamCounter(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.MutableCounterLong streamCounter(Statistic op)
op - statistic to countprotected final org.apache.hadoop.metrics2.lib.MutableGaugeLong gauge(String name, String desc)
name - name gauge namedesc - descriptionpublic 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.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 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 typeCopyright © 2017 Apache Software Foundation. All Rights Reserved.