提交 2999b2c4 编写于 作者: M mindless

[FIXED HUDSON-4286] Changed health level boundaries from 0-19, ... 80+

to 0-20, 21-40, ... 81+ and removed hack in Job.java lowering build health
scores by one so 4/5 wouldn't be "sunny".  Now 80 is in the 2nd bracket so
hack not needed.
Left image filenames unchanged for compatibility, in case anyone uses
these images for other things.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21152 71c3de6d-444a-0410-be80-ed276b4c234a
上级 3236c56d
......@@ -44,11 +44,12 @@ import java.util.Locale;
@ExportedBean(defaultVisibility = 2)
// this is always exported as a part of Job and never on its own, so start with 2.
public class HealthReport implements Serializable, Comparable<HealthReport> {
// These are now 0-20, 21-40, 41-60, 61-80, 81+ but filenames unchanged for compatibility
private static final String HEALTH_OVER_80 = "health-80plus.gif";
private static final String HEALTH_60_TO_79 = "health-60to79.gif";
private static final String HEALTH_40_TO_59 = "health-40to59.gif";
private static final String HEALTH_20_TO_39 = "health-20to39.gif";
private static final String HEALTH_0_TO_19 = "health-00to19.gif";
private static final String HEALTH_61_TO_80 = "health-60to79.gif";
private static final String HEALTH_41_TO_60 = "health-40to59.gif";
private static final String HEALTH_21_TO_40 = "health-20to39.gif";
private static final String HEALTH_0_TO_20 = "health-00to19.gif";
private static final String HEALTH_UNKNOWN = "empty.gif";
/**
......@@ -116,14 +117,14 @@ public class HealthReport implements Serializable, Comparable<HealthReport> {
public HealthReport(int score, String iconUrl, Localizable description) {
this.score = score;
if (iconUrl == null) {
if (score < 20) {
this.iconUrl = HEALTH_0_TO_19;
} else if (score < 40) {
this.iconUrl = HEALTH_20_TO_39;
} else if (score < 60) {
this.iconUrl = HEALTH_40_TO_59;
} else if (score < 80) {
this.iconUrl = HEALTH_60_TO_79;
if (score <= 20) {
this.iconUrl = HEALTH_0_TO_20;
} else if (score <= 40) {
this.iconUrl = HEALTH_21_TO_40;
} else if (score <= 60) {
this.iconUrl = HEALTH_41_TO_60;
} else if (score <= 80) {
this.iconUrl = HEALTH_61_TO_80;
} else {
this.iconUrl = HEALTH_OVER_80;
}
......
......@@ -867,11 +867,6 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
}
if (totalCount > 0) {
int score = (int) ((100.0 * (totalCount - failCount)) / totalCount);
if (score < 100 && score > 0) {
// HACK
// force e.g. 4/5 to be in the 60-79 range
score--;
}
Localizable description;
if (failCount == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册