You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cryptpad/profile.md

23 lines
524 B
Markdown

4 years ago
```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));
});
}
)
```