@@ -668,7 +668,7 @@ impl AdminApp {
668668 } ) {
669669 Ok ( result) => {
670670 let body = format ! (
671- r#"{{"status":"ok","matched":{},"purged":{},"purged_ratio_per_mille":{},"truncated":{},"repeat_required":{},"limit":{},"vhost":"{}","route":{},"scope":"{}","memory_matched":{},"memory_purged":{},"memory_truncated":{},"disk_matched":{},"disk_purged":{},"disk_truncated":{}}}"# ,
671+ r#"{{"status":"ok","matched":{},"purged":{},"purged_ratio_per_mille":{},"truncated":{},"repeat_required":{},"limit":{},"vhost":"{}","route":{},"scope":"{}","memory_matched":{},"memory_purged":{},"memory_purged_ratio_per_mille":{}," memory_truncated":{},"disk_matched":{},"disk_purged":{},"disk_purged_ratio_per_mille ":{},"disk_truncated":{}}}"# ,
672672 result. matched( ) ,
673673 result. purged( ) ,
674674 ratio_per_mille_usize( result. purged( ) , result. matched( ) ) ,
@@ -680,9 +680,11 @@ impl AdminApp {
680680 cache_scope( result. route. as_deref( ) ) ,
681681 result. memory_matched,
682682 result. memory_purged,
683+ ratio_per_mille_usize( result. memory_purged, result. memory_matched) ,
683684 result. memory_truncated,
684685 result. disk_matched,
685686 result. disk_purged,
687+ ratio_per_mille_usize( result. disk_purged, result. disk_matched) ,
686688 result. disk_truncated
687689 ) ;
688690 json_response ( StatusCode :: OK , body. as_bytes ( ) )
@@ -730,7 +732,7 @@ impl AdminApp {
730732 ) {
731733 Ok ( result) => {
732734 let body = format ! (
733- r#"{{"status":"ok","matched":{},"purged":{},"purged_ratio_per_mille":{},"truncated":{},"repeat_required":{},"limit":{},"vhost":"{}","route":{},"scope":"{}","path_prefix":"{}","memory_matched":{},"memory_purged":{},"memory_truncated":{},"disk_matched":{},"disk_purged":{},"disk_truncated":{}}}"# ,
735+ r#"{{"status":"ok","matched":{},"purged":{},"purged_ratio_per_mille":{},"truncated":{},"repeat_required":{},"limit":{},"vhost":"{}","route":{},"scope":"{}","path_prefix":"{}","memory_matched":{},"memory_purged":{},"memory_purged_ratio_per_mille":{}," memory_truncated":{},"disk_matched":{},"disk_purged":{},"disk_purged_ratio_per_mille ":{},"disk_truncated":{}}}"# ,
734736 result. matched( ) ,
735737 result. purged( ) ,
736738 ratio_per_mille_usize( result. purged( ) , result. matched( ) ) ,
@@ -743,9 +745,11 @@ impl AdminApp {
743745 json_escape( path_prefix) ,
744746 result. memory_matched,
745747 result. memory_purged,
748+ ratio_per_mille_usize( result. memory_purged, result. memory_matched) ,
746749 result. memory_truncated,
747750 result. disk_matched,
748751 result. disk_purged,
752+ ratio_per_mille_usize( result. disk_purged, result. disk_matched) ,
749753 result. disk_truncated
750754 ) ;
751755 json_response ( StatusCode :: OK , body. as_bytes ( ) )
@@ -793,7 +797,7 @@ impl AdminApp {
793797 ) {
794798 Ok ( result) => {
795799 let body = format ! (
796- r#"{{"status":"ok","matched":{},"purged":{},"purged_ratio_per_mille":{},"truncated":{},"repeat_required":{},"limit":{},"vhost":"{}","route":{},"scope":"{}","path_pattern":"{}","memory_matched":{},"memory_purged":{},"memory_truncated":{},"disk_matched":{},"disk_purged":{},"disk_truncated":{}}}"# ,
800+ r#"{{"status":"ok","matched":{},"purged":{},"purged_ratio_per_mille":{},"truncated":{},"repeat_required":{},"limit":{},"vhost":"{}","route":{},"scope":"{}","path_pattern":"{}","memory_matched":{},"memory_purged":{},"memory_purged_ratio_per_mille":{}," memory_truncated":{},"disk_matched":{},"disk_purged":{},"disk_purged_ratio_per_mille ":{},"disk_truncated":{}}}"# ,
797801 result. matched( ) ,
798802 result. purged( ) ,
799803 ratio_per_mille_usize( result. purged( ) , result. matched( ) ) ,
@@ -806,9 +810,11 @@ impl AdminApp {
806810 json_escape( path_pattern) ,
807811 result. memory_matched,
808812 result. memory_purged,
813+ ratio_per_mille_usize( result. memory_purged, result. memory_matched) ,
809814 result. memory_truncated,
810815 result. disk_matched,
811816 result. disk_purged,
817+ ratio_per_mille_usize( result. disk_purged, result. disk_matched) ,
812818 result. disk_truncated
813819 ) ;
814820 json_response ( StatusCode :: OK , body. as_bytes ( ) )
@@ -2305,6 +2311,8 @@ mod tests {
23052311 assert ! ( body. contains( r#""matched":0"# ) ) ;
23062312 assert ! ( body. contains( r#""purged":0"# ) ) ;
23072313 assert ! ( body. contains( r#""purged_ratio_per_mille":0"# ) ) ;
2314+ assert ! ( body. contains( r#""memory_purged_ratio_per_mille":0"# ) ) ;
2315+ assert ! ( body. contains( r#""disk_purged_ratio_per_mille":0"# ) ) ;
23082316 assert ! ( body. contains( r#""truncated":false"# ) ) ;
23092317 assert ! ( body. contains( r#""repeat_required":false"# ) ) ;
23102318 assert ! ( body. contains( r#""limit":16"# ) ) ;
@@ -2353,6 +2361,8 @@ mod tests {
23532361 assert ! ( body. contains( r#""path_prefix":"/assets/""# ) ) ;
23542362 assert ! ( body. contains( r#""matched":0"# ) ) ;
23552363 assert ! ( body. contains( r#""purged_ratio_per_mille":0"# ) ) ;
2364+ assert ! ( body. contains( r#""memory_purged_ratio_per_mille":0"# ) ) ;
2365+ assert ! ( body. contains( r#""disk_purged_ratio_per_mille":0"# ) ) ;
23562366 assert ! ( body. contains( r#""repeat_required":false"# ) ) ;
23572367 assert ! ( body. contains( r#""limit":16"# ) ) ;
23582368 assert ! ( body. contains( r#""scope":"vhost""# ) ) ;
@@ -2413,6 +2423,8 @@ mod tests {
24132423 assert ! ( body. contains( r#""path_pattern":"/assets/*.png""# ) ) ;
24142424 assert ! ( body. contains( r#""matched":0"# ) ) ;
24152425 assert ! ( body. contains( r#""purged_ratio_per_mille":0"# ) ) ;
2426+ assert ! ( body. contains( r#""memory_purged_ratio_per_mille":0"# ) ) ;
2427+ assert ! ( body. contains( r#""disk_purged_ratio_per_mille":0"# ) ) ;
24162428 assert ! ( body. contains( r#""repeat_required":false"# ) ) ;
24172429 assert ! ( body. contains( r#""limit":16"# ) ) ;
24182430 assert ! ( body. contains( r#""scope":"vhost""# ) ) ;
0 commit comments