Package hudson.model
Class LoadStatistics
java.lang.Object
hudson.model.LoadStatistics
- Direct Known Subclasses:
OverallLoadStatistics,UnlabeledLoadStatistics
Utilization statistics for a node or a set of nodes.
Implementation Note
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.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classHolds a snapshot of the current statistics.static classPeriodically update the load statistics average. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal MultiStageTimeSeriesNumber of executors not executing and available to take work and how it changes over time.final MultiStageTimeSeriesNumber of busy executors and how it changes over time.static intLoad statistics clock cycle in milliseconds.final MultiStageTimeSeriesNumber of executors in the process of coming on-line and how it changes over time.static final floatWith 0.90 decay ratio for every 10sec, half reduction is about 1 min.final MultiStageTimeSeriesNumber of executors defined for Jenkins and how it changes over time.final MultiStageTimeSeriesNumber of executors not executing and how it changes over time.final MultiStageTimeSeriesNumber of executors on-line and how it changes over time.final MultiStageTimeSeriesNumber ofQueue.BuildableItems that can run on any node in this node set but blocked.final MultiStageTimeSeriesDeprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLoadStatistics(int initialOnlineExecutors, int initialBusyExecutors) -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated.intDeprecated.Computes a self-consistent snapshot of the load statistics.protected LoadStatistics.LoadStatisticsSnapshotComputes the self-consistent snapshot with the specified queue items.intDeprecated.protected voidconfigureRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer renderer) org.jfree.chart.JFreeChartcreateChart(org.jfree.data.category.CategoryDataset ds) Creates a trend chart.createTrendChart(MultiStageTimeSeries.TimeScale timeScale) CreatesCategoryDatasetwhich then becomes the basis of the load statistics graph.Generates the load statistics graph.getApi()floatDeprecated.useidleExecutorsdirectly.getNodes()Returns theNodeinstances that this statistic counts.protected abstract booleanmatches(Queue.Item item, SubTask subTask) protected voidUpdates all the series from the current snapshot.protected voidDeprecated.
-
Field Details
-
definedExecutors
Number of executors defined for Jenkins and how it changes over time.- Since:
- 1.607
-
onlineExecutors
Number of executors on-line and how it changes over time. ReplacestotalExecutors- Since:
- 1.607
-
connectingExecutors
Number of executors in the process of coming on-line and how it changes over time.- Since:
- 1.607
-
busyExecutors
Number of busy executors and how it changes over time. -
idleExecutors
Number of executors not executing and how it changes over time. Note the these executors may not be able to take work, seeavailableExecutors.- Since:
- 1.607
-
availableExecutors
Number of executors not executing and available to take work and how it changes over time.- Since:
- 1.607
-
totalExecutors
Deprecated.useonlineExecutors. NotetotalExecutors==onlineExecutorsfor backward compatibility support.Number of total executors and how it changes over time. -
queueLength
Number ofQueue.BuildableItems that can run on any node in this node set but blocked. -
DECAY
public static final float DECAYWith 0.90 decay ratio for every 10sec, half reduction is about 1 min. Put differently, the half reduction time isCLOCK*log(0.5)/log(DECAY) -
CLOCK
public static int CLOCKLoad statistics clock cycle in milliseconds. Specify a small value for quickly debugging this feature and node provisioning through cloud.
-
-
Constructor Details
-
LoadStatistics
protected LoadStatistics(int initialOnlineExecutors, int initialBusyExecutors)
-
-
Method Details
-
getLatestIdleExecutors
Deprecated.useidleExecutorsdirectly. -
computeIdleExecutors
Deprecated.Computes the # of idle executors right now and obtains the snapshot value. -
computeTotalExecutors
Deprecated.Computes the # of total executors right now and obtains the snapshot value. -
computeQueueLength
Deprecated.Computes the # of queue length right now and obtains the snapshot value. -
createChart
public org.jfree.chart.JFreeChart createChart(org.jfree.data.category.CategoryDataset ds) Creates a trend chart. -
configureRenderer
protected void configureRenderer(org.jfree.chart.renderer.category.LineAndShapeRenderer renderer) -
createTrendChart
CreatesCategoryDatasetwhich then becomes the basis of the load statistics graph. -
doGraph
Generates the load statistics graph.- Throws:
IOException
-
getApi
-
updateExecutorCounts
Deprecated. -
updateCounts
Updates all the series from the current snapshot.- Parameters:
current- the current snapshot.- Since:
- 1.607
-
getNodes
Returns theNodeinstances that this statistic counts.- Returns:
- the
Node - Since:
- 1.607
-
matches
- Parameters:
item- theQueue.Itemthat thebelongs tosubTask- theSubTask- Returns:
trueIFF the specifiedSubTaskfrom theQueueshould be counted.- Since:
- 1.607
-
computeSnapshot
Computes a self-consistent snapshot of the load statistics. Note: The original method of computing load statistics would compute the total and idle counts independently which could lead to counting errors while jobs started in between the different state counting operations. By returning aLoadStatistics.LoadStatisticsSnapshotwe get a single consistent view of the counts which was valid for at least one point in time during the execution of this method.- Returns:
- a self-consistent snapshot of the load statistics.
- Since:
- 1.607
-
computeSnapshot
protected LoadStatistics.LoadStatisticsSnapshot computeSnapshot(Iterable<Queue.BuildableItem> queue) Computes the self-consistent snapshot with the specified queue items.- Parameters:
queue- the queue items.- Returns:
- a self-consistent snapshot of the load statistics.
- Since:
- 1.607
-
onlineExecutors.