hudson.model.AbstractBuild.getTimestamp()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中hudson.model.AbstractBuild.getTimestamp()方法的一些代码示例,展示了AbstractBuild.getTimestamp()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractBuild.getTimestamp()方法的具体详情如下:
包路径:hudson.model.AbstractBuild
类名称:AbstractBuild
方法名:getTimestamp

AbstractBuild.getTimestamp介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

public Calendar due() {
  return getTimestamp();
}

代码示例来源:origin: org.hudsonci.plugins/analysis-core

/**
 * Returns the time of the baseline build.
 *
 * @return the time
 */
public Calendar getTimestamp() {
  return baseline.getTimestamp();
}
/**

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

public Calendar due() {
  return getTimestamp();
}

代码示例来源:origin: awslabs/aws-device-farm-jenkins-plugin

public AWSDeviceFarmGraph(AbstractBuild<?, ?> owner, Boolean isCompleted, Area size, CategoryDataset dataset, String xLabel, String yLabel, Color... colors) {
  // Toggle the graph timestamp so we don't cache the graph image if the run isn't completed.
  super(((isCompleted) ? owner.getTimestamp().getTimeInMillis() : -1), size.width, size.height);
  this.dataset = dataset;
  this.xLabel = xLabel;
  this.yLabel = yLabel;
  this.colors = colors;
}

代码示例来源:origin: org.hudsonci.plugins/analysis-core

/**
 * Resets the successful high score counters.
 */
private void resetSuccessfulState() {
  successfulSinceBuild = owner.getNumber();
  successfulSinceDate = owner.getTimestamp().getTimeInMillis();
  isSuccessfulHighscore = true;
  successfulHighscore = 0;
}

代码示例来源:origin: Diabol/delivery-pipeline-plugin

private static int calculateBuildProgress(AbstractBuild build) {
  return calculateBuildProgress(
      currentTimeMillis(), build.getTimestamp().getTimeInMillis(), build.getEstimatedDuration());
}

代码示例来源:origin: jenkinsci/promoted-builds-plugin

/**
 * Gets the string that says how long did it took for this build to be promoted.
 * @param owner Build
 * @return Time span string formatted by {@link Util#getTimeSpanString(long)}
 */
public String getDelayString(AbstractBuild<?,?> owner) {
  long duration = timestamp.getTimeInMillis() - owner.getTimestamp().getTimeInMillis() - owner.getDuration();
  return Util.getTimeSpanString(duration);
}

代码示例来源:origin: Diabol/delivery-pipeline-plugin

private static Status statusWithProgress(AbstractBuild build, int progress) {
  return StatusFactory.running(
      progress, build.getTimeInMillis(), currentTimeMillis() - build.getTimestamp().getTimeInMillis());
}

代码示例来源:origin: org.jenkins-ci.plugins/build-pipeline-plugin

/**
 * Returns the estimated percentage complete of the current build.
 *
 * @return - Estimated percentage complete of the current build.
 */
