Files
scylladb/debug/scylla_row_cache_report.stp
Glauber Costa b4ac2c1d60 debug: add systemtap script to measure interesting latencies during cache updates.
Example output:

Measuring Scylla row cache update times ^C
Total update time, (usec)
value |-------------------------------------------------- count
    2 |                                                   0
    4 |                                                   0
    8 |@@                                                 2
   16 |@@@                                                3
   32 |                                                   0
   64 |                                                   0
  128 |@@@@                                               4
  256 |@@                                                 2
  512 |                                                   0
 1024 |                                                   0

Time spent per partition batch (nsec)
 value |-------------------------------------------------- count
   128 |                                                       0
   256 |                                                       0
   512 |                                                      43
  1024 |                                                       2
  2048 |                                                       2
  4096 |                                                      45
  8192 |                                                     349
 16384 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  61494
 32768 |@@@@@@@@@@@@@@@@@                                  21497
 65536 |                                                       0
131072 |                                                       0

Partitions updated per batch:
value |-------------------------------------------------- count
    0 |                                                      57
    1 |                                                      46
    2 |                                                      76
    4 |                                                     134
    8 |                                                     324
   16 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  82795
   32 |                                                       0
   64 |                                                       0

Total partitions updated: 2485000
Average time spent per partition batch (nsec): 28816
Average time per partition per partition (nsec): 967

Signed-off-by: Glauber Costa <glauber@scylladb.com>
2017-01-26 22:15:16 -05:00

58 lines
1.5 KiB
Plaintext

#!/usr/bin/stap
# usage: stap scylla_row_cache_report.stp <scylla binary>
#
global batch_start_time
global batch_latencies;
global partition_count;
global start_time
global latencies;
probe process(@1).mark("row_cache_update_one_batch_start") {
batch_start_time[tid()] = gettimeofday_ns()
}
probe process(@1).mark("row_cache_update_one_batch_end") {
if (batch_start_time[tid()]) {
lat = (gettimeofday_ns() - batch_start_time[tid()]);
batch_latencies <<< lat;
partition_count <<< $arg1;
delete batch_start_time[tid()]
}
}
probe process(@1).mark("row_cache_update_start") {
start_time[tid()] = gettimeofday_us()
}
probe process(@1).mark("row_cache_update_end") {
if (start_time[tid()]) {
lat = (gettimeofday_us() - start_time[tid()]);
latencies <<< lat;
delete start_time[tid()]
}
}
probe begin {
printf("Measuring Scylla row cache update times ");
}
probe end {
println();
println("Total update time, (usec)");
println(@hist_log(latencies));
println("Time spent per partition batch (nsec)");
print(@hist_log(batch_latencies));
println("Partitions updated per batch:");
println(@hist_log(partition_count));
println("Total partitions updated:");
println(@sum(partition_count));
println("Average time spent per partition batch (nsec)");
println(@avg(batch_latencies));
println("Average time per partition per partition (nsec)");
println(@sum(batch_latencies) / @sum(partition_count));
}