@@ -590,12 +590,16 @@ module Stats_value = struct
590
590
type t = {
591
591
rd_bytes : int64
592
592
; wr_bytes : int64
593
+ ; ds_bytes : int64
593
594
; rd_avg_usecs : int64
594
595
; wr_avg_usecs : int64
596
+ ; ds_avg_usecs : int64
595
597
; io_throughput_read_mb : float
596
598
; io_throughput_write_mb : float
599
+ ; io_throughput_discard_mb : float
597
600
; iops_read : int64
598
601
; iops_write : int64
602
+ ; iops_discard : int64
599
603
; iowait : float
600
604
; inflight : int64
601
605
}
@@ -604,12 +608,16 @@ module Stats_value = struct
604
608
{
605
609
rd_bytes= 0L
606
610
; wr_bytes= 0L
611
+ ; ds_bytes= 0L
607
612
; rd_avg_usecs= 0L
608
613
; wr_avg_usecs= 0L
614
+ ; ds_avg_usecs= 0L
609
615
; io_throughput_read_mb= 0.
610
616
; io_throughput_write_mb= 0.
617
+ ; io_throughput_discard_mb= 0.
611
618
; iops_read= 0L
612
619
; iops_write= 0L
620
+ ; iops_discard= 0L
613
621
; iowait= 0.
614
622
; inflight= 0L
615
623
}
@@ -632,6 +640,7 @@ module Stats_value = struct
632
640
{
633
641
rd_bytes= stats_diff_get 13
634
642
; wr_bytes= stats_diff_get 14
643
+ ; ds_bytes= 0L
635
644
; rd_avg_usecs=
636
645
( if stats_diff_get 0 > 0L then
637
646
Int64. div (stats_diff_get 3 ) (stats_diff_get 0 )
@@ -644,10 +653,13 @@ module Stats_value = struct
644
653
else
645
654
0L
646
655
)
656
+ ; ds_avg_usecs= 0L
647
657
; io_throughput_read_mb= to_float (stats_diff_get 13 ) /. 1048576.
648
658
; io_throughput_write_mb= to_float (stats_diff_get 14 ) /. 1048576.
659
+ ; io_throughput_discard_mb= 0.
649
660
; iops_read= stats_diff_get 0
650
661
; iops_write= stats_diff_get 4
662
+ ; iops_discard= 0L
651
663
; iowait= to_float (stats_diff_get 10 ) /. 1000.
652
664
; inflight= stats_get 8
653
665
}
@@ -686,12 +698,16 @@ module Stats_value = struct
686
698
{
687
699
rd_bytes= Int64. mul (get_stats_read_sectors s3) 512L
688
700
; wr_bytes= Int64. mul (get_stats_write_sectors s3) 512L
701
+ ; ds_bytes= Int64. mul (get_stats_discard_sectors s3) 512L
689
702
; rd_avg_usecs=
690
703
avg_reqs_completed_last_five_secs get_stats_read_reqs_completed
691
704
get_stats_read_total_ticks
692
705
; wr_avg_usecs=
693
706
avg_reqs_completed_last_five_secs get_stats_write_reqs_completed
694
707
get_stats_write_total_ticks
708
+ ; ds_avg_usecs=
709
+ avg_reqs_completed_last_five_secs get_stats_discard_reqs_completed
710
+ get_stats_discard_total_ticks
695
711
; io_throughput_read_mb=
696
712
to_float
697
713
(get_stats_read_sectors s3 -- opt get_stats_read_sectors last_s3)
@@ -702,12 +718,22 @@ module Stats_value = struct
702
718
(get_stats_write_sectors s3 -- opt get_stats_write_sectors last_s3)
703
719
*. 512.
704
720
/. 1048576.
721
+ ; io_throughput_discard_mb=
722
+ to_float
723
+ (get_stats_discard_sectors s3
724
+ -- opt get_stats_discard_sectors last_s3
725
+ )
726
+ *. 512.
727
+ /. 1048576.
705
728
; iops_read=
706
729
get_stats_read_reqs_completed s3
707
730
-- opt get_stats_read_reqs_completed last_s3
708
731
; iops_write=
709
732
get_stats_write_reqs_completed s3
710
733
-- opt get_stats_write_reqs_completed last_s3
734
+ ; iops_discard=
735
+ get_stats_discard_reqs_completed s3
736
+ -- opt get_stats_discard_reqs_completed last_s3
711
737
; iowait=
712
738
to_float
713
739
(get_stats_read_total_ticks s3
@@ -736,12 +762,17 @@ module Stats_value = struct
736
762
; rd_avg_usecs= acc.rd_avg_usecs ++ v.rd_avg_usecs
737
763
; wr_bytes= acc.wr_bytes ++ v.wr_bytes
738
764
; wr_avg_usecs= acc.wr_avg_usecs ++ v.wr_avg_usecs
765
+ ; ds_bytes= acc.ds_bytes ++ v.ds_bytes
766
+ ; ds_avg_usecs= acc.ds_avg_usecs ++ v.ds_avg_usecs
739
767
; io_throughput_read_mb=
740
768
acc.io_throughput_read_mb +. v.io_throughput_read_mb
741
769
; io_throughput_write_mb=
742
770
acc.io_throughput_write_mb +. v.io_throughput_write_mb
771
+ ; io_throughput_discard_mb=
772
+ acc.io_throughput_discard_mb +. v.io_throughput_discard_mb
743
773
; iops_read= acc.iops_read ++ v.iops_read
744
774
; iops_write= acc.iops_write ++ v.iops_write
775
+ ; iops_discard= acc.iops_discard ++ v.iops_discard
745
776
; iowait= acc.iowait +. v.iowait
746
777
; inflight= acc.inflight ++ v.inflight
747
778
}
@@ -763,6 +794,12 @@ module Stats_value = struct
763
794
~value: (Rrd. VT_Int64 value.wr_bytes) ~ty: Rrd. Derive ~units: " B/s"
764
795
~min: 0.0 ()
765
796
)
797
+ ; ( owner
798
+ , ds_make ~name: (key_format " discard" )
799
+ ~description: (" Discards from device " ^ name ^ " , in B/s" )
800
+ ~value: (Rrd. VT_Int64 value.ds_bytes) ~ty: Rrd. Derive ~units: " B/s"
801
+ ~min: 0.0 ()
802
+ )
766
803
; ( owner
767
804
, ds_make
768
805
~name: (key_format " read_latency" )
@@ -778,6 +815,14 @@ module Stats_value = struct
778
815
~value: (Rrd. VT_Int64 value.wr_avg_usecs) ~ty: Rrd. Gauge ~units: " μs"
779
816
~min: 0.0 ()
780
817
)
818
+ ; ( owner
819
+ , ds_make
820
+ ~name: (key_format " discard_latency" )
821
+ ~description:
822
+ (" Discard latency from device " ^ name ^ " , in microseconds" )
823
+ ~value: (Rrd. VT_Int64 value.ds_avg_usecs) ~ty: Rrd. Gauge ~units: " μs"
824
+ ~min: 0.0 ()
825
+ )
781
826
; ( owner
782
827
, ds_make
783
828
~name: (key_format " io_throughput_read" )
@@ -792,6 +837,13 @@ module Stats_value = struct
792
837
~value: (Rrd. VT_Float value.io_throughput_write_mb) ~ty: Rrd. Absolute
793
838
~units: " MiB/s" ~min: 0. ()
794
839
)
840
+ ; ( owner
841
+ , ds_make
842
+ ~name: (key_format " io_throughput_discard" )
843
+ ~description: (" Data discard to the " ^ name ^ " , in MiB/s" )
844
+ ~value: (Rrd. VT_Float value.io_throughput_discard_mb) ~ty: Rrd. Absolute
845
+ ~units: " MiB/s" ~min: 0. ()
846
+ )
795
847
; ( owner
796
848
, ds_make
797
849
~name: (key_format " io_throughput_total" )
@@ -814,10 +866,22 @@ module Stats_value = struct
814
866
~value: (Rrd. VT_Int64 value.iops_write) ~ty: Rrd. Absolute
815
867
~units: " requests/s" ~min: 0. ()
816
868
)
869
+ ; ( owner
870
+ , ds_make
871
+ ~name: (key_format " iops_discard" )
872
+ ~description: " Discard requests per second"
873
+ ~value: (Rrd. VT_Int64 value.iops_discard) ~ty: Rrd. Absolute
874
+ ~units: " requests/s" ~min: 0. ()
875
+ )
817
876
; ( owner
818
877
, ds_make ~name: (key_format " iops_total" )
819
878
~description: " I/O Requests per second"
820
- ~value: (Rrd. VT_Int64 (Int64. add value.iops_read value.iops_write))
879
+ ~value:
880
+ (Rrd. VT_Int64
881
+ (Int64. add value.iops_read
882
+ (Int64. add value.iops_write value.iops_discard)
883
+ )
884
+ )
821
885
~ty: Rrd. Absolute ~units: " requests/s" ~min: 0. ()
822
886
)
823
887
; ( owner
@@ -855,15 +919,19 @@ module Iostats_value = struct
855
919
let s3_usecs =
856
920
get_stats_read_total_ticks s3
857
921
++ get_stats_write_total_ticks s3
922
+ ++ get_stats_discard_total_ticks s3
858
923
-- (opt get_stats_read_total_ticks last_s3
859
924
++ opt get_stats_write_total_ticks last_s3
925
+ ++ opt get_stats_discard_total_ticks last_s3
860
926
)
861
927
in
862
928
let s3_count =
863
929
get_stats_read_reqs_completed s3
864
930
++ get_stats_write_reqs_completed s3
931
+ ++ get_stats_discard_reqs_completed s3
865
932
-- (opt get_stats_read_reqs_completed last_s3
866
933
++ opt get_stats_write_reqs_completed last_s3
934
+ ++ opt get_stats_discard_reqs_completed last_s3
867
935
)
868
936
in
869
937
let s3_latency_average =
@@ -874,8 +942,10 @@ module Iostats_value = struct
874
942
to_float
875
943
(get_stats_read_total_ticks s3
876
944
++ get_stats_write_total_ticks s3
945
+ ++ get_stats_discard_total_ticks s3
877
946
-- (opt get_stats_read_total_ticks last_s3
878
947
++ opt get_stats_write_total_ticks last_s3
948
+ ++ opt get_stats_discard_total_ticks last_s3
879
949
)
880
950
)
881
951
/. 1000_000.0
0 commit comments