diff --git a/gen.h b/gen.h index 614c890..1da8a99 100644 --- a/gen.h +++ b/gen.h @@ -14,26 +14,30 @@ struct data_descriptor { }; struct io_stats_t { - uint64_t n_reads { 0 }; - uint64_t bytes_read { 0 }; - uint64_t n_writes { 0 }; - uint64_t bytes_written { 0 }; - uint64_t n_syncs { 0 }; - uint64_t n_trims { 0 }; + uint64_t n_reads { 0 }; + uint64_t bytes_read { 0 }; + uint64_t n_writes { 0 }; + uint64_t bytes_written { 0 }; + uint64_t n_syncs { 0 }; + uint64_t blocks_trimmed { 0 }; // 1.3.6.1.4.1.2021.11.54: "The number of 'ticks' (typically 1/100s) spent waiting for IO." // https://www.circitor.fr/Mibs/Html/U/UCD-SNMP-MIB.php#ssCpuRawWait - uint64_t io_wait { 0 }; + uint64_t io_wait { 0 }; io_stats_t() { } + uint64_t get_n_iops() const { + return n_reads + n_writes; + } + void reset() { - n_reads = 0; - bytes_read = 0; - n_writes = 0; - bytes_written = 0; - n_syncs = 0; - n_trims = 0; - io_wait = 0; + n_reads = 0; + bytes_read = 0; + n_writes = 0; + bytes_written = 0; + n_syncs = 0; + blocks_trimmed = 0; + io_wait = 0; } }; diff --git a/scsi.cpp b/scsi.cpp index a338461..c74ad29 100644 --- a/scsi.cpp +++ b/scsi.cpp @@ -1079,7 +1079,7 @@ scsi::scsi_rw_result scsi::write(io_stats_t *const is, const uint64_t block_nr, scsi::scsi_rw_result scsi::trim(io_stats_t *const is, const uint64_t block_nr, const uint32_t n_blocks) { if (locking_status() != l_locked_other) { // locked by myself or not locked? - is->n_trims += n_blocks; + is->blocks_trimmed += n_blocks; auto start = get_micros(); if (trim_level == 0) { // 0 = do not trim/unmap diff --git a/server.cpp b/server.cpp index 7044344..a1a6049 100644 --- a/server.cpp +++ b/server.cpp @@ -679,15 +679,15 @@ void server::handler() const io_stats_t *const is = ses->get_io_stats(); DOLOG(logging::ll_info, "server::handler", endpoint, - "PDU/s: %.2f, " + "PDU/s: %.2f, IOPS: %.2f " "send: %.2f kB/s, recv: %.2f kB/s, " "written: %.2f kB/s, read: %.2f kB/s, " - "syncs: %.2f/s, unmaps: %.2f kB/s, " + "syncs: %.2f/s, unmapped: %.2f kB/s, " "load: %.2f%%, errors: %u, mem: %u", - ses->get_pdu_count() / dtook, + ses->get_pdu_count() / dtook, is->get_n_iops() / dtook, ses->get_bytes_tx() / dkB, ses->get_bytes_rx() / dkB, is->bytes_written / dkB, is->bytes_read / dkB, - is->n_syncs / dtook, is->n_trims * block_size / 1024 / 1024 / dtook, + is->n_syncs / dtook, is->blocks_trimmed * block_size / 1024 / 1024 / dtook, busy * 0.1 / took, ses->get_error_count(), get_free_heap_space()); ses->reset_pdu_count();