Class TrendModel
java.lang.Object
io.jenkins.plugins.analysis.core.model.TrendModel
- All Implemented Interfaces:
ModelObject
Server side model that provides the data for the "Trend" page of the Warnings tab of a run. The page answers the
question: "How did the number of warnings evolve in the builds up to this build?". It shows a trend chart for one
of the
results of the run or for all results together. The history ends with the run that
owns this page, so older builds show the trend up to that build (and not up to the latest build of the job).
The following settings can be changed on the client side in the app bar, see trend-model.js:
- the trend source: all tools (only if the run has more than one result) or a single tool
- the chart type: issues by severity, issues and health, new and fixed issues, or issues per tool. Not all
chart types are available for each source, see
TrendModel.TrendSource.getChartTypes(). - the number of builds to show
The chart models are created by the existing trend charts of the package
io.jenkins.plugins.analysis.core.charts, which are also used on the job page. The history of a single tool
is provided by ResultAction.createBuildHistory(), the history of all tools by
CompositeBuildResultsIterable, which sums up the results of all tools of a build.
- Author:
- Ullrich Hafner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe types of trend charts that can be shown on the trend page.static final classA source of a trend chart: either a single tool or the combination of all tools of a run. -
Method Summary
Modifier and TypeMethodDescriptionReturns all chart types.Returns the run that owns the results.Returns the sources that can be selected for the trend chart.getTab()Returns the Warnings tab of the run.getTrendChart(String configuration) Returns the trend chart for the specified configuration.Returns the URL of this page, relative to the Warnings tab.
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein interfaceModelObject
-
getUrlName
Returns the URL of this page, relative to the Warnings tab.- Returns:
- the URL name
-
getObject
Returns the run that owns the results. Required byl:run-subpage.- Returns:
- the run
-
getTab
Returns the Warnings tab of the run. Used to render the app bar and the side panel.- Returns:
- the tab
-
getSources
Returns the sources that can be selected for the trend chart. If the run has more than one result, the first source combines all tools. Then a source for each tool follows.- Returns:
- the trend sources, never empty
-
getChartTypes
Returns all chart types. Which of them are available for a given source is determined on the client side usingTrendModel.TrendSource.getChartIds().- Returns:
- all chart types
-
getTrendChart
Returns the trend chart for the specified configuration. The configuration is a JSON object with the propertiestool(the ID of theTrendModel.TrendSource),chart(the ID of theTrendModel.ChartType), andnumberOfBuilds. Unknown or missing values are replaced by defaults: the first source, thedefault chart typeof the source, and 50 builds.- Parameters:
configuration- JSON object to configure the trend chart- Returns:
- the trend chart model (converted to a JSON string)
-