### Stress test for stress_zipkin2.span table
###
### Stress testing is done using the `cassandra-stress` tool
###
### For example
###  cqlsh -f zipkin2-test-schema.cql
###  cassandra-stress  user profile=span-stress.yaml ops\(insert=1\) no-warmup duration=1m  -rate threads=4 throttle=50/s
###
### after a benchmark has been run with only writes, a mixed read-write benchmark can be run with
###  cassandra-stress  user profile=span-stress.yaml ops\(insert=1,by_trace=1,by_trace_ts_id=1,by_annotation=1\)  duration=1m  -rate threads=4 throttle=50/s

# Keyspace Name
keyspace: stress_zipkin2

# Table name
table: span


### Column Distribution Specifications ###
#

columnspec:
  - name: trace_id
    size: fixed(32)
    population: uniform(1..10k)

  - name: ts_uuid
    population: uniform(1..10k)

  - name: id
    size: fixed(32)
    population: uniform(1..10k)

  - name: ts
    size: fixed(12)
    population: uniform(1..10k)

  - name: span
    size: uniform(5..20)
    population: uniform(1..100)

  - name: parent_id
    size: uniform(5..20)
    population: uniform(1..100)

  - name: duration
    size: fixed(12)
    population: uniform(1..10k)

  - name: l_service
    size: uniform(5..20)
    population: uniform(1..100)

  - name: annotation_query
    size: gaussian(50..500)
    population: uniform(1..1k)



### Batch Ratio Distribution Specifications ###

insert:
  partitions: fixed(1)            # 1 partition key at a time inserts to model a message being generated
  select:  fixed(1)/1000
  batchtype: UNLOGGED             # Unlogged batches


#
# A set of basic queries
#
queries:
   by_trace:
    cql: SELECT * FROM span WHERE trace_id = ?
    fields: samerow
   by_trace_ts_id:
    cql: SELECT * FROM span WHERE trace_id = ? AND ts_uuid = ? AND id = ?
    fields: samerow
   by_annotation:
    cql: SELECT trace_id, ts, id FROM span WHERE l_service = ? AND annotation_query LIKE ? ALLOW FILTERING
    fields: samerow
