@itwin/perf-tools 4.0.0-dev.7 → 4.0.0-dev.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/Reporter.d.ts +23 -23
- package/lib/cjs/Reporter.js +54 -55
- package/lib/cjs/index.d.ts +1 -1
- package/lib/cjs/index.js +21 -17
- package/package.json +7 -7
package/lib/cjs/Reporter.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/** @beta */
|
|
2
|
-
export declare class Reporter {
|
|
3
|
-
private _entries;
|
|
4
|
-
/**
|
|
5
|
-
* Add entries to performance test report
|
|
6
|
-
* @param testSuite Name of the test suite that is being run
|
|
7
|
-
* @param testName The particular test that is being reported
|
|
8
|
-
* @param valueDescription The description of the value being recorded
|
|
9
|
-
* @param value The actual value of the test
|
|
10
|
-
* @param info A JSON object for additional details
|
|
11
|
-
* @param date Optional: The date time to associate with the given entry. If not defined, `new Date().toISOString()` is used to provide the current date.
|
|
12
|
-
*/
|
|
13
|
-
addEntry(testSuite: string, testName: string, valueDescription: string, value: number, info?: any, date?: string): void;
|
|
14
|
-
/**
|
|
15
|
-
* Clear entries to get a fresh start
|
|
16
|
-
*/
|
|
17
|
-
clearEntries(): void;
|
|
18
|
-
/**
|
|
19
|
-
* Create CSV file with report. Call after all test have run
|
|
20
|
-
* @param fileName Name of the CSV file with or without .csv
|
|
21
|
-
*/
|
|
22
|
-
exportCSV(fileName: string): void;
|
|
23
|
-
}
|
|
1
|
+
/** @beta */
|
|
2
|
+
export declare class Reporter {
|
|
3
|
+
private _entries;
|
|
4
|
+
/**
|
|
5
|
+
* Add entries to performance test report
|
|
6
|
+
* @param testSuite Name of the test suite that is being run
|
|
7
|
+
* @param testName The particular test that is being reported
|
|
8
|
+
* @param valueDescription The description of the value being recorded
|
|
9
|
+
* @param value The actual value of the test
|
|
10
|
+
* @param info A JSON object for additional details
|
|
11
|
+
* @param date Optional: The date time to associate with the given entry. If not defined, `new Date().toISOString()` is used to provide the current date.
|
|
12
|
+
*/
|
|
13
|
+
addEntry(testSuite: string, testName: string, valueDescription: string, value: number, info?: any, date?: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* Clear entries to get a fresh start
|
|
16
|
+
*/
|
|
17
|
+
clearEntries(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Create CSV file with report. Call after all test have run
|
|
20
|
+
* @param fileName Name of the CSV file with or without .csv
|
|
21
|
+
*/
|
|
22
|
+
exportCSV(fileName: string): void;
|
|
23
|
+
}
|
|
24
24
|
//# sourceMappingURL=Reporter.d.ts.map
|
package/lib/cjs/Reporter.js
CHANGED
|
@@ -1,56 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Reporter = void 0;
|
|
4
|
-
/*---------------------------------------------------------------------------------------------
|
|
5
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
-
*--------------------------------------------------------------------------------------------*/
|
|
8
|
-
const fs = require("fs-extra");
|
|
9
|
-
/** @beta */
|
|
10
|
-
class Reporter {
|
|
11
|
-
constructor() {
|
|
12
|
-
this._entries = [];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Add entries to performance test report
|
|
16
|
-
* @param testSuite Name of the test suite that is being run
|
|
17
|
-
* @param testName The particular test that is being reported
|
|
18
|
-
* @param valueDescription The description of the value being recorded
|
|
19
|
-
* @param value The actual value of the test
|
|
20
|
-
* @param info A JSON object for additional details
|
|
21
|
-
* @param date Optional: The date time to associate with the given entry. If not defined, `new Date().toISOString()` is used to provide the current date.
|
|
22
|
-
*/
|
|
23
|
-
addEntry(testSuite, testName, valueDescription, value, info, date) {
|
|
24
|
-
const entry = { testSuite, testName, valueDescription, value, date: date
|
|
25
|
-
this._entries.push(entry);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Clear entries to get a fresh start
|
|
29
|
-
*/
|
|
30
|
-
clearEntries() {
|
|
31
|
-
this._entries = [];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Create CSV file with report. Call after all test have run
|
|
35
|
-
* @param fileName Name of the CSV file with or without .csv
|
|
36
|
-
*/
|
|
37
|
-
exportCSV(fileName) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
info = info
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
exports.Reporter = Reporter;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Reporter = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
const fs = require("fs-extra");
|
|
9
|
+
/** @beta */
|
|
10
|
+
class Reporter {
|
|
11
|
+
constructor() {
|
|
12
|
+
this._entries = [];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Add entries to performance test report
|
|
16
|
+
* @param testSuite Name of the test suite that is being run
|
|
17
|
+
* @param testName The particular test that is being reported
|
|
18
|
+
* @param valueDescription The description of the value being recorded
|
|
19
|
+
* @param value The actual value of the test
|
|
20
|
+
* @param info A JSON object for additional details
|
|
21
|
+
* @param date Optional: The date time to associate with the given entry. If not defined, `new Date().toISOString()` is used to provide the current date.
|
|
22
|
+
*/
|
|
23
|
+
addEntry(testSuite, testName, valueDescription, value, info, date) {
|
|
24
|
+
const entry = { testSuite, testName, valueDescription, value, date: date ?? new Date().toISOString(), info };
|
|
25
|
+
this._entries.push(entry);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Clear entries to get a fresh start
|
|
29
|
+
*/
|
|
30
|
+
clearEntries() {
|
|
31
|
+
this._entries = [];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create CSV file with report. Call after all test have run
|
|
35
|
+
* @param fileName Name of the CSV file with or without .csv
|
|
36
|
+
*/
|
|
37
|
+
exportCSV(fileName) {
|
|
38
|
+
let finalReport = "";
|
|
39
|
+
if (!fileName.endsWith(".csv")) {
|
|
40
|
+
fileName = `${fileName}.csv`;
|
|
41
|
+
}
|
|
42
|
+
if (!fs.existsSync(fileName)) {
|
|
43
|
+
finalReport += "TestSuite,TestName,ValueDescription,Value,Date,Info\n";
|
|
44
|
+
}
|
|
45
|
+
for (const entry of this._entries) {
|
|
46
|
+
let info = JSON.stringify(entry.info) ?? "";
|
|
47
|
+
info = info.replace(/\"/g, '""');
|
|
48
|
+
info = `"${info}"`;
|
|
49
|
+
finalReport += `${entry.testSuite},${entry.testName},${entry.valueDescription},${entry.value},${entry.date},${info}\n`;
|
|
50
|
+
}
|
|
51
|
+
fs.appendFileSync(fileName, finalReport);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.Reporter = Reporter;
|
|
56
55
|
//# sourceMappingURL=Reporter.js.map
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./Reporter";
|
|
1
|
+
export * from "./Reporter";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/*---------------------------------------------------------------------------------------------
|
|
18
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
19
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
20
|
+
*--------------------------------------------------------------------------------------------*/
|
|
21
|
+
__exportStar(require("./Reporter"), exports);
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/perf-tools",
|
|
3
|
-
"version": "4.0.0-dev.
|
|
3
|
+
"version": "4.0.0-dev.72",
|
|
4
4
|
"description": "Tools for collecting and reporting performance data",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"typings": "lib/cjs/index",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/iTwin/itwinjs-core
|
|
10
|
+
"url": "https://github.com/iTwin/itwinjs-core.git",
|
|
11
|
+
"directory": "tools/perf-tools"
|
|
11
12
|
},
|
|
12
13
|
"keywords": [
|
|
13
14
|
"Bentley",
|
|
@@ -23,12 +24,12 @@
|
|
|
23
24
|
"fs-extra": "^8.1.0"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@itwin/build-tools": "4.0.0-dev.
|
|
27
|
-
"@itwin/eslint-plugin": "4.0.0-dev.
|
|
27
|
+
"@itwin/build-tools": "4.0.0-dev.72",
|
|
28
|
+
"@itwin/eslint-plugin": "^4.0.0-dev.33",
|
|
28
29
|
"@types/fs-extra": "^4.0.7",
|
|
29
|
-
"eslint": "^
|
|
30
|
+
"eslint": "^8.36.0",
|
|
30
31
|
"rimraf": "^3.0.2",
|
|
31
|
-
"typescript": "~
|
|
32
|
+
"typescript": "~5.0.2"
|
|
32
33
|
},
|
|
33
34
|
"eslintConfig": {
|
|
34
35
|
"plugins": [
|
|
@@ -38,7 +39,6 @@
|
|
|
38
39
|
},
|
|
39
40
|
"scripts": {
|
|
40
41
|
"build": "npm run -s build:cjs",
|
|
41
|
-
"build:ci": "npm run -s build",
|
|
42
42
|
"build:cjs": "tsc 1>&2 --outDir lib/cjs",
|
|
43
43
|
"clean": "rimraf lib .rush/temp/package-deps*.json",
|
|
44
44
|
"lint": "eslint -f visualstudio \"./reporter/**/*.ts\" 1>&2",
|