pub fn cumulative_histogram()Expand description
Show cumulative histogram of parser call count.
The call count includes the counts of children parsers.
The statistics information to generate histogram is reset at each parser call.
Therefore cumulative_histogram should be called before next parser call.
The information is thread independent because it is stored at thread local storage.
let ret = term(LocatedSpan::new_extra("1", TracableInfo::new()));
cumulative_histogram(); // Show cumulative histogram of "1" parsing
let ret = term(LocatedSpan::new_extra("11", TracableInfo::new()));
cumulative_histogram(); // Show cumulative histogram of "11" parsingExamples found in repository?
More examples
examples/u8_parser.rs (line 57)
47fn main() {
48 // Configure trace setting
49 let info = TracableInfo::new()
50 .parser_width(64)
51 .fragment_width(20)
52 .fold("term");
53 let _ret = expr(LocatedSpan::new_extra("1-1+1+1-1".as_bytes(), info));
54
55 // Show histogram
56 histogram();
57 cumulative_histogram();
58}examples/u8_custom_parser.rs (line 128)
118fn main() {
119 // Configure trace setting
120 let info = TracableInfo::new()
121 .parser_width(64)
122 .fragment_width(20)
123 .fold("term");
124 let _ret = expr(Span(LocatedSpan::new_extra("1-1+1+1-1".as_bytes(), info)));
125
126 // Show histogram
127 histogram();
128 cumulative_histogram();
129}