TechnologyJune 9, 2022

Apache Pulsar Performance Testing with NoSQLBench

Yabin Meng
Yabin MengDataStax
Apache Pulsar Performance Testing with NoSQLBench
bindings:
 cycle: Identity()
 cyclename: NumberNameToString()
 sample: Normal(100.0D, 10.0D)
 randomish_cycle: HashRangeScaled()
blocks:
 - tags:
phase: main
statements:
- insert-sample: |
insert into hello.world (cycle,name,sample) 
values ({cycle},{cyclename},{sample});
ratio: 4
- read-sample: |
select * from hello.world where cycle={randomish_cycle}
ratio: 1
nb run driver=cql yaml=hello-world.yaml tags=phase:main host=<Cassandra_host_name> cycles=1M
bindings:
… …
params:
… …
blocks:
- name: <statement_block_1>
tags:
phase: … … 
statements:
- name: <statement_name_1>
… … 
- name: <statement_name_2>
… …
nb run driver=pulsar tags=phase:producer cycles=1M web_url=http://localhost:8080 service_url=pulsar://localhost:6650 config=<dir>/config.properties yaml=<dir>/pulsar_nb.yaml
bindings:
drill_id: ToUUID(); ToString(); 
prop1_val: AlphaNumericString(10);
prop2_val: AlphaNumericString(20);
sensor_id: ToUUID(); ToString();
sensor_type: HashedLineToString('sens_type_values.txt')
reading_time: ToDateTime();
reading_value: ToFloat(100);
params:
… … 
blocks: 
- name: producer-block
tags:
phase: producer
statements:
- name: s1
optype: msg-send
msg_key: "{drill_id}"
msg_property: |
{
"drill_prop1": "{prop1_val}",
"drill_prop2": "{prop2_val}"
}
msg_value: |
{
"SensorID": "{sensor_id}",
"SensorType": "{sensor_type}",
"ReadingTime": "{reading_time}",
"ReadingValue": {reading_value}
}
{
"type": "record",
"name": "IotSensor",
"namespace": "TestNS",
"fields" : [
{"name": "SensorID", "type": "string"},
{"name": "SensorType", "type": "string"},
{"name": "ReadingTime", "type": "string"},
{"name": "ReadingValue", "type": "float"}
]
schema.type=avro
schema.definition=file:///path/to/iot-example.avsc
bindings:
tenant: Mod(100); Div(10L); ToString(); Prefix("tnt")
namespace: Mod(10); Div(5L); ToString(); Prefix("ns")
core_topic_name: Mod(5); ToString(); Prefix("t")
params:
topic_uri: "persistent://{tenant}/{namespace}/{core_topic_name}"
Discover more
NoSQLDriversApache Cassandra™
Share

One-stop Data API for Production GenAI

Astra DB gives JavaScript developers a complete data API and out-of-the-box integrations that make it easier to build production RAG apps with high relevancy and low latency.