@ExportedBean public abstract class LoadStatistics extends Object
Instances of this class is not capable of updating the statistics itself
— instead, it's done by the LoadStatistics.LoadStatisticsUpdater timer.
This is more efficient (as it allows us a single pass to update all stats),
but it's not clear to me if the loss of autonomy is worth it.
Label.loadStatistics,
Jenkins.overallLoad,
Jenkins.unlabeledLoad| Modifier and Type | Class and Description |
|---|---|
static class |
LoadStatistics.LoadStatisticsSnapshot
Holds a snapshot of the current statistics.
|
static class |
LoadStatistics.LoadStatisticsUpdater
Periodically update the load statistics average.
|
| Modifier and Type | Field and Description |
|---|---|
MultiStageTimeSeries |
availableExecutors
Number of executors not executing and available to take work and how it changes over time.
|
MultiStageTimeSeries |
busyExecutors
Number of busy executors and how it changes over time.
|
static int |
CLOCK
Load statistics clock cycle in milliseconds.
|
MultiStageTimeSeries |
connectingExecutors
Number of executors in the process of coming on-line and how it changes over time.
|
static float |
DECAY
With 0.90 decay ratio for every 10sec, half reduction is about 1 min.
|
MultiStageTimeSeries |
definedExecutors
Number of executors defined for Jenkins and how it changes over time.
|
MultiStageTimeSeries |
idleExecutors
Number of executors not executing and how it changes over time.
|
MultiStageTimeSeries |
onlineExecutors
Number of executors on-line and how it changes over time.
|
MultiStageTimeSeries |
queueLength
Number of
Queue.BuildableItems that can run on any node in this node set but blocked. |
MultiStageTimeSeries |
totalExecutors
Deprecated.
use
onlineExecutors. Note totalExecutors==onlineExecutors for backward
compatibility support. |
| Modifier | Constructor and Description |
|---|---|
protected |
LoadStatistics(int initialOnlineExecutors,
int initialBusyExecutors) |
| Modifier and Type | Method and Description |
|---|---|
abstract int |
computeIdleExecutors()
Deprecated.
|
abstract int |
computeQueueLength()
Deprecated.
|
LoadStatistics.LoadStatisticsSnapshot |
computeSnapshot()
Computes a self-consistent snapshot of the load statistics.
|
protected LoadStatistics.LoadStatisticsSnapshot |
computeSnapshot(Iterable<Queue.BuildableItem> queue)
Computes the self-consistent snapshot with the specified queue items.
|
abstract int |
computeTotalExecutors()
Deprecated.
|
protected void |
configureRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer renderer) |
org.jfree.chart.JFreeChart |
createChart(org.jfree.data.category.CategoryDataset ds)
Creates a trend chart.
|
MultiStageTimeSeries.TrendChart |
createTrendChart(MultiStageTimeSeries.TimeScale timeScale)
Creates
CategoryDataset which then becomes the basis
of the load statistics graph. |
MultiStageTimeSeries.TrendChart |
doGraph(String type)
Generates the load statistics graph.
|
Api |
getApi() |
float |
getLatestIdleExecutors(MultiStageTimeSeries.TimeScale timeScale)
Deprecated.
use
idleExecutors directly. |
protected abstract Iterable<Node> |
getNodes()
Returns the
Node instances that this statistic counts. |
protected abstract boolean |
matches(Queue.Item item,
SubTask subTask)
|
protected void |
updateCounts(LoadStatistics.LoadStatisticsSnapshot current)
Updates all the series from the current snapshot.
|
protected void |
updateExecutorCounts()
Deprecated.
|
@Exported public final MultiStageTimeSeries definedExecutors
@Exported public final MultiStageTimeSeries onlineExecutors
totalExecutors@Exported public final MultiStageTimeSeries connectingExecutors
@Exported public final MultiStageTimeSeries busyExecutors
@Exported public final MultiStageTimeSeries idleExecutors
availableExecutors.@Exported public final MultiStageTimeSeries availableExecutors
@Exported @Deprecated public final MultiStageTimeSeries totalExecutors
onlineExecutors. Note totalExecutors==onlineExecutors for backward
compatibility support.@Exported public final MultiStageTimeSeries queueLength
Queue.BuildableItems that can run on any node in this node set but blocked.public static final float DECAY
CLOCK*log(0.5)/log(DECAY)public static int CLOCK
protected LoadStatistics(int initialOnlineExecutors,
int initialBusyExecutors)
@Deprecated public float getLatestIdleExecutors(MultiStageTimeSeries.TimeScale timeScale)
idleExecutors directly.@Deprecated public abstract int computeIdleExecutors()
computeSnapshot() and then LoadStatistics.LoadStatisticsSnapshot.getIdleExecutors()@Deprecated public abstract int computeTotalExecutors()
computeSnapshot() and then LoadStatistics.LoadStatisticsSnapshot.getOnlineExecutors()@Deprecated public abstract int computeQueueLength()
computeSnapshot() and then LoadStatistics.LoadStatisticsSnapshot.getQueueLength()public org.jfree.chart.JFreeChart createChart(org.jfree.data.category.CategoryDataset ds)
protected void configureRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer renderer)
public MultiStageTimeSeries.TrendChart createTrendChart(MultiStageTimeSeries.TimeScale timeScale)
CategoryDataset which then becomes the basis
of the load statistics graph.public MultiStageTimeSeries.TrendChart doGraph(@QueryParameter String type) throws IOException
IOExceptionpublic Api getApi()
@Deprecated protected void updateExecutorCounts()
updateCounts(LoadStatisticsSnapshot)protected void updateCounts(LoadStatistics.LoadStatisticsSnapshot current)
current - the current snapshot.protected abstract Iterable<Node> getNodes()
Node instances that this statistic counts.Nodeprotected abstract boolean matches(Queue.Item item, SubTask subTask)
item - the Queue.Item that the belongs tosubTask - the SubTasktrue IFF the specified SubTask from the Queue should be counted.public LoadStatistics.LoadStatisticsSnapshot computeSnapshot()
LoadStatistics.LoadStatisticsSnapshot we get a single consistent view of the counts which was valid
for at least one point in time during the execution of this method.protected LoadStatistics.LoadStatisticsSnapshot computeSnapshot(Iterable<Queue.BuildableItem> queue)
queue - the queue items.Copyright © 2019. All rights reserved.