forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscylla_row_cache_report.stp
58 lines (48 loc) · 1.51 KB
/
scylla_row_cache_report.stp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/stap
# usage: stap -c <cmd> scylla_row_cache_report.stp
# or: stap -x <pid> scylla_row_cache_report.stp
#
global batch_start_time
global batch_latencies;
global partition_count;
global start_time
global latencies;
probe process.mark("row_cache_update_one_batch_start") {
batch_start_time[tid()] = gettimeofday_ns()
}
probe process.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.mark("row_cache_update_start") {
start_time[tid()] = gettimeofday_us()
}
probe process.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 (nsec)");
println(@sum(batch_latencies) / @sum(partition_count));
}