@percy/core 1.30.8-beta.2 → 1.30.9-alpha.0
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/dist/queue.js +8 -0
- package/dist/timing.js +21 -0
- package/package.json +9 -9
package/dist/queue.js
CHANGED
|
@@ -115,6 +115,13 @@ export class Queue {
|
|
|
115
115
|
// return the deferred task promise
|
|
116
116
|
return task.deferred;
|
|
117
117
|
}
|
|
118
|
+
logQueueSize() {
|
|
119
|
+
this.log.debug(`${this.name} queueInfo: ${JSON.stringify({
|
|
120
|
+
queued: _classPrivateFieldGet(_queued, this).size,
|
|
121
|
+
pending: _classPrivateFieldGet(_pending, this).size,
|
|
122
|
+
total: _classPrivateFieldGet(_pending, this).size + _classPrivateFieldGet(_queued, this).size
|
|
123
|
+
})}`);
|
|
124
|
+
}
|
|
118
125
|
// Cancels and aborts a specific item task.
|
|
119
126
|
cancel(item) {
|
|
120
127
|
let task = _assertClassBrand(_Queue_brand, this, _find).call(this, item);
|
|
@@ -243,6 +250,7 @@ export class Queue {
|
|
|
243
250
|
// Repeatedly yields, calling the callback with the position of the task within the queue
|
|
244
251
|
}
|
|
245
252
|
function _dequeue() {
|
|
253
|
+
this.logQueueSize();
|
|
246
254
|
if (!_classPrivateFieldGet(_queued, this).size || this.readyState < 2) return;
|
|
247
255
|
if (_classPrivateFieldGet(_pending, this).size >= this.concurrency) return;
|
|
248
256
|
let [task] = _classPrivateFieldGet(_queued, this);
|
package/dist/timing.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import logger from '@percy/logger';
|
|
2
|
+
export default class TimeIt {
|
|
3
|
+
log = logger('timer');
|
|
4
|
+
// returns a singleton instance
|
|
5
|
+
constructor() {
|
|
6
|
+
let {
|
|
7
|
+
instance = this
|
|
8
|
+
} = this.constructor;
|
|
9
|
+
this.constructor.instance = instance;
|
|
10
|
+
return instance;
|
|
11
|
+
}
|
|
12
|
+
async measure(name, identifier, callback) {
|
|
13
|
+
const startTime = Date.now();
|
|
14
|
+
try {
|
|
15
|
+
return await callback();
|
|
16
|
+
} finally {
|
|
17
|
+
const duration = Date.now() - startTime;
|
|
18
|
+
this.log.info(`${name} - ${identifier} - ${duration / 1000}s`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/core",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.9-alpha.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public",
|
|
12
|
-
"tag": "
|
|
12
|
+
"tag": "alpha"
|
|
13
13
|
},
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=14"
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"test:types": "tsd"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@percy/client": "1.30.
|
|
47
|
-
"@percy/config": "1.30.
|
|
48
|
-
"@percy/dom": "1.30.
|
|
49
|
-
"@percy/logger": "1.30.
|
|
50
|
-
"@percy/monitoring": "1.30.
|
|
51
|
-
"@percy/webdriver-utils": "1.30.
|
|
46
|
+
"@percy/client": "1.30.9-alpha.0",
|
|
47
|
+
"@percy/config": "1.30.9-alpha.0",
|
|
48
|
+
"@percy/dom": "1.30.9-alpha.0",
|
|
49
|
+
"@percy/logger": "1.30.9-alpha.0",
|
|
50
|
+
"@percy/monitoring": "1.30.9-alpha.0",
|
|
51
|
+
"@percy/webdriver-utils": "1.30.9-alpha.0",
|
|
52
52
|
"content-disposition": "^0.5.4",
|
|
53
53
|
"cross-spawn": "^7.0.3",
|
|
54
54
|
"extract-zip": "^2.0.1",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"ws": "^8.17.1",
|
|
62
62
|
"yaml": "^2.4.1"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "16a3166eccd4b7e20606494e9f19f18ec9e4dd67"
|
|
65
65
|
}
|