We can add a couple of metrics related to flushes and compactions:
- flush memstore and output file size histogram: This will allow seeing whether we are flushing too early due to memory pressure, too many regions, etc. Tracking flush memstore size vs output file size is useful in understanding the block encoding compression benefits.
- total flushed output bytes: This will allow to monitor the IO / throughput from flushers. You can use this to set num flushers, flush throttle, etc.
- smallCompactionQueueLength / large...: This is tracked, but not emitted anymore due to a bug.
- compaction time histogram: similar to flush time histogram, how long compactions are taking.
- compaction input num files / output num files histogram: How many files on average we are compacting. Stripe compaction / date tiered compaction can use the num output files metric.
- compaction input / output data sizes histogram: How much data on average we are compacting.
- compaction input / output total bytes: Measure compaction IO / throughput. measure write amplification, enables to set compaction throttle.
- Breakdown for above for major compactions