Class CustomMetricsCollector
java.lang.Object
org.jenkinsci.plugins.vmanager.charts.util.CustomMetricsCollector
Collects the per-build values of every
MetricDefinition declared
on a ChartDefinition, dispatched by the metric's
entityType:
SESSION_LEVEL: all attribute ids in the chart are fetched in a single POST to/rest/sessions/list(seeVManagerSessionsClient.fetchSessionAttributeSums(java.lang.String, java.util.Collection<java.lang.String>, java.util.Collection<java.lang.String>, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials)). The numeric value of each attribute is summed across all returned region rows.VPLAN_LEVEL: not yet implemented — returns a placeholder random value (so the chart still has data to render).COVERAGE_LEVEL: not yet implemented — placeholder random.
Returned map keys use CustomMetricsRunListener.key(String, String)
so the values can be merged straight onto a
CustomMetricsBuildAction.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncollect(String serverUrl, List<String> sessions, ChartDefinition chart, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials creds, TaskListener listener) Backwards-compatible overload (no routing contexts) used by tests / callers that don't manage per-build routing OIDs.collect(String serverUrl, List<String> sessions, ChartDefinition chart, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials creds, CoverageRoutingContext routingCtx, TaskListener listener) Backwards-compatible overload (no routing contexts).collect(String serverUrl, List<String> sessions, ChartDefinition chart, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials creds, CoverageRoutingContext routingCtx, VplanRoutingContext vplanRoutingCtx, TaskListener listener) Collect the values of every metric inchartfor this build.
-
Field Details
-
SESSION_LEVEL
- See Also:
-
VPLAN_LEVEL
- See Also:
-
COVERAGE_LEVEL
- See Also:
-
-
Method Details
-
collect
public static Map<String,Double> collect(String serverUrl, List<String> sessions, ChartDefinition chart, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials creds, CoverageRoutingContext routingCtx, VplanRoutingContext vplanRoutingCtx, TaskListener listener) Collect the values of every metric inchartfor this build.- Parameters:
serverUrl- vManager base URL.sessions- session names this build is associated with (may be empty; SESSION_LEVEL metrics will then yield 0).chart- chart whose metrics are collected.creds- HTTP Basic credentials (may benull).listener- build log; each metric and any error is logged with the[vManager Charts]prefix.- Returns:
- a map keyed by
CustomMetricsRunListener.key(String, String); empty if the chart has no metrics. Nevernull.
-
collect
public static Map<String,Double> collect(String serverUrl, List<String> sessions, ChartDefinition chart, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials creds, CoverageRoutingContext routingCtx, TaskListener listener) Backwards-compatible overload (no routing contexts). -
collect
public static Map<String,Double> collect(String serverUrl, List<String> sessions, ChartDefinition chart, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials creds, TaskListener listener) Backwards-compatible overload (no routing contexts) used by tests / callers that don't manage per-build routing OIDs.
-