Added metrics argument to headless inorder to export metrics

Summary:
This diff makes headless flipper accept `metrics` argument. Once this is passed. The headless flipper will terminate to export the metrics of the plugins, the type of the export looks like the following.

```
export type MetricType = {[metricName: string]: number};
type MetricPluginType = {[pluginID: string]: MetricType};
export type ExportMetricType = {[clientID: string]: MetricPluginType};

```

This diff, uses the store to export the metrics. I will modify the logic to accept the data which gets exported through `exportData`

Reviewed By: passy

Differential Revision: D14933499

fbshipit-source-id: dade5b7bc59ea4beb6d16c5ef471737e8597358a
This commit is contained in:
Pritesh Nandgaonkar
2019-04-25 07:34:02 -07:00
committed by Facebook Github Bot
parent 7bbb8c10c4
commit afd729deb6
5 changed files with 101 additions and 11 deletions

View File

@@ -83,6 +83,9 @@ export class FlipperBasePlugin<
method: string,
data: Object,
) => $Shape<PersistedState>;
static exportMetrics: ?(
persistedState: PersistedState,
) => Promise<Map<string, number | string>>;
static exportPersistedState: ?(
callClient: (string, ?Object) => Promise<Object>,
persistedState: ?PersistedState,