Enhance plot plugin with configurable chart options and sequential image loading#196
Open
wwwgmc wants to merge 4 commits intojenkinsci:masterfrom
Open
Enhance plot plugin with configurable chart options and sequential image loading#196wwwgmc wants to merge 4 commits intojenkinsci:masterfrom
wwwgmc wants to merge 4 commits intojenkinsci:masterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhance plot plugin with configurable chart options and sequential image loading
Summary
This PR introduces four new user-configurable parameters to the Plot plugin and fixes a reliability issue where plot images fail to load when many charts are rendered on the same page.
New Configuration Parameters
chartWidthchartHeightskipZeroValuesuseDecimalFormatSequential Image Loading
When a plot report page contains many charts, the browser previously fired all image requests in parallel. Since each plot image is dynamically generated on the server side (CPU-intensive), this often caused timeouts and broken images.
This PR replaces the static
<img>tags with placeholder<div>elements and introduces a JavaScript sequential loader that:onload/onerrorbefore requesting the nextFiles Changed (13 files)
Java backend (4 files):
Plot.java— Added 4 new configuration fields, getters,getEffectiveWidth()/getEffectiveHeight()helper methods;setWidth()/setHeight()now use configured values as defaults;addBuild()conditionally skips zero/NaN data points;generatePlot()conditionally appliesDecimalFormatto Y-axisPlotBuilder.java— Added 4 new fields with@DataBoundSetterannotations for Pipeline support; updatedperform()to pass new parameters toPlotconstructorPlotReport.java— AddedgetPlotWidth()/getPlotHeight()methods for dynamic chart dimensions in Jelly templatesMatrixPlotPublisher.java— UpdatedPlotconstructor call to include new parametersConfiguration UI (2 files):
PlotBuilder/config.jelly— Added form fields for the 4 new parameters (Pipeline job configuration)AbstractPlotPublisher/config.jelly— Added form fields for the 4 new parameters (Freestyle job configuration)Front-end rendering (1 file):
PlotReport/index.jelly— Replaced static<img>with placeholder<div>+ JavaScript sequential loader; chart dimensions are now dynamic viaPlotReport.getPlotWidth()/getPlotHeight()Help files (4 new files):
help-chartWidth.html,help-chartHeight.html,help-skipZeroValues.html,help-useDecimalFormat.htmlOther (2 files):
pom.xml— Appended build date suffix to SNAPSHOT versionPlotTest.java— Updated test constructor calls to match new parameter listBackward Compatibility
skipZeroValuesanduseDecimalFormatdefault tofalse, preserving original behaviorPipeline Usage Example