Rename recordSuccessMetric to reportPlatformFailures

Summary: Change from `recordSuccessMetric` to `reportPlatformFailures`, because the next diff adds `reportPluginFailures` and I want to distinguish the two.

Reviewed By: passy

Differential Revision: D13878380

fbshipit-source-id: 9c6b8bfe1ed2e1a8bbe5aacbec31d24e9aa39171
This commit is contained in:
John Knox
2019-01-31 03:17:13 -08:00
committed by Facebook Github Bot
parent 1101306249
commit 6d50843eed
5 changed files with 13 additions and 13 deletions

View File

@@ -13,7 +13,7 @@ import type {Store} from '../reducers/index.js';
import type BaseDevice from '../devices/BaseDevice';
import type Logger from '../fb-stubs/Logger.js';
import {registerDeviceCallbackOnPlugins} from '../utils/onRegisterDevice.js';
import {recordSuccessMetric} from '../utils/metrics';
import {reportPlatformFailures} from '../utils/metrics';
const adb = require('adbkit-fb');
function createDevice(
@@ -70,7 +70,7 @@ export default (store: Store, logger: Logger) => {
const adbPath = process.env.ANDROID_HOME
? `${process.env.ANDROID_HOME}/platform-tools/adb`
: 'adb';
return recordSuccessMetric(
return reportPlatformFailures(
promisify(child_process.exec)(`${adbPath} start-server`)
.then(result => {
if (result.error) {
@@ -89,7 +89,7 @@ export default (store: Store, logger: Logger) => {
/* In the event that starting adb with the above method fails, fallback
to using adbkit, though its known to be unreliable. */
const unsafeClient = adb.createClient();
return recordSuccessMetric(
return reportPlatformFailures(
promiseRetry(
(retry, number) => {
return unsafeClient
@@ -131,7 +131,7 @@ export default (store: Store, logger: Logger) => {
},
);
recordSuccessMetric(createClient(), 'createADBClient')
reportPlatformFailures(createClient(), 'createADBClient')
.then(client => {
client
.trackDevices()