How to use hdr-histogram-js - 5 common examples

To help you get started, we’ve selected a few hdr-histogram-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mcollina / autocannon / lib / run.js View on Github external
bitBucketSize: 64,
    autoResize: true,
    lowestDiscernibleValue: 1,
    highestTrackableValue: 10000,
    numberOfSignificantValueDigits: 5
  })

  const requests = hdr.build({
    bitBucketSize: 64,
    autoResize: true,
    lowestDiscernibleValue: 1,
    highestTrackableValue: 1000000,
    numberOfSignificantValueDigits: 3
  })

  const throughput = hdr.build({
    bitBucketSize: 64,
    autoResize: true,
    lowestDiscernibleValue: 1,
    highestTrackableValue: 100000000000,
    numberOfSignificantValueDigits: 3
  })

  const statusCodes = [
    0, // 1xx
    0, // 2xx
    0, // 3xx
    0, // 4xx
    0 // 5xx
  ]

  if (opts && opts.form) {
github apache / pulsar-client-node / perf / perf_producer.js View on Github external
const clientConfig = {
    serviceUrl: commander.url,
  };
  const client = new Pulsar.Client(clientConfig);

  // Create a producer
  const producerConfig = {
    topic: commander.topic,
  };
  const producer = await client.createProducer(producerConfig);

  const sizeOfMessage = commander.size;
  const message = Buffer.alloc(sizeOfMessage, 1);
  const numOfMessages = commander.messages;
  for (let i = 0; i < commander.iteration; i += 1) {
    const histogram = hdr.build({
      bitBucketSize: 0,
      highestTrackableValue: 120000 * 1000,
      numberOfSignificantValueDigits: 5,
    });

    // measure
    await delay(1000);
    const startMeasureTimeMilliSeconds = performance.now();
    for (let mi = 0; mi < numOfMessages; mi += 1) {
      const startSendTimeMilliSeconds = performance.now();
      producer.send({
        data: message,
      }).then(() => {
        // add latency
        histogram.recordValue((performance.now() - startSendTimeMilliSeconds));
      });
github mcollina / autocannon / lib / run.js View on Github external
tracker = tracker || new EE()

  if (!cbPassedIn && !opts.forever) {
    const promise = new Promise((resolve, reject) => {
      _run(opts, function (err, results) {
        if (err) return reject(err)
        resolve(results)
      }, tracker)
    })
    tracker.then = promise.then.bind(promise)
    tracker.catch = promise.catch.bind(promise)
    return tracker
  }

  const latencies = hdr.build({
    bitBucketSize: 64,
    autoResize: true,
    lowestDiscernibleValue: 1,
    highestTrackableValue: 10000,
    numberOfSignificantValueDigits: 5
  })

  const requests = hdr.build({
    bitBucketSize: 64,
    autoResize: true,
    lowestDiscernibleValue: 1,
    highestTrackableValue: 1000000,
    numberOfSignificantValueDigits: 3
  })

  const throughput = hdr.build({
github mcollina / autocannon / lib / run.js View on Github external
}, tracker)
    })
    tracker.then = promise.then.bind(promise)
    tracker.catch = promise.catch.bind(promise)
    return tracker
  }

  const latencies = hdr.build({
    bitBucketSize: 64,
    autoResize: true,
    lowestDiscernibleValue: 1,
    highestTrackableValue: 10000,
    numberOfSignificantValueDigits: 5
  })

  const requests = hdr.build({
    bitBucketSize: 64,
    autoResize: true,
    lowestDiscernibleValue: 1,
    highestTrackableValue: 1000000,
    numberOfSignificantValueDigits: 3
  })

  const throughput = hdr.build({
    bitBucketSize: 64,
    autoResize: true,
    lowestDiscernibleValue: 1,
    highestTrackableValue: 100000000000,
    numberOfSignificantValueDigits: 3
  })

  const statusCodes = [
github census-instrumentation / opencensus-node / packages / opencensus-core / src / stats / model / metrics / histogram.ts View on Github external
constructor(boundaries: HistogramBoundaries, alogger?: Logger) {
    this.logger = alogger || logger.logger();
    this.boundaries = boundaries;
    this.localHistogram = BuildHistogram({
      bitBucketSize: 64,
      autoResize: true,
      lowestDiscernibleValue: 1,
      highestTrackableValue: boundaries ? boundaries.range.max : 10000,
      numberOfSignificantValueDigits: 3
    });
    this.localHistogram.startTimeStampMsec = Date.now();
  }

hdr-histogram-js

TypeScript port of HdrHistogram

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis

Popular hdr-histogram-js functions