mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Refactor the memory profiler code to return the struct. (#37155)
Refactor the memory profiler code to return the struct and handle the serializing in servointernal page. This allows other users of the memory profiler to see the whole report without parsing json. Testing: I do not know if the memory page is covered by tests. --------- Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This commit is contained in:
parent
ac06b1cfcf
commit
2d3a7c87c2
3 changed files with 21 additions and 18 deletions
|
@ -247,8 +247,19 @@ macro_rules! path {
|
|||
/// The results produced by the memory reporter.
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub struct MemoryReportResult {
|
||||
/// The stringified output.
|
||||
pub content: String,
|
||||
/// All the results from the MemoryReports
|
||||
pub results: Vec<MemoryReport>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
/// A simple memory report
|
||||
pub struct MemoryReport {
|
||||
/// The pid of the report
|
||||
pub pid: u32,
|
||||
/// Is this the main process
|
||||
pub is_main_process: bool,
|
||||
/// All the reports for this pid
|
||||
pub reports: Vec<Report>,
|
||||
}
|
||||
|
||||
/// Messages that can be sent to the memory profiler thread.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue