Search in sources :

Example 1 with Timer

use of org.gradle.internal.time.Timer in project gradle by gradle.

the class WorkerDaemonStarter method startDaemon.

public WorkerDaemonClient startDaemon(Class<? extends WorkerProtocol> workerProtocolImplementationClass, File workingDir, DaemonForkOptions forkOptions) {
    LOG.debug("Starting Gradle worker daemon with fork options {}.", forkOptions);
    Timer clock = Timers.startTimer();
    MultiRequestWorkerProcessBuilder<WorkerDaemonProcess> builder = workerDaemonProcessFactory.multiRequestWorker(WorkerDaemonProcess.class, WorkerProtocol.class, workerProtocolImplementationClass);
    builder.setBaseName("Gradle Worker Daemon");
    // NOTE: might make sense to respect per-compile-task log level
    builder.setLogLevel(startParameter.getLogLevel());
    builder.applicationClasspath(forkOptions.getClasspath());
    builder.sharedPackages(forkOptions.getSharedPackages());
    JavaExecHandleBuilder javaCommand = builder.getJavaCommand();
    javaCommand.setMinHeapSize(forkOptions.getMinHeapSize());
    javaCommand.setMaxHeapSize(forkOptions.getMaxHeapSize());
    javaCommand.setJvmArgs(forkOptions.getJvmArgs());
    javaCommand.setWorkingDir(workingDir);
    WorkerDaemonProcess workerDaemonProcess = builder.build();
    WorkerProcess workerProcess = workerDaemonProcess.start();
    WorkerDaemonClient client = new WorkerDaemonClient(forkOptions, workerDaemonProcess, workerProcess, buildOperationExecutor);
    LOG.info("Started Gradle worker daemon ({}) with fork options {}.", clock.getElapsed(), forkOptions);
    return client;
}
Also used : WorkerProcess(org.gradle.process.internal.worker.WorkerProcess) Timer(org.gradle.internal.time.Timer) JavaExecHandleBuilder(org.gradle.process.internal.JavaExecHandleBuilder)

Example 2 with Timer

use of org.gradle.internal.time.Timer in project gradle by gradle.

the class DefaultTestReport method generateReport.

@Override
public void generateReport(TestResultsProvider resultsProvider, File reportDir) {
    LOG.info("Generating HTML test report...");
    Timer clock = Timers.startTimer();
    AllTestResults model = loadModelFromProvider(resultsProvider);
    generateFiles(model, resultsProvider, reportDir);
    LOG.info("Finished generating test html results ({}) into: {}", clock.getElapsed(), reportDir);
}
Also used : Timer(org.gradle.internal.time.Timer)

Example 3 with Timer

use of org.gradle.internal.time.Timer in project gradle by gradle.

the class DefaultTaskGraphExecuter method execute.

public void execute() {
    Timer clock = Time.startTimer();
    ensurePopulated();
    graphListeners.getSource().graphPopulated(this);
    try {
        taskPlanExecutor.process(taskExecutionPlan, new EventFiringTaskWorker(taskExecuter.create(), buildOperationExecutor.getCurrentOperation()));
        LOGGER.debug("Timing: Executing the DAG took " + clock.getElapsed());
    } finally {
        taskExecutionPlan.clear();
    }
}
Also used : Timer(org.gradle.internal.time.Timer)

Example 4 with Timer

use of org.gradle.internal.time.Timer in project gradle by gradle.

the class ResolveTaskArtifactStateTaskExecuter method execute.

@Override
public void execute(TaskInternal task, TaskStateInternal state, TaskExecutionContext context) {
    Timer clock = Time.startTimer();
    TaskProperties taskProperties = DefaultTaskProperties.resolve(propertyWalker, resolver, task);
    context.setTaskProperties(taskProperties);
    TaskArtifactState taskArtifactState = repository.getStateFor(task, taskProperties);
    TaskOutputsInternal outputs = task.getOutputs();
    context.setTaskArtifactState(taskArtifactState);
    outputs.setHistory(taskArtifactState.getExecutionHistory());
    LOGGER.debug("Putting task artifact state for {} into context took {}.", task, clock.getElapsed());
    try {
        executer.execute(task, state, context);
    } finally {
        outputs.setHistory(null);
        context.setTaskArtifactState(null);
        context.setTaskProperties(null);
        LOGGER.debug("Removed task artifact state for {} from context.");
    }
}
Also used : Timer(org.gradle.internal.time.Timer) TaskArtifactState(org.gradle.api.internal.changedetection.TaskArtifactState) TaskOutputsInternal(org.gradle.api.internal.TaskOutputsInternal)

Example 5 with Timer

use of org.gradle.internal.time.Timer in project gradle by gradle.

the class JarClasspathSnapshotMaker method storeJarSnapshots.

@Override
public void storeJarSnapshots(Iterable<File> classpath) {
    // clients may or may not have already created jar classpath snapshot
    maybeInitialize(classpath);
    Timer clock = Time.startTimer();
    classpathSnapshotStore.put(jarClasspathSnapshot.getData());
    LOG.info("Written jar classpath snapshot for incremental compilation in {}.", clock.getElapsed());
}
Also used : Timer(org.gradle.internal.time.Timer)

Aggregations

Timer (org.gradle.internal.time.Timer)33 File (java.io.File)6 IOException (java.io.IOException)5 Duration (java.time.Duration)3 HashMap (java.util.HashMap)3 ClassSetAnalysisData (org.gradle.api.internal.tasks.compile.incremental.deps.ClassSetAnalysisData)3 LinkedHashMap (java.util.LinkedHashMap)2 GradleException (org.gradle.api.GradleException)2 DefaultResolvedDependency (org.gradle.api.internal.artifacts.DefaultResolvedDependency)2 DependencyGraphNodeResult (org.gradle.api.internal.artifacts.DependencyGraphNodeResult)2 ResolvedConfigurationIdentifier (org.gradle.api.internal.artifacts.ResolvedConfigurationIdentifier)2 RecompilationSpec (org.gradle.api.internal.tasks.compile.incremental.recomp.RecompilationSpec)2 WorkResult (org.gradle.api.tasks.WorkResult)2 OriginMetadata (org.gradle.caching.internal.origin.OriginMetadata)2 ExecutionOutcome (org.gradle.internal.execution.ExecutionOutcome)2 AfterExecutionState (org.gradle.internal.execution.history.AfterExecutionState)2 FileSystemSnapshot (org.gradle.internal.snapshot.FileSystemSnapshot)2 JavaExecHandleBuilder (org.gradle.process.internal.JavaExecHandleBuilder)2 WorkerProcess (org.gradle.process.internal.worker.WorkerProcess)2 ImmutableSortedMap (com.google.common.collect.ImmutableSortedMap)1