fn collect_data()

in src/data/java_profile.rs [179:203]


    fn collect_data(&mut self, params: &CollectorParams) -> Result<()> {
        let jprofile = params.profile.get(JAVA_PROFILE_FILE_NAME).unwrap().as_str();
        if jprofile != "jps" {
            return Ok(());
        }

        let pgrep_pids: Vec<String> = self.launch_pgrep()?;

        let mut jids: Vec<String> = Vec::new();
        for pid in pgrep_pids {
            if self.process_map.contains_key(pid.as_str()) {
                continue;
            }
            self.process_map
                .insert(pid.clone(), vec![String::from("Could not resolve name!")]);
            jids.push(pid.clone());
        }

        if jids.is_empty() || params.elapsed_time >= params.collection_time {
            return Ok(());
        }

        self.update_process_map()?;
        self.launch_asprof(jids, params)
    }