Skip to content

Commit

Permalink
Remove ssj dependency and spline trend lines when over 200 tests are …
Browse files Browse the repository at this point in the history
…shown
  • Loading branch information
dwnusbaum authored and timja committed Aug 21, 2024
1 parent 6690002 commit cdc1d71
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 70 deletions.
12 changes: 0 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,6 @@
</dependencyManagement>

<dependencies>
<dependency>
<groupId>ca.umontreal.iro.simul</groupId>
<artifactId>ssj</artifactId>
<version>3.3.2</version>
<!-- Dependencies are unused, provided by Jenkins core, have unusual licenses, unclear artifact ownership, and/or are obsolete. We only use SmoothingCubicSpline, which does not require dependencies. -->
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.pivovarit</groupId>
<artifactId>parallel-collectors</artifactId>
Expand Down
58 changes: 0 additions & 58 deletions src/main/java/hudson/tasks/junit/History.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.bind.JavaScriptMethod;
import umontreal.ssj.functionfit.SmoothingCubicSpline;

/**
* History of {@link hudson.tasks.test.TestObject} over time.
Expand Down Expand Up @@ -208,16 +207,6 @@ private ObjectNode computeDurationTrendJson(List<HistoryTestResultSummary> histo
0,
0,
roundMul); // "--blue"
createSplineTrend(
series,
history,
lrX,
lrY,
"Smooth of " + durationStr,
"rgba(120, 50, 255, 0.5)",
0,
0,
roundMul); // "--indigo"
}
root.set("series", series);
root.set("domainAxisLabels", domainAxisLabels);
Expand Down Expand Up @@ -279,51 +268,6 @@ private void createLinearTrend(
}
}

private void createSplineTrend(
ArrayNode series,
List<HistoryTestResultSummary> history,
double[] lrX,
double[] lrY,
String title,
String color,
int xAxisIndex,
int yAxisIndex,
double roundMul) {
if (history.size() < 200) {
return;
}
double rho = Math.min(1.0, 1.0 / Math.max(1, (history.size() / 2)));
if (rho > 0.75) {
return; // Too close to linear
}
SmoothingCubicSpline scs = new SmoothingCubicSpline(lrX, lrY, 0.001);
ObjectNode lrSeries = MAPPER.createObjectNode();
series.add(lrSeries);
lrSeries.put("name", title);
lrSeries.put("preferScreenOrient", "landscape");
lrSeries.put("type", "line");
lrSeries.put("symbol", "circle");
lrSeries.put("symbolSize", 0);
lrSeries.put("xAxisIndex", xAxisIndex);
lrSeries.put("yAxisIndex", yAxisIndex);
ArrayNode lrData = MAPPER.createArrayNode();
lrSeries.set("data", lrData);
ObjectNode lrStyle = MAPPER.createObjectNode();
lrSeries.set("itemStyle", lrStyle);
lrStyle.put("color", color);
ObjectNode lrAreaStyle = MAPPER.createObjectNode();
lrSeries.set("areaStyle", lrAreaStyle);
lrAreaStyle.put("color", "rgba(0, 0, 0, 0)");

if (roundMul < 10.0) {
roundMul = 10.0;
}
for (int index = 0; index < history.size(); ++index) {
// Use float to reduce JSON size.
lrData.add((float) (Math.round(scs.evaluate(index) * roundMul) / roundMul));
}
}

static boolean EXTRA_GRAPH_MATH_ENABLED =
Boolean.parseBoolean(System.getProperty(History.class.getName() + ".EXTRA_GRAPH_MATH_ENABLED", "true"));

Expand Down Expand Up @@ -464,8 +408,6 @@ private ObjectNode computeResultTrendJson(List<HistoryTestResultSummary> history
1,
1,
10.0); // "--dark-blue"
createSplineTrend(
series, history, lrX, lrY, "Smooth of Passed", "rgba(255, 50, 255, 0.5)", 1, 1, 10.0); // "--purple"
}

root.set("series", series);
Expand Down

0 comments on commit cdc1d71

Please sign in to comment.