- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
107 lines
3.6 KiB
Java
107 lines
3.6 KiB
Java
package com.amazonaws.util;
|
|
|
|
import com.amazonaws.logging.Log;
|
|
import com.amazonaws.logging.LogFactory;
|
|
import com.amazonaws.metrics.MetricType;
|
|
import com.ironsource.v8;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
@Deprecated
|
|
/* loaded from: classes.dex */
|
|
public class AWSRequestMetricsFullSupport extends AWSRequestMetrics {
|
|
public final Map eventsBeingProfiled;
|
|
public final Map properties;
|
|
public static final Log LATENCY_LOGGER = LogFactory.getLog("com.amazonaws.latency");
|
|
public static final Object KEY_VALUE_SEPARATOR = v8.i.b;
|
|
public static final Object COMMA_SEPARATOR = ", ";
|
|
|
|
public AWSRequestMetricsFullSupport() {
|
|
super(TimingInfo.startTimingFullSupport());
|
|
this.properties = new HashMap();
|
|
this.eventsBeingProfiled = new HashMap();
|
|
}
|
|
|
|
public void startEvent(String str) {
|
|
this.eventsBeingProfiled.put(str, TimingInfo.startTimingFullSupport(System.nanoTime()));
|
|
}
|
|
|
|
@Override // com.amazonaws.util.AWSRequestMetrics
|
|
public void startEvent(MetricType metricType) {
|
|
startEvent(metricType.name());
|
|
}
|
|
|
|
public void endEvent(String str) {
|
|
TimingInfo timingInfo = (TimingInfo) this.eventsBeingProfiled.get(str);
|
|
if (timingInfo == null) {
|
|
LogFactory.getLog(getClass()).warn("Trying to end an event which was never started: " + str);
|
|
return;
|
|
}
|
|
timingInfo.endTiming();
|
|
this.timingInfo.addSubMeasurement(str, TimingInfo.unmodifiableTimingInfo(timingInfo.getStartTimeNano(), Long.valueOf(timingInfo.getEndTimeNano())));
|
|
}
|
|
|
|
@Override // com.amazonaws.util.AWSRequestMetrics
|
|
public void endEvent(MetricType metricType) {
|
|
endEvent(metricType.name());
|
|
}
|
|
|
|
public void incrementCounter(String str) {
|
|
this.timingInfo.incrementCounter(str);
|
|
}
|
|
|
|
@Override // com.amazonaws.util.AWSRequestMetrics
|
|
public void incrementCounter(MetricType metricType) {
|
|
incrementCounter(metricType.name());
|
|
}
|
|
|
|
public void setCounter(String str, long j) {
|
|
this.timingInfo.setCounter(str, j);
|
|
}
|
|
|
|
@Override // com.amazonaws.util.AWSRequestMetrics
|
|
public void setCounter(MetricType metricType, long j) {
|
|
setCounter(metricType.name(), j);
|
|
}
|
|
|
|
public void addProperty(String str, Object obj) {
|
|
List list = (List) this.properties.get(str);
|
|
if (list == null) {
|
|
list = new ArrayList();
|
|
this.properties.put(str, list);
|
|
}
|
|
list.add(obj);
|
|
}
|
|
|
|
@Override // com.amazonaws.util.AWSRequestMetrics
|
|
public void addProperty(MetricType metricType, Object obj) {
|
|
addProperty(metricType.name(), obj);
|
|
}
|
|
|
|
@Override // com.amazonaws.util.AWSRequestMetrics
|
|
public void log() {
|
|
if (LATENCY_LOGGER.isInfoEnabled()) {
|
|
StringBuilder sb = new StringBuilder();
|
|
for (Map.Entry entry : this.properties.entrySet()) {
|
|
keyValueFormat(entry.getKey(), entry.getValue(), sb);
|
|
}
|
|
for (Map.Entry entry2 : this.timingInfo.getAllCounters().entrySet()) {
|
|
keyValueFormat(entry2.getKey(), entry2.getValue(), sb);
|
|
}
|
|
for (Map.Entry entry3 : this.timingInfo.getSubMeasurementsByName().entrySet()) {
|
|
keyValueFormat(entry3.getKey(), entry3.getValue(), sb);
|
|
}
|
|
LATENCY_LOGGER.info(sb.toString());
|
|
}
|
|
}
|
|
|
|
public final void keyValueFormat(Object obj, Object obj2, StringBuilder sb) {
|
|
sb.append(obj);
|
|
sb.append(KEY_VALUE_SEPARATOR);
|
|
sb.append(obj2);
|
|
sb.append(COMMA_SEPARATOR);
|
|
}
|
|
}
|