alexandroid/decompiled/jadx/sources/dagger/producers/monitoring/TimingProducerMonitor.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

45 lines
1.7 KiB
Java

package dagger.producers.monitoring;
import com.google.common.base.Stopwatch;
import com.google.common.base.Ticker;
import java.util.concurrent.TimeUnit;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes9.dex */
final class TimingProducerMonitor extends ProducerMonitor {
private final Stopwatch componentStopwatch;
private final ProducerTimingRecorder recorder;
private long startNanos = -1;
private final Stopwatch stopwatch;
public TimingProducerMonitor(ProducerTimingRecorder producerTimingRecorder, Ticker ticker, Stopwatch stopwatch) {
this.recorder = producerTimingRecorder;
this.stopwatch = Stopwatch.createUnstarted(ticker);
this.componentStopwatch = stopwatch;
}
@Override // dagger.producers.monitoring.ProducerMonitor
public void failed(Throwable th) {
if (!this.stopwatch.isRunning()) {
this.recorder.recordSkip(th);
} else {
this.recorder.recordFailure(th, this.stopwatch.elapsed(TimeUnit.NANOSECONDS));
}
}
@Override // dagger.producers.monitoring.ProducerMonitor
public void methodFinished() {
this.recorder.recordMethod(this.startNanos, this.stopwatch.elapsed(TimeUnit.NANOSECONDS));
}
@Override // dagger.producers.monitoring.ProducerMonitor
public void methodStarting() {
this.startNanos = this.componentStopwatch.elapsed(TimeUnit.NANOSECONDS);
this.stopwatch.start();
}
@Override // dagger.producers.monitoring.ProducerMonitor
public void succeeded(Object obj) {
this.recorder.recordSuccess(this.stopwatch.elapsed(TimeUnit.NANOSECONDS));
}
}