// Prints the stats from FrameStatsCollector, plus success rate for each latch offset used (by
// millisecond), from largest to smallest.
// Example output:
//
// Frame Scheduling stats:
//     Total produced frames: 1237
//     Total presented: 1180 (95.39%)
//     Total dropped: 57 (4.61%)
//     Total delayed: 513 (41.47%)
//     Total missed latch points: 568 (45.92%)
//     Average latency: 45.69 ms
// Latch offset 32 ms. Success Rate 97.56% Total: 41 Missed: 1
// Latch offset 31 ms. Success Rate 100.00% Total: 41 Missed: 0
// Latch offset 30 ms. Success Rate 100.00% Total: 46 Missed: 0
// Latch offset 29 ms. Success Rate 96.88% Total: 32 Missed: 1
// Latch offset 28 ms. Success Rate 100.00% Total: 27 Missed: 0
// Latch offset 27 ms. Success Rate 100.00% Total: 48 Missed: 0
// Latch offset 26 ms. Success Rate 100.00% Total: 37 Missed: 0
// Latch offset 25 ms. Success Rate 100.00% Total: 43 Missed: 0
// Latch offset 24 ms. Success Rate 100.00% Total: 40 Missed: 0
// Latch offset 23 ms. Success Rate 100.00% Total: 50 Missed: 0
// Latch offset 22 ms. Success Rate 100.00% Total: 48 Missed: 0
// Latch offset 21 ms. Success Rate 100.00% Total: 42 Missed: 0
// Latch offset 20 ms. Success Rate 100.00% Total: 43 Missed: 0
// Latch offset 19 ms. Success Rate 100.00% Total: 37 Missed: 0
// Latch offset 18 ms. Success Rate 100.00% Total: 41 Missed: 0
// Latch offset 17 ms. Success Rate 100.00% Total: 24 Missed: 0
// Latch offset 16 ms. Success Rate 100.00% Total: 30 Missed: 0
// Latch offset 15 ms. Success Rate 2.08% Total: 48 Missed: 47
// Latch offset 14 ms. Success Rate 0.00% Total: 35 Missed: 35
// Latch offset 13 ms. Success Rate 0.00% Total: 34 Missed: 34
// Latch offset 12 ms. Success Rate 0.00% Total: 39 Missed: 39
// Latch offset 11 ms. Success Rate 0.00% Total: 30 Missed: 30
// Latch offset 10 ms. Success Rate 0.00% Total: 45 Missed: 45
// Latch offset 9 ms. Success Rate 0.00% Total: 34 Missed: 34
// Latch offset 8 ms. Success Rate 0.00% Total: 44 Missed: 44
// Latch offset 7 ms. Success Rate 0.00% Total: 33 Missed: 33
// Latch offset 6 ms. Success Rate 0.00% Total: 37 Missed: 37
// Latch offset 5 ms. Success Rate 0.00% Total: 31 Missed: 31
// Latch offset 4 ms. Success Rate 0.00% Total: 45 Missed: 45
// Latch offset 3 ms. Success Rate 0.00% Total: 30 Missed: 30
// Latch offset 2 ms. Success Rate 0.00% Total: 39 Missed: 39
// Latch offset 1 ms. Success Rate 0.00% Total: 43 Missed: 43
Prints the stats from FrameStatsCollector, plus success rate for each latch offset used (by
millisecond), from largest to smallest.
Example output.


Prints the stats from FrameStatsCollector plus success rate for each latch offset used ( by millisecond ) from largest to smallest . Example output .
pub fn stats_to_string(&self) -> String {
        let mut string_vec = Vec::new();
        string_vec.push(self.frame_stats_collector.stats_to_string());
        let mut entries: Vec<(zx::Duration, FrameCount)> = self
            .latency_stats
            .borrow()
            .iter()
            .map(|(key, value)| (key.clone(), value.clone()))
            .collect::<Vec<(zx::Duration, FrameCount)>>();
        entries.sort_by(|(key1, _), (key2, _)| key2.cmp(key1));
        for (key, value) in entries.iter() {
            string_vec.push(format!(
                "Latch offset {} ms. Success Rate {:.2}% Total: {} Missed: {}",
                key.into_millis(),
                100.0 * (1.0 - (value.missed_latch_points as f64) / (value.total as f64)),
                value.total,
                value.missed_latch_points
            ));
        }
        string_vec.join("\n")
    }
pub fn stats_to_string ( & self ) -> String { let mut string_vec = Vec :: new ( ) ; string_vec . push ( self . frame_stats_collector . stats_to_string ( ) ) ; let mut entries : Vec < ( zx :: Duration , FrameCount ) > = self . latency_stats . borrow ( ) . iter ( ) . map ( | ( key , value ) | ( key . clone ( ) , value . clone ( ) ) ) . collect :: < Vec < ( zx :: Duration , FrameCount ) > > ( ) ; entries . sort_by ( | ( key1 , _ ) , ( key2 , _ ) | key2 . cmp ( key1 ) ) ; for ( key , value ) in entries . iter ( ) { string_vec . push ( format ! ( " " key into_millis ( ) 100.0 ( 1.0 ( value missed_latch_points as f64 ) ( value total as f64 ) ) value total value missed_latch_points ) ) ; } string_vec . join ( " \n " ) }
Prints the stats from FrameStatsCollector, plus success rate for each latch offset used (by
millisecond), from largest to smallest.
Prints the stats from FrameStatsCollector plus success rate for each latch offset used ( by millisecond ) from largest to smallest .
&self