add some admin UI for profiling the server's workers
parent
8990e8def9
commit
edd46ebdb2
@ -1,22 +0,0 @@
|
||||
```javascript
|
||||
CryptPad_AsyncStore.rpc.send('ADMIN',
|
||||
['GET_WORKER_PROFILES'],
|
||||
(e, _o) => {
|
||||
var o = _o[0];
|
||||
// console.log(o[0])
|
||||
var sorted = Object.keys(o).sort(function (a, b) {
|
||||
if (o[b] - o[a] <= 0) { return -1; }
|
||||
return 1;
|
||||
});
|
||||
var x = {};
|
||||
//console.log(sorted);
|
||||
var total = 0;
|
||||
sorted.forEach(function (k) { total += o[k]; });
|
||||
sorted.forEach(function (k) {
|
||||
console.log("[%s] %ss running time (%s%)", k, o[k], Math.floor((o[k] / total) * 100));
|
||||
});
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue