public final class QueueItemMetricsEvent extends Object
Modifier and Type | Class and Description |
---|---|
static class |
QueueItemMetricsEvent.State
The state of the item when this metrics event was created.
|
Constructor and Description |
---|
QueueItemMetricsEvent(Queue.Item item,
Label assignedLabel,
QueueItemMetricsEvent.State state,
Run<?,?> run,
Queue.Executable executable,
List<Set<LabelAtom>> consumedLabelAtoms,
Long queuingTotalMillis,
Long queuingWaitingMillis,
Long queuingBlockedMillis,
Long queuingBuildableMillis,
Long executingMillis,
Integer executorCount) |
Modifier and Type | Method and Description |
---|---|
static int |
compareEventSequence(QueueItemMetricsEvent x,
QueueItemMetricsEvent y)
Sorts
QueueItemMetricsEvent s by getEventTick() . |
static int |
compareQueueSequence(QueueItemMetricsEvent x,
QueueItemMetricsEvent y)
Sorts
QueueItemMetricsEvent s by the order Queue.Item#getId() . |
boolean |
equals(Object o) |
Label |
getAssignedLabel()
Returns the
Queue.Item#getAssignedLabel() at the time of the event or null if the item was not
assigned to a label. |
Optional<List<Set<LabelAtom>>> |
getConsumedLabelAtoms()
Returns the
Node.getAssignedLabels() of all the executor slots occupied by this task,
if the task has been started. |
long |
getEventMillis()
Returns the current
System.currentTimeMillis() comparable time when this event occurred. |
long |
getEventTick()
Returns the
System.nanoTime() comparable tick when this event occurred. |
Optional<Queue.Executable> |
getExecutable()
Returns the
Queue.Executable created from the Queue.Item belongs. |
Optional<Long> |
getExecutingMillis()
If the
Queue.Executable has finished executing, returns the number of milliseconds the item spent
executing. |
Optional<Integer> |
getExecutorCount()
If the
Queue.Executable has started executing, returns the number of executors being used. |
long |
getId()
Returns the
Queue.Item#getId() . |
Queue.Item |
getItem()
Returns the
Queue.Item . |
Optional<Long> |
getQueuingBlockedMillis()
If the
Queue.Item has left the queue, returns the number of milliseconds the item was on the queue in
the blocked state. |
Optional<Long> |
getQueuingBuildableMillis()
If the
Queue.Item has left the queue, returns the number of milliseconds the item was on the queue in
the buildable state. |
Optional<Long> |
getQueuingTotalMillis()
If the
Queue.Item has left the queue, returns the number of milliseconds the item was on the queue. |
Optional<Long> |
getQueuingWaitingMillis()
If the
Queue.Item has left the queue, returns the number of milliseconds the item was on the queue in
the waiting state. |
Optional<Run<?,?>> |
getRun()
Returns the
Run to which the Queue.Item belongs. |
QueueItemMetricsEvent.State |
getState()
Returns the state of the
Queue.Item when the event occurred. |
int |
hashCode() |
String |
toString() |
public QueueItemMetricsEvent(@NonNull Queue.Item item, @CheckForNull Label assignedLabel, @NonNull QueueItemMetricsEvent.State state, @CheckForNull Run<?,?> run, @CheckForNull Queue.Executable executable, @CheckForNull List<Set<LabelAtom>> consumedLabelAtoms, @CheckForNull Long queuingTotalMillis, @CheckForNull Long queuingWaitingMillis, @CheckForNull Long queuingBlockedMillis, @CheckForNull Long queuingBuildableMillis, @CheckForNull Long executingMillis, @CheckForNull Integer executorCount)
public static int compareEventSequence(QueueItemMetricsEvent x, QueueItemMetricsEvent y)
QueueItemMetricsEvent
s by getEventTick()
.x
- the first QueueItemMetricsEvent
to comparey
- the second QueueItemMetricsEvent
to compare0
if both events happend at the same time;
a value less than 0
if x
happened before y
; and
a value greater than 0
if y
happened before x
public static int compareQueueSequence(QueueItemMetricsEvent x, QueueItemMetricsEvent y)
QueueItemMetricsEvent
s by the order Queue.Item#getId()
.x
- the first QueueItemMetricsEvent
to comparey
- the second QueueItemMetricsEvent
to compare0
if both events happend at the same time;
a value less than 0
if x
was enqueued before y
; and
a value greater than 0
if y
was enqueued before x
public long getEventTick()
System.nanoTime()
comparable tick when this event occurred.System.nanoTime()
comparable tick when this event occurred.public long getEventMillis()
System.currentTimeMillis()
comparable time when this event occurred.
IMPORTANT if the system clock has changed between when the event occurred and now,
this function will return the time comparable to now, not the time comparable to the value of
System.currentTimeMillis()
at the time of the event. Compare getEventTick()
with
System.nanoTime()
if you need to measure the time since the event.System.currentTimeMillis()
comparable time when this event occurred.public long getId()
Queue.Item#getId()
.Queue.Item#getId()
.public QueueItemMetricsEvent.State getState()
Queue.Item
when the event occurred.Queue.Item
when the event occurred.@NonNull public Queue.Item getItem()
Queue.Item
.Queue.Item
.@CheckForNull public Label getAssignedLabel()
Queue.Item#getAssignedLabel()
at the time of the event or null
if the item was not
assigned to a label.Queue.Item#getAssignedLabel()
at the time of the event or null
if the item was not
assigned to a label.public Optional<Run<?,?>> getRun()
Run
to which the Queue.Item
belongs.Run
to which the Queue.Item
belongs, if present.@NonNull public Optional<Queue.Executable> getExecutable()
Queue.Executable
created from the Queue.Item
belongs.Queue.Executable
created from the Queue.Item
belongs, if present.@NonNull public Optional<List<Set<LabelAtom>>> getConsumedLabelAtoms()
Node.getAssignedLabels()
of all the executor slots occupied by this task,
if the task has been started.Node.getAssignedLabels()
of all the executor slots occupied by this task,
if the task has been started, otherwise Optional.empty()
.@NonNull public Optional<Long> getQueuingTotalMillis()
Queue.Item
has left the queue, returns the number of milliseconds the item was on the queue.Queue.Item
has left the queue, returns the number of milliseconds the item was on the
queue, otherwise Optional.empty()
.@NonNull public Optional<Long> getQueuingWaitingMillis()
Queue.Item
has left the queue, returns the number of milliseconds the item was on the queue in
the waiting state.Queue.Item
has left the queue, returns the number of milliseconds the item was on the
queue in the waiting state, otherwise Optional.empty()
.@NonNull public Optional<Long> getQueuingBlockedMillis()
Queue.Item
has left the queue, returns the number of milliseconds the item was on the queue in
the blocked state.Queue.Item
has left the queue, returns the number of milliseconds the item was on the
queue in the blocked state, otherwise Optional.empty()
.@NonNull public Optional<Long> getQueuingBuildableMillis()
Queue.Item
has left the queue, returns the number of milliseconds the item was on the queue in
the buildable state.Queue.Item
has left the queue, returns the number of milliseconds the item was on the
queue in the buildable state, otherwise Optional.empty()
.@NonNull public Optional<Long> getExecutingMillis()
Queue.Executable
has finished executing, returns the number of milliseconds the item spent
executing.Queue.Executable
has finished executing, returns the number of milliseconds the item
spent executing, otherwise Optional.empty()
.@NonNull public Optional<Integer> getExecutorCount()
Queue.Executable
has started executing, returns the number of executors being used.Queue.Executable
has started executing, returns the number of executors being used,
otherwise Optional.empty()
.Copyright © 2016–2019. All rights reserved.