pub fn build(self) -> Result<PyroscopeAgent> {
        // Initiliaze the backend
        let backend = Arc::clone(&self.backend);
        backend.lock()?.initialize(self.config.sample_rate)?;
        log::trace!(target: LOG_TAG, "Backend initialized");

        // Start Timer
        let timer = Timer::default().initialize()?;
        log::trace!(target: LOG_TAG, "Timer initialized");

        // Start the SessionManager
        let session_manager = SessionManager::new()?;
        log::trace!(target: LOG_TAG, "SessionManager initialized");

        // Return PyroscopeAgent
        Ok(PyroscopeAgent {
            backend: self.backend,
            config: self.config,
            timer,
            session_manager,
            tx: None,
            handle: None,
            running: Arc::new((Mutex::new(false), Condvar::new())),
        })
    }
/// Initialize the backend, timer and return a PyroscopeAgent object.
Initialize the backend, timer and return a PyroscopeAgent object.
Initialize the backend timer and return a PyroscopeAgent object .
pub fn build(self) -> Result<PyroscopeAgent> {
        // Initiliaze the backend
        let backend = Arc::clone(&self.backend);
        backend.lock()?.initialize(self.config.sample_rate)?;
        log::trace!(target: LOG_TAG, "Backend initialized");
        // Start Timer
        let timer = Timer::default().initialize()?;
        log::trace!(target: LOG_TAG, "Timer initialized");
        // Start the SessionManager
        let session_manager = SessionManager::new()?;
        log::trace!(target: LOG_TAG, "SessionManager initialized");
        // Return PyroscopeAgent
        Ok(PyroscopeAgent {
            backend: self.backend,
            config: self.config,
            timer,
            session_manager,
            tx: None,
            handle: None,
            running: Arc::new((Mutex::new(false), Condvar::new())),
        })
    }
pub fn build ( self ) -> Result < PyroscopeAgent > { // Initiliaze the backend let backend = Arc :: clone ( & self . backend ) ; backend . lock ( ) ? . initialize ( self . config . sample_rate ) ? ; log :: trace ! ( target LOG_TAG " " ) ; // Start Timer let timer = Timer :: default ( ) . initialize ( ) ? ; log :: trace ! ( target LOG_TAG " " ) ; // Start the SessionManager let session_manager = SessionManager :: new ( ) ? ; log :: trace ! ( target LOG_TAG " " ) ; // Return PyroscopeAgent Ok ( PyroscopeAgent { backend : self . backend , config : self . config , timer , session_manager , tx : None , handle : None , running : Arc :: new ( ( Mutex :: new ( false ) , Condvar :: new ( ) ) ) , } ) }
Initialize the backend, timer and return a PyroscopeAgent object.
Initialize the backend timer and return a PyroscopeAgent object .
self
self