Struct hprof::ProfileNode [] [src]

pub struct ProfileNode {
    pub name: &'static str,
    pub calls: Cell<u32>,
    pub total_time: Cell<u64>,
    pub start_time: Cell<u64>,
    pub recursion: Cell<u32>,
    pub parent: Option<Rc<ProfileNode>>,
    pub children: RefCell<Vec<Rc<ProfileNode>>>,
}

A single node in the profile tree.

NOTE: While the fields are public and are a cell, it is not advisable to modify them.

Fields

name: &'static str calls: Cell<u32>

Number of calls made to this node.

total_time: Cell<u64>

Total time in ns used by this node and all of its children.

Computed after the last pending ret.

start_time: Cell<u64>

Timestamp in ns when the first call was made to this node.

recursion: Cell<u32>

Number of recursive calls made to this node since the first call.

parent: Option<Rc<ProfileNode>>

Parent in the profile tree.

children: RefCell<Vec<Rc<ProfileNode>>>

Child nodes.

Methods

impl ProfileNode
[src]

fn new(parent: Option<Rc<ProfileNode>>, name: &'static str) -> ProfileNode

fn reset(&self)

Reset this node and its children, seting relevant fields to 0.

fn make_child(&self, me: Rc<ProfileNode>, name: &'static str) -> Rc<ProfileNode>

Create a child named name.

fn call(&self)

Enter this profile node.

fn ret(&self) -> bool

Return from this profile node, returning true if there are no pending recursive calls.

fn print(&self, indent: u32)

Print out the current timing information in a very naive way.

Uses indent to determine how deep to indent the line.