Add metrics
Summary: Add some usage and failure rate stats to the PluginInstaller. Small typo fix and added a helper to the metrics utils to make simple usage tracking a little more intuitive. Reviewed By: jknoxville Differential Revision: D17760511 fbshipit-source-id: 957031d428f3124435925415619b1555a0c2dc2a
This commit is contained in:
committed by
Facebook Github Bot
parent
a3f7e6aa59
commit
ff76b17a5b
@@ -108,6 +108,19 @@ export function tryCatchReportPlatformFailures<T>(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Track usage of a feature.
|
||||
* @param action Unique name for the action performed. E.g. captureScreenshot
|
||||
* @param data Optional additional metadata attached to the event.
|
||||
*/
|
||||
export function reportUsage(
|
||||
action: string,
|
||||
data?: {[key: string]: string},
|
||||
plugin?: string,
|
||||
) {
|
||||
getInstance().track('usage', action, data, plugin);
|
||||
}
|
||||
|
||||
function logPlatformSuccessRate(name: string, result: Result) {
|
||||
if (result.kind === 'success') {
|
||||
getInstance().track('success-rate', name, {value: 1});
|
||||
|
||||
Reference in New Issue
Block a user