public class TimestampedObserver extends ObservableInputStream.Observer
For example:
final TimestampedObserver timetampedObserver = new TimestampedObserver(); try (ObservableInputStream inputStream = new ObservableInputStream(...), timetampedObserver)) { ... } System.out.printf("IO duration: %s%n", timetampedObserver.getOpenToCloseDuration());
Constructor and Description |
---|
TimestampedObserver() |
Modifier and Type | Method and Description |
---|---|
void |
closed()
Called to indicate that the
ObservableInputStream has been closed. |
java.time.Instant |
getCloseInstant()
Gets the instant for when this instance was closed.
|
java.time.Instant |
getOpenInstant()
Gets the instant for when this instance was created.
|
java.time.Duration |
getOpenToCloseDuration()
Gets the Duration between creation and close.
|
java.time.Duration |
getOpenToNowDuration()
Gets the Duration between creation and now.
|
boolean |
isClosed()
Tests whether
closed() has been called. |
java.lang.String |
toString() |
data, data, error, finished
public void closed() throws java.io.IOException
ObservableInputStream.Observer
ObservableInputStream
has been closed.closed
in class ObservableInputStream.Observer
java.io.IOException
- if an I/O error occurs.public java.time.Instant getCloseInstant()
public java.time.Instant getOpenInstant()
public java.time.Duration getOpenToCloseDuration()
public java.time.Duration getOpenToNowDuration()
public boolean isClosed()
closed()
has been called.closed()
has been called.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2010 - 2023 Adobe. All Rights Reserved