Skip to content

Commit

Permalink
Cache DefaultAgentStatus.isAgentInstrumentationEnabled()
Browse files Browse the repository at this point in the history
  • Loading branch information
asodja committed Dec 6, 2023
1 parent a8336a1 commit 81eb98d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@

package org.gradle.internal.agents;

import org.gradle.internal.lazy.Lazy;

class DefaultAgentStatus implements AgentStatus {

private static final Lazy<Boolean> IS_AGENT_INSTRUMENTATION_ENABLED = Lazy.locking().of(AgentControl::isInstrumentationAgentApplied);

@Override
public boolean isAgentInstrumentationEnabled() {
return AgentControl.isInstrumentationAgentApplied();
return IS_AGENT_INSTRUMENTATION_ENABLED.get();
}
}

0 comments on commit 81eb98d

Please sign in to comment.