Package com.loadfocus.jenkins.api
Class LoadAPI
java.lang.Object
com.loadfocus.jenkins.api.LoadAPI
Client for the LoadFocus public load-test API (cloud "general" tests).
The API key travels only in the
loadfocus-auth header and is never logged.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOutcome of launching a run.static final classResult of an HTTP call: status code plus raw body. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidannotateRun(String testrunname, String testrunid, String label, String url) Labels a run (shown on its LoadFocus results and trend), e.g.createShareLink(String testrunname, String testrunid) Creates (or returns) a public share link for a finished run.net.sf.json.JSONObjectgetAnalysis(String testrunname, String testrunid) Whole-run analysis (overall + per-label metrics), or null while the run has no samples yet.net.sf.json.JSONObjectThe account's cloud tests as {testrunname, testrunid} maps, or null when the key is rejected.net.sf.json.JSONObjectgetVerdict(String testrunname, String testrunid) Server-side pass/fail verdict against the thresholds configured on loadfocus.com.booleanlatestRunId(String testrunname) The test's latest run id ("" when the test has never run).voidputThresholds(String testrunname, Map<String, Number> values) Replaces the test's pass/fail thresholds on loadfocus.com (metrics left out are cleared) and enables them.resultsUrl(String testrunname, String testrunid) static StringresultsUrl(String baseUrl, String testrunname, String testrunid)
-
Field Details
-
DEFAULT_BASE_URL
- See Also:
-
-
Constructor Details
-
LoadAPI
-
LoadAPI
-
-
Method Details
-
isValidApiKey
public boolean isValidApiKey() -
getTestList
public List<Map<String,String>> getTestList() throws IOException, InterruptedException, LoadAPIExceptionThe account's cloud tests as {testrunname, testrunid} maps, or null when the key is rejected. -
latestRunId
public String latestRunId(String testrunname) throws IOException, InterruptedException, LoadAPIException The test's latest run id ("" when the test has never run). -
execute
- Throws:
IOExceptionInterruptedException
-
getState
public net.sf.json.JSONObject getState(String testrunname, String testrunid) throws IOException, InterruptedException, LoadAPIException -
getAnalysis
public net.sf.json.JSONObject getAnalysis(String testrunname, String testrunid) throws IOException, InterruptedException, LoadAPIException Whole-run analysis (overall + per-label metrics), or null while the run has no samples yet. -
getVerdict
public net.sf.json.JSONObject getVerdict(String testrunname, String testrunid) throws IOException, InterruptedException, LoadAPIException Server-side pass/fail verdict against the thresholds configured on loadfocus.com. -
putThresholds
public void putThresholds(String testrunname, Map<String, Number> values) throws IOException, InterruptedException, LoadAPIExceptionReplaces the test's pass/fail thresholds on loadfocus.com (metrics left out are cleared) and enables them. Values: p95Ms, p99Ms, errorRatePct, minRps. -
annotateRun
public void annotateRun(String testrunname, String testrunid, String label, String url) throws IOException, InterruptedException, LoadAPIException Labels a run (shown on its LoadFocus results and trend), e.g. with the Jenkins build that started it. -
resultsUrl
-
resultsUrl
-