Class EnergyDoctorTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.patbaumgartner.greener.gradle.EnergyDoctorTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@DisableCachingByDefault(because="Environment probe is read-only and must run every time") public abstract class EnergyDoctorTask extends org.gradle.api.DefaultTask
Runs preflight environment checks for the greener-spring-boot Gradle plugin. Verifies OS, RAPL access, msr module, Joular Core binary, Joular Code Java agent, workload tool on PATH, and Spring Boot jar auto-detection. Fails fast and tells you exactly what to fix before running an actual measurement.
 ./gradlew energyDoctor
 
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.provider.Property<Boolean>
    When true (default) the build fails on any FAIL-level check.
    abstract org.gradle.api.file.RegularFileProperty
    Optional Joular Code Java agent path.
    abstract org.gradle.api.file.RegularFileProperty
    Optional Joular Core binary path.
    abstract org.gradle.api.provider.Property<File>
    Project directory used for jar auto-detection.
    abstract org.gradle.api.provider.Property<String>
    Optional first token of the workload command (e.g.
    void
    Runs the doctor checks and prints them via the Gradle logger.

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • EnergyDoctorTask

      public EnergyDoctorTask()
  • Method Details

    • getJoularCoreBinaryPath

      @Internal public abstract org.gradle.api.file.RegularFileProperty getJoularCoreBinaryPath()
      Optional Joular Core binary path. Marked Internal because the doctor deliberately tolerates a missing file (that's part of the diagnostic).
      Returns:
      the property
    • getJoularCodeJavaAgentPath

      @Internal public abstract org.gradle.api.file.RegularFileProperty getJoularCodeJavaAgentPath()
      Optional Joular Code Java agent path. Marked Internal for the same reason as getJoularCoreBinaryPath().
      Returns:
      the property
    • getWorkloadCommand

      @Optional @Input public abstract org.gradle.api.provider.Property<String> getWorkloadCommand()
      Optional first token of the workload command (e.g. oha).
      Returns:
      the property
    • getFailOnError

      @Input public abstract org.gradle.api.provider.Property<Boolean> getFailOnError()
      When true (default) the build fails on any FAIL-level check.
      Returns:
      the property
    • getProjectDir

      @Internal public abstract org.gradle.api.provider.Property<File> getProjectDir()
      Project directory used for jar auto-detection.
      Returns:
      the property
    • runDoctor

      public void runDoctor()
      Runs the doctor checks and prints them via the Gradle logger.