pub struct PprofBuilder {
pub functions: Vec<Function>,
/* private fields */
}Fields§
§functions: Vec<Function>Implementations§
Source§impl PprofBuilder
impl PprofBuilder
pub fn new( profile_start: SystemTime, duration: Duration, freq_in_hz: u64, ) -> Self
Sourcepub fn validate(&self) -> Result<(), PprofError>
pub fn validate(&self) -> Result<(), PprofError>
Run some validations to ensure that the profile is semantically correct.
Sourcepub fn string_id(&self, string: &str) -> Option<i64>
pub fn string_id(&self, string: &str) -> Option<i64>
Returns the id for a string in the string table or None if it’s not present.
Sourcepub fn get_or_insert_string(&mut self, string: &str) -> i64
pub fn get_or_insert_string(&mut self, string: &str) -> i64
Inserts a string in the string table and returns its id.
pub fn add_function(&mut self, func_name: &str, filename: Option<String>) -> u64
pub fn add_line( &mut self, func_name: &str, file_name: Option<String>, line: Option<u32>, ) -> (Line, u64)
pub fn add_location( &mut self, address: u64, mapping_id: u64, lines: Vec<Line>, ) -> u64
Sourcepub fn add_mapping(
&mut self,
id: u64,
start: u64,
end: u64,
offset: u64,
filename: &str,
build_id: &str,
) -> u64
pub fn add_mapping( &mut self, id: u64, start: u64, end: u64, offset: u64, filename: &str, build_id: &str, ) -> u64
Adds a memory mapping. The id of the mapping is derived from the hash of the code region and should be unique.
pub fn add_sample( &mut self, location_ids: Vec<u64>, count: i64, labels: &[Label], )
pub fn new_label(&mut self, key: &str, value: LabelStringOrNumber) -> Label
pub fn build(self) -> Profile
Auto Trait Implementations§
impl Freeze for PprofBuilder
impl RefUnwindSafe for PprofBuilder
impl Send for PprofBuilder
impl Sync for PprofBuilder
impl Unpin for PprofBuilder
impl UnwindSafe for PprofBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more