本文整理汇总了Java中hudson.util.Graph类的典型用法代码示例。如果您正苦于以下问题:Java Graph类的具体用法?Java Graph怎么用?Java Graph使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Graph类属于hudson.util包,在下文中一共展示了Graph类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDurationTrendGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Generate a duration trend graph for device minutes used for recent results.
*
* @param owner The build which owns the latest result.
* @param isCompleted The flag to denote if the result is completed which determines our caching.
* @param results The list of previous to latest results which generate the trend.
* @return The duration trend graph.
*/
public static Graph createDurationTrendGraph(AbstractBuild<?, ?> owner, Boolean isCompleted, List<AWSDeviceFarmTestResult> results) {
DataSetBuilder<String, NumberOnlyBuildLabel> builder = new DataSetBuilder<String, NumberOnlyBuildLabel>();
for (AWSDeviceFarmTestResult result : results) {
// Create label for this result using its Jenkins build number.
Run<?, ?> build = result.getOwner();
NumberOnlyBuildLabel label = new NumberOnlyBuildLabel(build);
// Attach duration value for all results in our trend.
builder.add(result.getDuration(), "Minutes", label);
}
CategoryDataset dataset = builder.build();
Color[] colors = new Color[]{AWSDeviceFarmGraph.DurationColor};
return new AWSDeviceFarmGraph(owner, isCompleted, getGraphSize(), dataset, "Build #", "Device Minutes Used", colors);
}
示例2: doGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Return trend graph of all AWS Device Farm results for this project.
*
* @param request The request object.
* @param response The response object.
* @throws IOException
*/
@SuppressWarnings("unused")
public void doGraph(StaplerRequest request, StaplerResponse response) throws IOException {
// Abort if having Java AWT issues.
if (ChartUtil.awtProblemCause != null) {
response.sendRedirect2(String.format("%s/images/headless.png", request.getContextPath()));
return;
}
// Get previous AWS Device Farm build and results.
AWSDeviceFarmTestResultAction prev = getLastBuildAction();
if (prev == null) {
return;
}
AWSDeviceFarmTestResult result = prev.getResult();
if (result == null) {
return;
}
// Create new graph for the AWS Device Farm results of all runs in this project.
Graph graph = AWSDeviceFarmGraph.createResultTrendGraph(prev.getOwner(), false, result.getPreviousResults());
graph.doPng(request, response);
}
示例3: doGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Create the graph image for the number of pass/warn/fail results in a test run, for the previous three Jenkins runs.
*
* @param request
* @param response
* @throws IOException
*/
@SuppressWarnings("unused")
public void doGraph(StaplerRequest request, StaplerResponse response) throws IOException {
// Abort if having Java AWT issues.
if (ChartUtil.awtProblemCause != null) {
response.sendRedirect2(String.format("%s/images/headless.png", request.getContextPath()));
return;
}
// Check the "If-Modified-Since" header and abort if we don't need re-create the graph.
if (isCompleted()) {
Calendar timestamp = getOwner().getTimestamp();
if (request.checkIfModified(timestamp, response)) {
return;
}
}
// Create new graph for this AWS Device Farm result.
Graph graph = AWSDeviceFarmGraph.createResultTrendGraph(build, isCompleted(), getPreviousResults(DefaultTrendGraphSize));
graph.doPng(request, response);
}
示例4: doDurationGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Create the graph image for the number of device minutes used in a test run, for the previous three Jenkins runs.
*
* @param request
* @param response
* @throws IOException
*/
@SuppressWarnings("unused")
public void doDurationGraph(StaplerRequest request, StaplerResponse response) throws IOException {
// Abort if having Java AWT issues.
if (ChartUtil.awtProblemCause != null) {
response.sendRedirect2(String.format("%s/images/headless.png", request.getContextPath()));
return;
}
// Check the "If-Modified-Since" header and abort if we don't need re-create the graph.
if (isCompleted()) {
Calendar timestamp = getOwner().getTimestamp();
if (request.checkIfModified(timestamp, response)) {
return;
}
}
// Create new duration graph for this AWS Device Farm result.
Graph graph = AWSDeviceFarmGraph.createDurationTrendGraph(build, isCompleted(), getPreviousResults(DefaultTrendGraphSize));
graph.doPng(request, response);
}
示例5: doSeverityTrend
import hudson.util.Graph; //导入依赖的package包/类
/**
* Display the severity trend graph.
*
* @param request Stapler request
* @param response Stapler response
* @throws IOException in case of an error
*/
public void doSeverityTrend(final StaplerRequest request, final StaplerResponse response) throws IOException {
AbstractBuild<?,?> lastBuild = this.getLastFinishedBuild();
final CodeDxBuildAction lastAction = lastBuild.getAction(CodeDxBuildAction.class);
final Map<String,Color> colorMap = new HashMap<String,Color>();
colorMap.put(Filter.SEVERITY_CRITICAL, new Color(0x610a14));
colorMap.put(Filter.SEVERITY_HIGH, new Color(0xbd0026));
colorMap.put(Filter.SEVERITY_MEDIUM, new Color(0xfd8d3c));
colorMap.put(Filter.SEVERITY_LOW, new Color(0xfed976));
colorMap.put(Filter.SEVERITY_INFO, new Color(0x888888));
colorMap.put(Filter.SEVERITY_UNSPECIFIED, new Color(0xadadad));
(new Graph(-1L, CHART_WIDTH, CHART_HEIGHT){
@Override
protected JFreeChart createGraph() {
return CodeDxChartBuilder.buildChart(lastAction, analysisResultConfiguration.getNumBuildsInGraph(),"severity",colorMap);
}
}).doPng(request, response);
}
示例6: doStatusTrend
import hudson.util.Graph; //导入依赖的package包/类
/**
* Display the status trend graph.
*
* @param request Stapler request
* @param response Stapler response
* @throws IOException in case of an error
*/
public void doStatusTrend(final StaplerRequest request, final StaplerResponse response) throws IOException {
AbstractBuild<?,?> lastBuild = this.getLastFinishedBuild();
final CodeDxBuildAction lastAction = lastBuild.getAction(CodeDxBuildAction.class);
final Map<String,Color> colorMap = new HashMap<String,Color>();
colorMap.put(StatisticGroup.New.toString(), new Color(0x542788));
colorMap.put(StatisticGroup.Unresolved.toString(), new Color(0x998ec3));
colorMap.put(StatisticGroup.Fixed.toString(), new Color(0x3288bd));
colorMap.put(StatisticGroup.Mitigated.toString(), new Color(0x295ec6));
colorMap.put(StatisticGroup.Assigned.toString(), new Color(0x01665e));
colorMap.put(StatisticGroup.Escalated.toString(), new Color(0x5ab4ac));
colorMap.put(StatisticGroup.Ignored.toString(), new Color(0xd8b365));
colorMap.put(StatisticGroup.FalsePositive.toString(), new Color(0xd9d9d9));
(new Graph(-1, CHART_WIDTH, CHART_HEIGHT){
@Override
protected JFreeChart createGraph() {
return CodeDxChartBuilder.buildChart(lastAction, analysisResultConfiguration.getNumBuildsInGraph(),"status",colorMap);
}
}).doPng(request, response);
}
示例7: createDurationTrendGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Generate a duration trend graph for device minutes used for recent results.
* @param owner build which owns the latest result
* @param isCompleted flag to denote if the result is completed which determines our caching
* @param results list of previous to latest results which generate the trend
* @return
*/
public static Graph createDurationTrendGraph(AbstractBuild<?, ?> owner, Boolean isCompleted, List<AppThwackTestResult> results) {
DataSetBuilder<String, NumberOnlyBuildLabel> builder = new DataSetBuilder<String, NumberOnlyBuildLabel>();
for (AppThwackTestResult result : results) {
// Create label for this result using its Jenkins build number.
AbstractBuild<?, ?> build = result.getOwner();
NumberOnlyBuildLabel label = new NumberOnlyBuildLabel(build);
// Attach duration value for all results in our trend.
builder.add(result.getDuration(), "Minutes", label);
}
CategoryDataset dataset = builder.build();
Color[] colors = new Color[] { AppThwackGraph.DurationColor };
return new AppThwackGraph(owner, isCompleted, getGraphSize(), dataset, "Build #", "Device Minutes Used", colors);
}
示例8: createCpuTrendGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Generate a CPU usage trend graph for recent results.
* @param owner build which owns the latest result
* @param isCompleted flag to denote if the result is completed which determines our caching
* @param results list of previous to latest results which generate the trend
* @return
*/
public static Graph createCpuTrendGraph(AbstractBuild<?, ?> owner, Boolean isCompleted, List<AppThwackTestResult> results) {
DataSetBuilder<String, NumberOnlyBuildLabel> builder = new DataSetBuilder<String, NumberOnlyBuildLabel>();
for (AppThwackTestResult result : results) {
// Create label for this result using its Jenkins build number.
AbstractBuild<?, ?> build = result.getOwner();
NumberOnlyBuildLabel label = new NumberOnlyBuildLabel(build);
// Attach CPU average value for each result in our trend.
float cpuAvg = result.getCpuAvg();
builder.add(cpuAvg, "CPU", label);
}
CategoryDataset dataset = builder.build();
Color[] colors = new Color[] { AppThwackGraph.PassColor };
return new AppThwackGraph(owner, isCompleted, getGraphSize(), dataset, "Build #", "CPU Average (%)", colors);
}
示例9: createMemoryTrendGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Generate a memory usage (KB) trend graph for recent results.
* @param owner build which owns the latest result
* @param isCompleted flag to denote if the result is completed which determines our caching
* @param results list of previous to latest results which generate the trend
* @return
*/
public static Graph createMemoryTrendGraph(AbstractBuild<?, ?> owner, Boolean isCompleted, List<AppThwackTestResult> results) {
DataSetBuilder<String, NumberOnlyBuildLabel> builder = new DataSetBuilder<String, NumberOnlyBuildLabel>();
for (AppThwackTestResult result : results) {
// Create label for this result using its Jenkins build number.
AbstractBuild<?, ?> build = result.getOwner();
NumberOnlyBuildLabel label = new NumberOnlyBuildLabel(build);
// Attach memory average value for each result in our trend.
float memoryAvg = result.getMemoryAvg();
builder.add(memoryAvg, "Memory", label);
}
CategoryDataset dataset = builder.build();
Color[] colors = new Color[] { AppThwackGraph.PassColor };
return new AppThwackGraph(owner, isCompleted, getGraphSize(), dataset, "Build #", "Memory Average (KB)", colors);
}
示例10: createThreadTrendGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Generate a thread count trend graph for recent results.
* @param owner build which owns the latest result
* @param isCompleted flag to denote if the result is completed which determines our caching
* @param results list of previous to latest results which generate the trend
* @return
*/
public static Graph createThreadTrendGraph(AbstractBuild<?, ?> owner, Boolean isCompleted, List<AppThwackTestResult> results) {
DataSetBuilder<String, NumberOnlyBuildLabel> builder = new DataSetBuilder<String, NumberOnlyBuildLabel>();
for (AppThwackTestResult result : results) {
// Create label for this result using its Jenkins build number.
AbstractBuild<?, ?> build = result.getOwner();
NumberOnlyBuildLabel label = new NumberOnlyBuildLabel(build);
// Attach thread count average value for each result in our trend.
float threadAvg = result.getThreadAvg();
builder.add(threadAvg, "Threads", label);
}
CategoryDataset dataset = builder.build();
Color[] colors = new Color[] { AppThwackGraph.PassColor };
return new AppThwackGraph(owner, isCompleted, getGraphSize(), dataset, "Build #", "Threads Average", colors);
}
示例11: createFrameDrawTrendGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Generate a frame draw time trend graph for recent results.
* @param owner build which owns the latest result
* @param isCompleted flag to denote if the result is completed which determines our caching
* @param results list of previous to latest results which generate the trend
* @return
*/
public static Graph createFrameDrawTrendGraph(AbstractBuild<?, ?> owner, Boolean isCompleted, List<AppThwackTestResult> results) {
DataSetBuilder<String, NumberOnlyBuildLabel> builder = new DataSetBuilder<String, NumberOnlyBuildLabel>();
for (AppThwackTestResult result : results) {
// Create label for this result using its Jenkins build number.
AbstractBuild<?, ?> build = result.getOwner();
NumberOnlyBuildLabel label = new NumberOnlyBuildLabel(build);
// Attach Frame Draw Times average value for each result in our trend.
float drawTime = result.getDrawTimeAvg();
builder.add(drawTime, "Frame Draw Time", label);
}
CategoryDataset dataset = builder.build();
Color[] colors = new Color[] { AppThwackGraph.PassColor };
return new AppThwackGraph(owner, isCompleted, getGraphSize(), dataset, "Build #", "Frame Draw Time Average (ms)", colors);
}
示例12: createFpsTrendGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Generate a FPS trend graph for recent results.
* @param owner build which owns the latest result
* @param isCompleted flag to denote if the result is completed which determines our caching
* @param results list of previous to latest results which generate the trend
* @return
*/
public static Graph createFpsTrendGraph(AbstractBuild<?, ?> owner, Boolean isCompleted, List<AppThwackTestResult> results) {
DataSetBuilder<String, NumberOnlyBuildLabel> builder = new DataSetBuilder<String, NumberOnlyBuildLabel>();
for (AppThwackTestResult result : results) {
// Create label for this result using its Jenkins build number.
AbstractBuild<?, ?> build = result.getOwner();
NumberOnlyBuildLabel label = new NumberOnlyBuildLabel(build);
// Attach FPS average value for each result in our trend.
float fps = result.getFpsAvg();
builder.add(fps, "FPS", label);
}
CategoryDataset dataset = builder.build();
Color[] colors = new Color[] { AppThwackGraph.PassColor };
return new AppThwackGraph(owner, isCompleted, getGraphSize(), dataset, "Build #", "FPS Average", colors);
}
示例13: doGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Create the graph image for the number of pass/warn/fail results in a test run, for the previous three Jenkins runs.
* @param request
* @param response
* @throws IOException
*/
public void doGraph(StaplerRequest request, StaplerResponse response) throws IOException {
// Abort if having Java AWT issues.
if (ChartUtil.awtProblemCause != null) {
response.sendRedirect2(String.format("%s/images/headless.png", request.getContextPath()));
return;
}
// Check the "If-Modified-Since" header and abort if we don't need re-create the graph.
if (isCompleted()) {
Calendar timestamp = getOwner().getTimestamp();
if (request.checkIfModified(timestamp, response)) {
return;
}
}
// Create new graph for this AppThwack result.
Graph graph = AppThwackGraph.createResultTrendGraph(build, isCompleted(), getPreviousResults(DefaultTrendGraphSize));
graph.doPng(request, response);
}
示例14: doDurationGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Create the graph image for the number of device minutes used in a test run, for the previous three Jenkins runs.
* @param request
* @param response
* @throws IOException
*/
public void doDurationGraph(StaplerRequest request, StaplerResponse response) throws IOException {
// Abort if having Java AWT issues.
if (ChartUtil.awtProblemCause != null) {
response.sendRedirect2(String.format("%s/images/headless.png", request.getContextPath()));
return;
}
// Check the "If-Modified-Since" header and abort if we don't need re-create the graph.
if (isCompleted()) {
Calendar timestamp = getOwner().getTimestamp();
if (request.checkIfModified(timestamp, response)) {
return;
}
}
// Create new duration graph for this AppThwack result.
Graph graph = AppThwackGraph.createDurationTrendGraph(build, isCompleted(), getPreviousResults(DefaultTrendGraphSize));
graph.doPng(request, response);
}
示例15: doCpuGraph
import hudson.util.Graph; //导入依赖的package包/类
/**
* Create the graph image for the average CPU usage for all devices in a test run, for the previous three Jenkins runs.
* @param request
* @param response
* @throws IOException
*/
public void doCpuGraph(StaplerRequest request, StaplerResponse response) throws IOException {
// Abort if having Java AWT issues.
if (ChartUtil.awtProblemCause != null) {
response.sendRedirect2(String.format("%s/images/headless.png", request.getContextPath()));
return;
}
// Check the "If-Modified-Since" header and abort if we don't need re-create the graph.
if (isCompleted()) {
Calendar timestamp = getOwner().getTimestamp();
if (request.checkIfModified(timestamp, response)) {
return;
}
}
// Create new performance graph for this AppThwack result.
Graph graph = AppThwackGraph.createCpuTrendGraph(build, isCompleted(), getPreviousResults(DefaultTrendGraphSize));
graph.doPng(request, response);
}