~ubuntu-branches/ubuntu/saucy/jenkins/saucy

« back to all changes in this revision

Viewing changes to core/src/main/java/hudson/model/OverallLoadStatistics.java

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-01-10 09:50:50 UTC
  • mfrom: (5.1.10 experimental)
  • Revision ID: package-import@ubuntu.com-20130110095050-kj8xuw20gcfh62k3
Tags: 1.480.2+dfsg-1~exp1
* New upstream release (Closes: #696816, #697617):
  - d/control: Added new BD on libjbcrypt-java.
  - d/control: Versioned BD jenkins-winstone >= 0.9.10-jenkins-40.
  - d/control: Versioned BD jenkins-trilead-ssh2 >= 214-jenkins-1.
  - Fixes the following security vulnerabilities:
    CVE-2012-6072, CVE-2012-6073, CVE-2012-6072, CVE-2013-0158.
* Tidied lintian warnings.
* Bumped Standards-Version: 3.9.4, no changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
import hudson.model.MultiStageTimeSeries.TimeScale;
27
27
import hudson.model.MultiStageTimeSeries.TrendChart;
28
 
import hudson.util.ColorPalette;
29
28
import jenkins.model.Jenkins;
 
29
import org.kohsuke.accmod.Restricted;
 
30
import org.kohsuke.accmod.restrictions.NoExternalUse;
30
31
import org.kohsuke.stapler.export.Exported;
31
32
 
32
33
/**
33
 
 * {@link LoadStatistics} for the entire system (the master and all the slaves combined.)
34
 
 *
35
 
 * <p>
36
 
 * {@link #computeQueueLength()} and {@link #queueLength} counts those tasks
37
 
 * that are unassigned to any node, whereas {@link #totalQueueLength}
38
 
 * tracks the queue length including tasks that are assigned to a specific node.
 
34
 * {@link LoadStatistics} for the entire system (the master and all the slaves combined),
 
35
 * and all the jobs that are running on it.
39
36
 *
40
37
 * @author Kohsuke Kawaguchi
41
38
 * @see Jenkins#overallLoad
 
39
 * @see UnlabeldLoadStatistics
42
40
 */
43
41
public class OverallLoadStatistics extends LoadStatistics {
44
42
    /**
45
43
     * Number of total {@link Queue.BuildableItem}s that represents blocked builds.
 
44
     *
 
45
     * @deprecated as of 1.467
 
46
     *      Use {@link #queueLength}. Left as an alias here for backward compatibility.
46
47
     */
47
48
    @Exported
48
 
    public final MultiStageTimeSeries totalQueueLength = new MultiStageTimeSeries(
49
 
            Messages._LoadStatistics_Legends_QueueLength(), ColorPalette.GREY, 0,DECAY);
 
49
    @Restricted(NoExternalUse.class)
 
50
    public final MultiStageTimeSeries totalQueueLength = queueLength;
50
51
 
51
52
    public OverallLoadStatistics() {
52
53
        super(0,0);
64
65
 
65
66
    @Override
66
67
    public int computeQueueLength() {
67
 
        return Jenkins.getInstance().getQueue().countBuildableItemsFor(null);
 
68
        return Jenkins.getInstance().getQueue().countBuildableItems();
68
69
    }
69
70
 
70
71
    /**
72
73
     * not {@link #queueLength}, which just shows jobs that are to be run on the master. 
73
74
     */
74
75
    protected TrendChart createOverallTrendChart(TimeScale timeScale) {
75
 
        return MultiStageTimeSeries.createTrendChart(timeScale,busyExecutors,totalExecutors,totalQueueLength);
 
76
        return MultiStageTimeSeries.createTrendChart(timeScale,busyExecutors,totalExecutors,queueLength);
76
77
    }
77
78
}