This is an automated email from the ASF dual-hosted git repository.
zike pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-node.git
The following commit(s) were added to refs/heads/master by this push:
new 1e7ebb8 fix: modify perf_producer to run properly (#318)
1e7ebb8 is described below
commit 1e7ebb8fa8be3b28664c0eab35574f4da2364c49
Author: Yuri Mizushima <[email protected]>
AuthorDate: Sun Apr 16 23:48:54 2023 +0900
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)
---
perf/perf_producer.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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 Pulsar = require('../index.js');
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 @@ const Pulsar = require('../index.js');
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),