Skip to content

Using example perf.c from the cpp driver

Dor Laor edited this page Jul 27, 2015 · 2 revisions

git clone https://github.com/datastax/cpp-driver Build instructions and dependencies: http://datastax.github.io/cpp-driver/topics/building/ Mainly:

mkdir cpp-driver/build
cd cpp-driver/build
cmake ..
make

Build examples/perf: cd examples/perf gcc perf.c -o perf -lcassandra -luv -L../../build -I../../include/

Run: First connect to C* with cqlsh and create the keyspace and table:

 CREATE KEYSPACE examples 
    WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};

 USE examples;

 CREATE TABLE songs (
   id uuid PRIMARY KEY,
   title text,
   album text,
   artist text,
   tags set<text>,
   data blob
 );

Later, run the perf program: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../build ./perf

Clone this wiki locally