Class BuildChartAction

java.lang.Object
org.jenkinsci.plugins.vmanager.charts.BuildChartAction
All Implemented Interfaces:
Action, ModelObject

public class BuildChartAction extends Object implements Action
Build-level action that adds a "vManager Charts" link to every individual build's left sidebar. The page hosts one or more build-scope charts.

Currently the page hosts a single chart, the Regression Optimization Chart — a scatter of all runs in the build's vManager session(s), bucketed by duration into Small (green), Medium (orange) and Large (red) thirds. Additional build-level charts can be added to the same page over time.

The chart's data is computed at the end of each build by CustomMetricsRunListener and stored on the build as a RegressionOptimizationBuildAction; this action simply hands that stored data to the front-end ECharts code via a Stapler proxy.

  • Constructor Details

    • BuildChartAction

      public BuildChartAction(Run<?,?> run)
  • Method Details

    • getRun

      public Run<?,?> getRun()
    • getIconFileName

      @CheckForNull public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      @CheckForNull public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      @CheckForNull public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • getPageHeading

      public String getPageHeading()
      Page heading: "vManager Charts for build #N".
    • isShowRegressionOptimizationChart

      public boolean isShowRegressionOptimizationChart()
      Whether the Regression Optimization Chart is enabled on the parent job.
    • isShowRunAnomaliesChart

      public boolean isShowRunAnomaliesChart()
      Whether the Run Anomalies Chart is enabled on the parent job.
    • getSessions

      public List<String> getSessions()
      vManager session names this build was associated with (resolved from .sessions.input or, as a fallback, .session_launch.output). Returns an empty list when no build-level chart data was recorded yet. Exposed to the build-level charts page so it can list them under the heading.
    • getSessionWarnings

      public Map<String,String> getSessionWarnings()
      Per-session warning text (e.g. TAT misconfiguration). Sessions without a warning are absent from the returned map. Exposed to the build-level charts page so it can render an inline disclaimer next to each session name.
    • getRegressionOptimizationData

      @JavaScriptMethod public BuildChartAction.RegressionOptimizationData getRegressionOptimizationData()
      Stapler/JS-callable: returns the Runs Duration chart data that was fetched and stored on this build at build-completion time.
    • getRunAnomaliesData

      @JavaScriptMethod public BuildChartAction.RunAnomaliesData getRunAnomaliesData()
      Stapler/JS-callable: returns the Run Anomalies chart data that was fetched and stored on this build at build-completion time.
    • getLayoutJson

      public String getLayoutJson()
      Current persisted build-page layout, opaque JSON; "{}" if none.
    • isCanConfigure

      public boolean isCanConfigure()
      Whether the current user may persist a new layout for this page.
    • doSaveLayout

      public void doSaveLayout(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException
      Throws:
      IOException