1/**
2 * The Macrobenchmark Context.
3 */
4export type BenchmarkContext = {
5  "build": {
6    'brand': string,
7    'device': string,
8    'fingerprint': string,
9    'model': string,
10    'version': {
11      "sdk": number
12    }
13  },
14  "cpuCoreCount": number,
15  "cpuLocked": boolean,
16  "cpuMaxFreqHz": number,
17  "memTotalBytes": number,
18  "sustainedPerformanceModeEnabled": boolean
19};
20
21interface IMetrics {
22  'minimum': number;
23  'maximum': number;
24  'median': number;
25};
26export interface Standard extends IMetrics {
27  'runs': Array<number>;
28};
29export interface Sampled extends IMetrics {
30  'runs': Array<number[]>;
31};
32
33export type Metrics = Standard | Sampled;
34export type MetricsCollection<T extends Metrics = Metrics> = { readonly [key: string]: T; }
35
36/**
37 * The Benchmark.
38 */
39export type Benchmark = {
40  'name': string;
41  'params': object;
42  'className': string;
43  'totalRunTimeNs': number;
44  'sampledMetrics'?: MetricsCollection<Sampled>;
45  'metrics'?: MetricsCollection<Standard>;
46  'warmupIterations': number;
47  'repeatIterations': number;
48  'thermalThrottleSleepSeconds': number;
49};
50
51/**
52 * The Benchmarks result.
53 */
54export type Benchmarks = {
55  'context': BenchmarkContext
56  'benchmarks': Array<Benchmark>
57};
58