Send data stall data to statsd
Short term fix to send the metrics via legacy API. This allows data stall metrics available in internal branch. Bug: 120452078 Test: atest NetworkStackTests and test against statsd Change-Id: I4dd08086f4aee12bbb9478551d8039e9bb6a381e
This commit is contained in:
@@ -20,6 +20,7 @@ import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
import android.net.captiveportal.CaptivePortalProbeResult;
|
||||
import android.util.Log;
|
||||
import android.util.StatsLog;
|
||||
|
||||
import com.android.internal.util.HexDump;
|
||||
import com.android.server.connectivity.nano.DataStallEventProto;
|
||||
@@ -36,6 +37,7 @@ import com.android.server.connectivity.nano.DataStallEventProto;
|
||||
*/
|
||||
public class DataStallStatsUtils {
|
||||
private static final String TAG = DataStallStatsUtils.class.getSimpleName();
|
||||
private static final int DATA_STALL_EVENT_ID = 121;
|
||||
private static final boolean DBG = false;
|
||||
|
||||
private static int probeResultToEnum(@Nullable final CaptivePortalProbeResult result) {
|
||||
@@ -61,6 +63,13 @@ public class DataStallStatsUtils {
|
||||
Log.d(TAG, "write: " + stats + " with result: " + validationResult
|
||||
+ ", dns: " + HexDump.toHexString(stats.mDns));
|
||||
}
|
||||
// TODO(b/124613085): Send to Statsd once the public StatsLog API is ready.
|
||||
// TODO(b/124613085): Update API once the public StatsLog API is ready.
|
||||
StatsLog.write(DATA_STALL_EVENT_ID,
|
||||
stats.mEvaluationType,
|
||||
validationResult,
|
||||
stats.mNetworkType,
|
||||
stats.mWifiInfo,
|
||||
stats.mCellularInfo,
|
||||
stats.mDns);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user