public class MutableIOMetrics extends IOMetrics
IOMetrics
class that allows adding up IO-related metrics.
For finished jobs these metrics are stored in the ExecutionGraph
as another IOMetrics
.
For running jobs these metrics are retrieved using the MetricFetcher
.
This class provides a common interface to handle both cases, reducing complexity in various handlers (like
the JobVertexDetailsHandler
).
numBytesInLocal, numBytesInLocalPerSecond, numBytesInRemote, numBytesInRemotePerSecond, numBytesOut, numBytesOutPerSecond, numRecordsIn, numRecordsInPerSecond, numRecordsOut, numRecordsOutPerSecond
Constructor and Description |
---|
MutableIOMetrics() |
Modifier and Type | Method and Description |
---|---|
void |
addIOMetrics(AccessExecution attempt,
MetricFetcher fetcher,
String jobID,
String taskID)
Adds the IO metrics for the given attempt to this object.
|
boolean |
isNumBytesInLocalComplete() |
boolean |
isNumBytesInRemoteComplete() |
boolean |
isNumBytesOutComplete() |
boolean |
isNumRecordsInComplete() |
boolean |
isNumRecordsOutComplete() |
void |
writeIOMetricsAsJson(org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonGenerator gen)
Writes the IO metrics contained in this object to the given
JsonGenerator . |
getNumBytesInLocal, getNumBytesInLocalPerSecond, getNumBytesInRemote, getNumBytesInRemotePerSecond, getNumBytesInTotal, getNumBytesOut, getNumBytesOutPerSecond, getNumRecordsIn, getNumRecordsInPerSecond, getNumRecordsOut, getNumRecordsOutPerSecond
public boolean isNumBytesInLocalComplete()
public boolean isNumBytesInRemoteComplete()
public boolean isNumBytesOutComplete()
public boolean isNumRecordsInComplete()
public boolean isNumRecordsOutComplete()
public void addIOMetrics(AccessExecution attempt, @Nullable MetricFetcher fetcher, String jobID, String taskID)
AccessExecution
is in
a terminal state the contained IOMetrics
object is added. Otherwise the given MetricFetcher
is
used to retrieve the required metrics.attempt
- Attempt whose IO metrics should be addedfetcher
- MetricFetcher to retrieve metrics for running jobsjobID
- JobID to which the attempt belongstaskID
- TaskID to which the attempt belongspublic void writeIOMetricsAsJson(org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonGenerator gen) throws IOException
JsonGenerator
.
The JSON structure written is as follows: "metrics": { "read-bytes": 1, "read-bytes-complete": true, "write-bytes": 2, "write-bytes-complete": true, "read-records": 3, "read-records-complete": true, "write-records": 4, "write-records-complete": true }
gen
- JsonGenerator to which the metrics should be writtenIOException
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.