Class VManagerVplanClient
java.lang.Object
org.jenkinsci.plugins.vmanager.charts.util.VManagerVplanClient
Thin client around the vManager
/rest/vplan/get endpoint used to
obtain VPLAN_LEVEL attribute values for a build.
Payload shape:
{
"hierarchy": "...", // omitted when blank
"sticky-context": {
"runs-rs": {
"filter": { "@c":".RelationFilter", "relationName":"session",
"filter": { "@c":".InFilter", "attName":"name",
"operand":"IN", "values":[...] } }
},
"refinement-files": [...],
"vplan": "APB_UART",
"db-vplan": true,
"vplan-refinement-files": [...]
},
"projection": { "selection": ["attr_id_1", "attr_id_2"] }
}
The response is either a single JSON object whose keys match the
projected attribute ids, or a JSON array of such objects. Numeric values
are summed across rows; sentinel value -1 is rewritten to
0.0.
Per-build routing is handled via VplanRoutingContext: the first
call for a given (vplan, type) pair sends only
x-vmgr-routing-retain: 1; subsequent calls echo back the
x-vmgr-routing-oid returned by the previous response for the
same pair. The same pair may carry its OID across chart boundaries within
one build.
-
Method Summary
Modifier and TypeMethodDescriptionfetchVplanMetricSums(String baseUrl, String hierarchy, Collection<String> sessionNames, Collection<String> refinementFiles, Collection<String> vplanRefinementFiles, String vplan, boolean dbVplan, Collection<String> attributeIds, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials creds, VplanRoutingContext routingCtx, TaskListener listener) Posts a vplan-get query and returns the summed numeric value for each requested attribute id.
-
Method Details
-
fetchVplanMetricSums
public static Map<String,Double> fetchVplanMetricSums(String baseUrl, String hierarchy, Collection<String> sessionNames, Collection<String> refinementFiles, Collection<String> vplanRefinementFiles, String vplan, boolean dbVplan, Collection<String> attributeIds, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials creds, VplanRoutingContext routingCtx, TaskListener listener) throws IOException Posts a vplan-get query and returns the summed numeric value for each requested attribute id.- Parameters:
baseUrl- vManager server base URL.hierarchy- hierarchy path; ifnull/blank thehierarchykey is omitted entirely.sessionNames- session names;null/empty returns zeros.refinementFiles- filesystem paths to refinement files; may benull/empty.vplanRefinementFiles- filesystem paths to vPlan refinement files; may benull/empty.vplan- vPlan name (e.g."APB_UART").dbVplan-truefor DB-stored vPlan,falsefor file-based vPlan.attributeIds- attribute ids to project;null/empty returns an empty map.creds- HTTP Basic credentials; may benull.routingCtx- per-build routing-OID holder keyed by(vplan, type); may benull.listener- build console for payload / header logging; may benull.- Returns:
- map of attribute id → summed value (entries pre-seeded to
0.0). Nevernull. - Throws:
IOException
-