Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
d9e4e36f
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d9e4e36f
编写于
3月 28, 2015
作者:
S
Stephen Connolly
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix build
上级
fc79e104
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
13 addition
and
15 deletion
+13
-15
core/src/main/java/hudson/model/Label.java
core/src/main/java/hudson/model/Label.java
+2
-2
core/src/main/java/hudson/model/LoadStatistics.java
core/src/main/java/hudson/model/LoadStatistics.java
+5
-4
core/src/main/java/hudson/model/OverallLoadStatistics.java
core/src/main/java/hudson/model/OverallLoadStatistics.java
+1
-1
core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java
.../src/main/java/jenkins/model/UnlabeledLoadStatistics.java
+3
-6
core/src/test/java/hudson/model/LoadStatisticsTest.java
core/src/test/java/hudson/model/LoadStatisticsTest.java
+2
-2
未找到文件。
core/src/main/java/hudson/model/Label.java
浏览文件 @
d9e4e36f
...
...
@@ -115,8 +115,8 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
}
@Override
protected
boolean
matches
(
SubTask
item
)
{
final
Label
l
=
item
.
getAssignedLabel
(
);
protected
boolean
matches
(
Queue
.
Item
item
,
SubTask
subTask
)
{
final
Label
l
=
item
.
getAssignedLabel
For
(
subTask
);
return
l
!=
null
&&
Label
.
this
.
matches
(
l
.
name
);
}
};
...
...
core/src/main/java/hudson/model/LoadStatistics.java
浏览文件 @
d9e4e36f
...
...
@@ -24,7 +24,6 @@
package
hudson.model
;
import
hudson.Extension
;
import
hudson.Util
;
import
hudson.model.MultiStageTimeSeries.TimeScale
;
import
hudson.model.MultiStageTimeSeries.TrendChart
;
import
hudson.model.queue.SubTask
;
...
...
@@ -310,11 +309,12 @@ public abstract class LoadStatistics {
/**
* Returns {@code true} is the specified {@link SubTask} from the {@link Queue} should be counted.
* @param item the {@link SubTask}
* @param item the {@link Queue.Item} that the {@link SubTask belongs to}
* @param subTask the {@link SubTask}
* @return {@code true} IFF the specified {@link SubTask} from the {@link Queue} should be counted.
* @since 1.607
*/
protected
abstract
boolean
matches
(
SubTask
item
);
protected
abstract
boolean
matches
(
Queue
.
Item
item
,
SubTask
subTask
);
/**
* Computes a self-consistent snapshot of the load statistics.
...
...
@@ -355,8 +355,9 @@ public abstract class LoadStatistics {
int
q
=
0
;
if
(
queue
!=
null
)
{
for
(
Queue
.
BuildableItem
item
:
queue
)
{
for
(
SubTask
st
:
item
.
task
.
getSubTasks
())
{
if
(
matches
(
st
))
if
(
matches
(
item
,
st
))
q
++;
}
}
...
...
core/src/main/java/hudson/model/OverallLoadStatistics.java
浏览文件 @
d9e4e36f
...
...
@@ -75,7 +75,7 @@ public class OverallLoadStatistics extends LoadStatistics {
}
@Override
protected
boolean
matches
(
SubTask
item
)
{
protected
boolean
matches
(
Queue
.
Item
item
,
SubTask
subTask
)
{
return
true
;
}
...
...
core/src/main/java/jenkins/model/UnlabeledLoadStatistics.java
浏览文件 @
d9e4e36f
...
...
@@ -28,15 +28,12 @@ import hudson.model.LoadStatistics;
import
hudson.model.Node
;
import
hudson.model.Node.Mode
;
import
hudson.model.OverallLoadStatistics
;
import
hudson.model.Queue
;
import
hudson.model.Queue.Task
;
import
hudson.model.queue.SubTask
;
import
hudson.util.Iterators
;
import
java.util.Iterator
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
java.util.NoSuchElementException
;
import
java.util.Set
;
/**
* {@link LoadStatistics} that track the "free roam" jobs (whose {@link Task#getAssignedLabel()} is null)
...
...
@@ -90,8 +87,8 @@ public class UnlabeledLoadStatistics extends LoadStatistics {
}
@Override
protected
boolean
matches
(
SubTask
item
)
{
return
true
;
protected
boolean
matches
(
Queue
.
Item
item
,
SubTask
subTask
)
{
return
item
.
getAssignedLabelFor
(
subTask
)
==
null
;
}
private
static
class
UnlabeledNodesIterable
implements
Iterable
<
Node
>
{
...
...
core/src/test/java/hudson/model/LoadStatisticsTest.java
浏览文件 @
d9e4e36f
...
...
@@ -64,7 +64,7 @@ public class LoadStatisticsTest {
}
@Override
protected
boolean
matches
(
SubTask
item
)
{
protected
boolean
matches
(
Queue
.
Item
item
,
SubTask
subTask
)
{
throw
new
UnsupportedOperationException
();
}
};
...
...
@@ -129,7 +129,7 @@ public class LoadStatisticsTest {
}
@Override
protected
boolean
matches
(
SubTask
item
)
{
protected
boolean
matches
(
Queue
.
Item
item
,
SubTask
subTask
)
{
return
false
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录