UNPKG

2.09 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt The complete set of authors may be found
6 * at http://polymer.github.io/AUTHORS.txt The complete set of contributors may
7 * be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
8 * Google as part of the polymer project is also subject to an additional IP
9 * rights grant found at http://polymer.github.io/PATENTS.txt
10 */
11import { BrowserConfig } from './browser';
12import { ResultStatsWithDifferences } from './stats';
13import { BenchmarkResult, Measurement } from './types';
14export interface JsonOutputFile {
15 benchmarks: Benchmark[];
16}
17interface BrowserConfigResult extends BrowserConfig {
18 userAgent?: string;
19}
20interface Benchmark {
21 name: string;
22 bytesSent: number;
23 version?: string;
24 measurement: Measurement;
25 browser?: BrowserConfigResult;
26 mean: ConfidenceInterval;
27 differences: Array<Difference | null>;
28 samples: number[];
29}
30interface Difference {
31 absolute: ConfidenceInterval;
32 percentChange: ConfidenceInterval;
33}
34interface ConfidenceInterval {
35 low: number;
36 high: number;
37}
38export declare function jsonOutput(results: ResultStatsWithDifferences[]): JsonOutputFile;
39export interface LegacyJsonOutputFormat {
40 benchmarks: BenchmarkResult[];
41 datetime: string;
42 system: {
43 cpu: {
44 manufacturer: string;
45 model: string;
46 family: string;
47 speed: string;
48 cores: number;
49 };
50 load: {
51 average: number;
52 current: number;
53 };
54 battery: {
55 hasBattery: boolean;
56 connected: boolean;
57 };
58 memory: {
59 total: number;
60 free: number;
61 used: number;
62 active: number;
63 available: number;
64 };
65 };
66}
67export declare function legacyJsonOutput(results: BenchmarkResult[]): Promise<LegacyJsonOutputFormat>;
68export {};