fix: modify perf_producer to run properly (#318)
### Motivation
I noticed the `perf_producer` is not working properly as follows. I want to fix it.
```
% node perf/perf_producer.js -u pulsar://localhost:6650 -t persistent://public/default/my-topic -i 1000
----------------------
size: 1024
url: pulsar://localhost:6650
topic: persistent://public/default/my-topic
iteration: 1000
messages: 1000
----------------------
/Users/equanz/src/pulsar-client-node/perf/perf_producer.js:107
histogram.getMean(),
^
TypeError: histogram.getMean is not a function
at /Users/equanz/src/pulsar-client-node/perf/perf_producer.js:107:17
Node.js v18.6.0
```
### Modifications
* Modify the `perf_producer` to address [migration procedures](https://github.com/HdrHistogram/HdrHistogramJS/tree/v2.0.1#migrating-from-v1-to-v2)diff --git a/perf/perf_producer.js b/perf/perf_producer.js
index fbe12f1..4638b59 100644
--- a/perf/perf_producer.js
+++ b/perf/perf_producer.js
@@ -77,7 +77,7 @@
const numOfMessages = commander.messages;
for (let i = 0; i < commander.iteration; i += 1) {
const histogram = hdr.build({
- bitBucketSize: 0,
+ bitBucketSize: 64,
highestTrackableValue: 120000 * 1000,
numberOfSignificantValueDigits: 5,
});
@@ -104,7 +104,7 @@
console.log('Throughput produced: %f msg/s --- %f Mbit/s --- Latency: mean: %f ms - med: %f - 95pct: %f - 99pct: %f - 99.9pct: %f - 99.99pct: %f - Max: %f',
rate.toFixed(3),
throuhputMbit.toFixed(3),
- histogram.getMean(),
+ histogram.mean,
histogram.getValueAtPercentile(50),
histogram.getValueAtPercentile(95),
histogram.getValueAtPercentile(99),