class JsonPrinter

Defined at line 23 of file ../../src/developer/memory/metrics/printer.h

Public Methods

void JsonPrinter (zx::socket & output_socket)

Defined at line 25 of file ../../src/developer/memory/metrics/printer.h

void PrintCapture (const Capture & capture)

Outputs capture as JSON. In this format:

{

"Time":28477260758625,

"Kernel":{

"total":1610612736,

"free":170565632,

"wired":67395584,

"total_heap":30904320,

"free_heap":1873728,

"vmo":1276194816,

"mmu":65294336,

"ipc":196608,

"other":61440,

"zram_compressed_total": 65294336,

"zram_uncompressed": 65294336,

"zram_fragmentation": 65294336,

},

"Processes":[

["koid","name","vmos"],

[47325,"fonts.cm",[47353, ...]],

...

],

"VmoNames":["scudo:primary", ...],

"Vmos":[

["koid","name","parent_koid","committed_bytes","allocated_bytes","populated_bytes"],

[47440,38,47437,4096,4096,4096],

...

]

}

For size reasons:

- Processes and Vmos have an initial entry that contains the names of the the fields in the

rest of the entries.

- The names of the VMOs are an index into the VMONames array.

Defined at line 238 of file ../../src/developer/memory/metrics/printer.cc

void PrintCaptureAndBucketConfig (const Capture & capture, const std::string & bucket_config)

`bucket_config` must be a valid JSON array, in this format:

[

{

"event_code": 29,

"name": "BlobfsInactive",

"process": "blobfs\\.cm",

"vmo": "inactive-blob-.*"

},

...

]

Outputs JSON in this format:

{"Capture":

{

"Time":28477260758625,

"Kernel":{

"total":1610612736,

"free":170565632,

"wired":67395584,

"total_heap":30904320,

"free_heap":1873728,

"vmo":1276194816,

"mmu":65294336,

"ipc":196608,

"other":61440,

"zram_compressed_total": 65294336,

"zram_uncompressed": 65294336,

"zram_fragmentation": 65294336,

},

"Processes":[

["koid","name","vmos"],

[47325,"fonts.cm",[47353, ...]],

...

],

"VmoNames":["scudo:primary", ...],

"Vmos":[

["koid","name","parent_koid","committed_bytes","allocated_bytes","populated_bytes"],

[47440,38,47437,4096,4096,4096],

...

]

}

"Buckets":

[

{

"event_code": 29,

"name": "BlobfsInactive",

"process": "blobfs\\.cm",

"vmo": "inactive-blob-.*"

},

...

]

}

For size reasons:

- Processes and Vmos have an initial entry that contains the names of the the fields in the

rest of the entries.

- The names of the VMOs are an index into the VMONames array.

Defined at line 249 of file ../../src/developer/memory/metrics/printer.cc