Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/apollo-server-core/dist/plugin/usageReporting/ drwxr-xr-x | |
| Viewing file: Select action/file-type: "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DurationHistogram = void 0;
class DurationHistogram {
constructor(options) {
const initSize = (options === null || options === void 0 ? void 0 : options.initSize) || 74;
const buckets = options === null || options === void 0 ? void 0 : options.buckets;
const arrayInitSize = Math.max((buckets === null || buckets === void 0 ? void 0 : buckets.length) || 0, initSize);
this.buckets = Array(arrayInitSize).fill(0);
if (buckets) {
buckets.forEach((val, index) => (this.buckets[index] = val));
}
}
toArray() {
let bufferedZeroes = 0;
const outputArray = [];
for (const value of this.buckets) {
if (value === 0) {
bufferedZeroes++;
}
else {
if (bufferedZeroes === 1) {
outputArray.push(0);
}
else if (bufferedZeroes !== 0) {
outputArray.push(-bufferedZeroes);
}
outputArray.push(value);
bufferedZeroes = 0;
}
}
return outputArray;
}
static durationToBucket(durationNs) {
const log = Math.log(durationNs / 1000.0);
const unboundedBucket = Math.ceil(log / DurationHistogram.EXPONENT_LOG);
return unboundedBucket <= 0 || Number.isNaN(unboundedBucket)
? 0
: unboundedBucket >= DurationHistogram.BUCKET_COUNT
? DurationHistogram.BUCKET_COUNT - 1
: unboundedBucket;
}
incrementDuration(durationNs) {
this.incrementBucket(DurationHistogram.durationToBucket(durationNs));
return this;
}
incrementBucket(bucket, value = 1) {
if (bucket >= DurationHistogram.BUCKET_COUNT) {
throw Error('Bucket is out of bounds of the buckets array');
}
if (bucket >= this.buckets.length) {
const oldLength = this.buckets.length;
this.buckets.length = bucket + 1;
this.buckets.fill(0, oldLength);
}
this.buckets[bucket] += value;
}
combine(otherHistogram) {
for (let i = 0; i < otherHistogram.buckets.length; i++) {
this.incrementBucket(i, otherHistogram.buckets[i]);
}
}
}
exports.DurationHistogram = DurationHistogram;
DurationHistogram.BUCKET_COUNT = 384;
DurationHistogram.EXPONENT_LOG = Math.log(1.1);
//# sourceMappingURL=durationHistogram.js.map |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0046 ]-- |