Commit d17d93a
authored
Dix/metrics api (#56)
* refactor: streamline MetricsCell and enhance documentation
Removed the `new` method from `MetricsCell` to simplify its usage, as it is now directly initialized with a `Cell<u64>`. Updated the documentation for `metrics_impl.rs` to provide clearer insights into the metrics structures and their visibility, emphasizing the encapsulation of internal metrics management. Added concise summaries for each metrics struct to improve clarity and usability.
* feat: add serde support for cache metrics serialization
Introduced optional `serde` dependency for cache metrics snapshots, enabling serialization and deserialization of metrics structures. Enhanced documentation for `CacheMetricsSnapshot` and other metrics structs to clarify their purpose and usage, including examples demonstrating serialization capabilities. This change improves usability and facilitates integration with external systems requiring metrics data in a serialized format.
* docs: enhance metrics traits documentation with examples and clarity
Added example usage for `CoreMetricsRecorder` and its related traits, improving the documentation for cache metrics. Clarified the purpose of each metrics trait and their relationships, including references to mutable and read-only counterparts. This change enhances usability and understanding of the metrics system within the cache library.
* fix: update frequency buckets iteration method for accuracy
Replaced the `iter_entries` method with `iter` in the frequency buckets property tests to ensure accurate minimum frequency calculations. This change aligns with recent updates to the `FrequencyBuckets` module, enhancing consistency and correctness in the test implementation.
* docs: clarify MetricsCell usage in metrics_impl.rs
Updated the documentation for `MetricsCell` in `metrics_impl.rs` to include a direct reference to its location within the module. This change enhances clarity regarding the internal structure and visibility of the metrics management system, ensuring users understand the encapsulation of internal metrics management.
* docs: refine MetricsCell documentation in metrics_impl.rs
Updated the documentation for `MetricsCell` in `metrics_impl.rs` to remove redundant phrasing, enhancing clarity regarding its usage and visibility within the module. This change aims to improve understanding of the internal metrics management system.1 parent 3b46721 commit d17d93a
8 files changed
Lines changed: 188 additions & 135 deletions
File tree
- fuzz/fuzz_targets
- src
- metrics
- policy
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 12 | | |
18 | 13 | | |
19 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
1 | 14 | | |
2 | 15 | | |
3 | 16 | | |
| |||
7 | 20 | | |
8 | 21 | | |
9 | 22 | | |
10 | | - | |
| 23 | + | |
| 24 | + | |
11 | 25 | | |
12 | 26 | | |
13 | 27 | | |
| |||
29 | 43 | | |
30 | 44 | | |
31 | 45 | | |
32 | | - | |
| 46 | + | |
| 47 | + | |
33 | 48 | | |
34 | 49 | | |
35 | 50 | | |
| |||
50 | 65 | | |
51 | 66 | | |
52 | 67 | | |
53 | | - | |
| 68 | + | |
| 69 | + | |
54 | 70 | | |
55 | 71 | | |
56 | 72 | | |
| |||
72 | 88 | | |
73 | 89 | | |
74 | 90 | | |
75 | | - | |
| 91 | + | |
| 92 | + | |
76 | 93 | | |
77 | 94 | | |
78 | 95 | | |
| |||
102 | 119 | | |
103 | 120 | | |
104 | 121 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | 122 | | |
131 | 123 | | |
132 | 124 | | |
| |||
185 | 177 | | |
186 | 178 | | |
187 | 179 | | |
| 180 | + | |
188 | 181 | | |
189 | 182 | | |
190 | 183 | | |
| |||
279 | 272 | | |
280 | 273 | | |
281 | 274 | | |
| 275 | + | |
282 | 276 | | |
283 | 277 | | |
284 | 278 | | |
| |||
377 | 371 | | |
378 | 372 | | |
379 | 373 | | |
| 374 | + | |
380 | 375 | | |
381 | 376 | | |
382 | 377 | | |
| |||
505 | 500 | | |
506 | 501 | | |
507 | 502 | | |
| 503 | + | |
508 | 504 | | |
509 | 505 | | |
510 | 506 | | |
| |||
535 | 531 | | |
536 | 532 | | |
537 | 533 | | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
| 534 | + | |
| 535 | + | |
543 | 536 | | |
544 | 537 | | |
545 | 538 | | |
| |||
578 | 571 | | |
579 | 572 | | |
580 | 573 | | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
| 574 | + | |
| 575 | + | |
586 | 576 | | |
587 | 577 | | |
588 | 578 | | |
| |||
652 | 642 | | |
653 | 643 | | |
654 | 644 | | |
655 | | - | |
656 | | - | |
657 | | - | |
658 | | - | |
659 | | - | |
| 645 | + | |
| 646 | + | |
660 | 647 | | |
661 | 648 | | |
662 | 649 | | |
| |||
722 | 709 | | |
723 | 710 | | |
724 | 711 | | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
| 712 | + | |
| 713 | + | |
730 | 714 | | |
731 | 715 | | |
732 | 716 | | |
| |||
776 | 760 | | |
777 | 761 | | |
778 | 762 | | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
| 763 | + | |
| 764 | + | |
784 | 765 | | |
785 | 766 | | |
786 | 767 | | |
| |||
838 | 819 | | |
839 | 820 | | |
840 | 821 | | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | | - | |
845 | | - | |
| 822 | + | |
| 823 | + | |
846 | 824 | | |
847 | 825 | | |
848 | 826 | | |
| |||
908 | 886 | | |
909 | 887 | | |
910 | 888 | | |
| 889 | + | |
911 | 890 | | |
912 | 891 | | |
913 | 892 | | |
| |||
923 | 902 | | |
924 | 903 | | |
925 | 904 | | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | | - | |
930 | | - | |
| 905 | + | |
| 906 | + | |
931 | 907 | | |
932 | 908 | | |
933 | 909 | | |
| |||
977 | 953 | | |
978 | 954 | | |
979 | 955 | | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
| 956 | + | |
| 957 | + | |
985 | 958 | | |
986 | 959 | | |
987 | 960 | | |
| |||
1031 | 1004 | | |
1032 | 1005 | | |
1033 | 1006 | | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
| 1007 | + | |
| 1008 | + | |
1039 | 1009 | | |
1040 | 1010 | | |
1041 | 1011 | | |
| |||
1085 | 1055 | | |
1086 | 1056 | | |
1087 | 1057 | | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
| 1058 | + | |
| 1059 | + | |
1093 | 1060 | | |
1094 | 1061 | | |
1095 | 1062 | | |
| |||
0 commit comments