public long getBuildProgress() {
  if (this.currentBuild != null && this.currentBuild.isBuilding()) {
    final long duration = new Date().getTime() - this.currentBuild.getTimestamp().getTimeInMillis();
    return calculatePercentage(duration, this.currentBuild.getEstimatedDuration());
  } else {
    return 0;
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-core

@Override
public TestResult parse(String testResultLocations,
    AbstractBuild build, Launcher launcher,
    TaskListener listener)
    throws InterruptedException, IOException {
  final long buildTime = build.getTimestamp().getTimeInMillis();
  final long timeOnMaster = System.currentTimeMillis();
  // [BUG 3123310] TODO - Test Result Refactor: review and fix TestDataPublisher/TestAction subsystem]
  // also get code that deals with testDataPublishers from JUnitResultArchiver.perform
  TestResult testResult = build.getWorkspace().act(new ParseResultCallable(testResultLocations, buildTime, timeOnMaster, keepLongStdio));
  return testResult;
}

代码示例来源:origin: org.hudsonci.plugins/analysis-core

/**
 * Computes the delta between two dates in days.
 *
 * @param first
 *            the first date
 * @param second
 *            the second date (given by the build result)
 * @return the delta between two dates in days
 */
public static long computeDayDelta(final Calendar first, final BuildResult second) {
  return computeDayDelta(first, second.getOwner().getTimestamp());
}

代码示例来源:origin: hudson/hudson-2.x

@Override
public TestResult parse(String testResultLocations,
                  AbstractBuild build, Launcher launcher,
                  TaskListener listener)
    throws InterruptedException, IOException
{
  final long buildTime = build.getTimestamp().getTimeInMillis();
  final long timeOnMaster = System.currentTimeMillis();
  // [BUG 3123310] TODO - Test Result Refactor: review and fix TestDataPublisher/TestAction subsystem]
  // also get code that deals with testDataPublishers from JUnitResultArchiver.perform
  
  TestResult testResult = build.getWorkspace().act( new ParseResultCallable(testResultLocations, buildTime, timeOnMaster, keepLongStdio));
  return testResult;        
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

@Override
public TestResult parse(String testResultLocations,
                  AbstractBuild build, Launcher launcher,
                  TaskListener listener)
    throws InterruptedException, IOException
{
  final long buildTime = build.getTimestamp().getTimeInMillis();
  final long timeOnMaster = System.currentTimeMillis();
  // [BUG 3123310] TODO - Test Result Refactor: review and fix TestDataPublisher/TestAction subsystem]
  // also get code that deals with testDataPublishers from JUnitResultArchiver.perform
  
  TestResult testResult = build.getWorkspace().act( new ParseResultCallable(testResultLocations, buildTime, timeOnMaster, keepLongStdio));
  return testResult;        
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

@Override
public TestResult parse(String testResultLocations,
                  AbstractBuild build, Launcher launcher,
                  TaskListener listener)
    throws InterruptedException, IOException
{
  final long buildTime = build.getTimestamp().getTimeInMillis();
  final long timeOnMaster = System.currentTimeMillis();
  // [BUG 3123310] TODO - Test Result Refactor: review and fix TestDataPublisher/TestAction subsystem]
  // also get code that deals with testDataPublishers from JUnitResultArchiver.perform
  
  TestResult testResult = build.getWorkspace().act( new ParseResultCallable(testResultLocations, buildTime, timeOnMaster, keepLongStdio));
  return testResult;        
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

/**
 * Generates a clickable map HTML for {@link #doGraph(StaplerRequest, StaplerResponse)}.
 */
public void doGraphMap( StaplerRequest req, StaplerResponse rsp) throws IOException {
  if(req.checkIfModified(owner.getTimestamp(),rsp))
    return;
  ChartUtil.generateClickableMap(req,rsp,createChart(req,buildDataSet(req)),calcDefaultSize());
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Generates a clickable map HTML for {@link #doGraph(StaplerRequest, StaplerResponse)}.
 */
public void doGraphMap( StaplerRequest req, StaplerResponse rsp) throws IOException {
  if(req.checkIfModified(owner.getTimestamp(),rsp))
    return;
  ChartUtil.generateClickableMap(req,rsp,createChart(req,buildDataSet(req)),calcDefaultSize());
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

/**
 * Generates a clickable map HTML for {@link #doGraph(StaplerRequest, StaplerResponse)}.
 */
public void doGraphMap( StaplerRequest req, StaplerResponse rsp) throws IOException {
  if(req.checkIfModified(owner.getTimestamp(),rsp))
    return;
  
  Area defSize = calcDefaultSize();
  Graph graph = new Graph(-1, defSize.width, defSize.height);
  graph.setYAxisLabel("count");
  graph.setData(getGraphDataSet(req));
  graph.doMap(req,rsp);
}

代码示例来源:origin: hudson/hudson-2.x

/**
 * Generates a PNG image for the test result trend.
 */
public void doGraph( StaplerRequest req, StaplerResponse rsp) throws IOException {
  if(ChartUtil.awtProblemCause!=null) {
    // not available. send out error message
    rsp.sendRedirect2(req.getContextPath()+"/images/headless.png");
    return;
  }
  if(req.checkIfModified(owner.getTimestamp(),rsp))
    return;
  ChartUtil.generateGraph(req,rsp,createChart(req,buildDataSet(req)),calcDefaultSize());
}

代码示例来源:origin: org.jenkins-ci.plugins/global-build-stats

public JobBuildResult createJobBuildResult(AbstractBuild build){
  String buildName = build.getProject().getFullName();
  long duration = build.getDuration();
  String nodeName = build.getBuiltOnStr();
  /* Can't do that since MavenModuleSet is in maven-plugin artefact which is in test scope
  if(build.getProject() instanceof MavenModuleSet){
    buildName = ((MavenModuleSet)build.getProject()).getRootModule().toString();
  }*/
  return new JobBuildResult(createBuildResult(build.getResult()), buildName, 
      build.getNumber(), build.getTimestamp(), duration, nodeName, extractUserNameIn(build));
}

代码示例来源:origin: org.jvnet.hudson.plugins/testng-plugin

public void doGraphMap(StaplerRequest req,
    StaplerResponse rsp) throws IOException {
 Calendar t = getProject().getLastCompletedBuild().getTimestamp();
 if (req.checkIfModified(t, rsp)) {
   return; // up to date
 }
 DataSetBuilder<String, ChartUtil.NumberOnlyBuildLabel> dataSetBuilder =
  new DataSetBuilder<String, ChartUtil.NumberOnlyBuildLabel>();
 //TODO: optimize by using cache
 populateDataSetBuilder(dataSetBuilder);
 ChartUtil.generateClickableMap(req, rsp, GraphHelper.createChart(req, dataSetBuilder.build()),
      getGraphWidth(), getGraphHeight());
}

相关文章

微信公众号

最新文章

更多

AbstractBuild类方法