Class MetricDefinition

java.lang.Object
org.jenkinsci.plugins.vmanager.charts.model.MetricDefinition
All Implemented Interfaces:
Describable<MetricDefinition>

public class MetricDefinition extends Object implements Describable<MetricDefinition>
Defines one custom metric: which vManager entity level to query and the attribute name.

attributeName stores the value in the format "Title (id)" (e.g. "Expression Covered (CoverageAttributes.EXPRESSION_HIT)"). This keeps the combobox in sync on reopen (saved value = displayed value) while preserving both pieces of information. Use getAttributeTitle() for the chart legend and getAttributeId() for the vManager REST fetch. Plain values without parentheses (manually typed or legacy) are treated as-is.

  • Constructor Details

    • MetricDefinition

      @DataBoundConstructor public MetricDefinition(String entityType, String attributeName, String chartType, String hierarchyPath, String verificationScope)
  • Method Details

    • getEntityType

      public String getEntityType()
    • getAttributeName

      public String getAttributeName()
      Raw stored value, e.g. "Expression Covered (CoverageAttributes.EXPRESSION_HIT)".
    • getAttributeTitle

      public String getAttributeTitle()
      Extracts the human-friendly title from a "Title (id)" value. Returns the whole string if no (id) suffix is present.
    • getAttributeId

      public String getAttributeId()
      Extracts the machine-readable id from a "Title (id)" value. Returns the whole string if no (id) suffix is present.
    • getChartType

      public String getChartType()
    • getHierarchyPath

      public String getHierarchyPath()
    • getVerificationScope

      public String getVerificationScope()
    • getCoverageHierarchy

      public String getCoverageHierarchy()
    • setCoverageHierarchy

      @DataBoundSetter public void setCoverageHierarchy(String coverageHierarchy)
    • getRefinementFiles

      public List<RefinementFile> getRefinementFiles()
    • setRefinementFiles

      @DataBoundSetter public void setRefinementFiles(List<RefinementFile> refinementFiles)
    • getVplanRefinementFiles

      public List<RefinementFile> getVplanRefinementFiles()
    • setVplanRefinementFiles

      @DataBoundSetter public void setVplanRefinementFiles(List<RefinementFile> vplanRefinementFiles)
    • getNickname

      public String getNickname()
    • setNickname

      @DataBoundSetter public void setNickname(String nickname)
    • getDisplayName

      public String getDisplayName()
      Label shown on the chart legend: nickname if set, else attribute title.
    • getSeriesKey

      public String getSeriesKey()
      Per-chart unique key for this metric's series in the build action map. Uses the nickname when set (forbidden to repeat within a chart), else the attribute name.
    • getName

      public String getName()
      Chart-series legend label: the attribute title.