pub trait Counter {
    // Required methods
    fn start(&mut self);
    fn stop(&mut self);
    fn phase_change(&mut self, old_phase: usize);
    fn print_count(&self, phase: usize);
    fn get_total(&self, other: Option<bool>) -> u64;
    fn print_total(&self, other: Option<bool>);
    fn print_min(&self, other: bool);
    fn print_max(&self, other: bool);
    fn print_last(&self);
    fn merge_phases(&self) -> bool;
    fn implicitly_start(&self) -> bool;
    fn name(&self) -> &String;
}
Expand description

An abstraction over how a specific Diffable value is counted

For example, we can just collect the values, and store the cummulative sum, or we can derive some kind of histogram, etc.

Required Methods§

source

fn start(&mut self)

Start the counter

source

fn stop(&mut self)

Stop the counter

source

fn phase_change(&mut self, old_phase: usize)

Signal a change in GC phase.

The phase number starts from 0 and is strictly increasing. Even numbers mean mutators are running (other) while odd numbers mean stop-the-world pauses (stw). Take action with respect to the last phase if necessary.

source

fn print_count(&self, phase: usize)

Print the counter value for a particular phase

If the counter merges the phases, the printing value will include the specified phase and the next phase

source

fn get_total(&self, other: Option<bool>) -> u64

Get the total count over past phases

If the argument is None, count all phases. Otherwise, count only other phases if true, or stw phases if false

source

fn print_total(&self, other: Option<bool>)

Print the total count over past phases

If the argument is None, count all phases. Otherwise, count only other phases if true, or stw phases if false

source

fn print_min(&self, other: bool)

Print the minimum count of the past phases

Consider only other phases if true, or stw phases if false

source

fn print_max(&self, other: bool)

Print the maximum count of the past phases

Consider only other phases if true, or stw phases if false

source

fn print_last(&self)

Print the count of the last phases

source

fn merge_phases(&self) -> bool

Whether the counter merges other and stw phases.

source

fn implicitly_start(&self) -> bool

Whether the counter starts implicitly after creation

FIXME currently unused

source

fn name(&self) -> &String

Get the name of the counter

Implementors§