Tags: facebook/memlab
Tags
feat(core): support console annotations (#124) Summary: When dev set the following config, we want stack traces to be printed even if `lowLevel` output is muted (stack traces is output at `lowLevel` for various reasons such as coloring, but semantically it is part of the error output). ``` memlabConfig.muteConfig = { muteError: false, muteWarning: false, muteInfo: true, muteSuccess: true, muteLog: true, muteTable: true, muteTrace: true, muteTopLevel: true, muteHighLevel: true, muteMidLevel: true, muteLowLevel: true, }; memlabConfig.verbose = true; ``` This diff patches the MemLab console output module so that stack traces is still printed when `muteLowLevel` is `true` while `muteError` is `false`. Differential Revision: D63012111 fbshipit-source-id: 535bde1a3e7287a2d5b33c75f48b04f708a44be8
Add JSON output parameter to more analyses (#129) Summary: Added `OutputOption` to a few more analyses, as the `printNodeListInTerminal` method supports JSON output. Pull Request resolved: #129 Reviewed By: twobassdrum Differential Revision: D61780561 Pulled By: JacksonGL fbshipit-source-id: 28c3f55459f2ad1a04cfcbb7861e74fa5c3e5d22
JSON output (#128) Summary: PR changes: * Adds `--output [text/json]` CLI option which sets the `outputFormat` config flag * When output is set to JSON, it implies the `--sc` option and directs all logs to `stderr`. This allows to easily capture a clean JSON output using `memlab > result.json`. * Adds `getJSONifyableObject` to the interfaces of nodes and edges * Updates `printNodeListInTerminal` and `printReferencesInTerminal` to support JSON output * Updates `CollectionsHoldingStaleAnalysis` to support JSON output Open questions: * Should all analyses support JSON output? I only added the ones I need at the moment. * The output from `getJSONifyableObject` has inconsistent casing (e.g. snake `self_size` vs. camel `incomingEdgeCount`). Is it a breaking change to change this so it's all the same? Which case is preferrred? Fixes #127 Pull Request resolved: #128 Reviewed By: twobassdrum Differential Revision: D61724639 Pulled By: JacksonGL fbshipit-source-id: 13a056be1c421999ffbd988ee5f85026d66c860d
feat(core): support for console mute configuration (#124) Summary: OSS feature request: #124 By setting `config.muteConfig`, JS code using MemLab API can set the mute config for different types of console messages (e.g., warning, error etc.) ``` type MuteConfig = { muteError?: boolean; muteWarning?: boolean; muteInfo?: boolean; muteSuccess?: boolean; muteLog?: boolean; muteTable?: boolean; muteTrace?: boolean; muteTopLevel?: boolean; muteHighLevel?: boolean; muteMidLevel?: boolean; muteLowLevel?: boolean; }; ``` Reviewed By: twobassdrum Differential Revision: D61287025 fbshipit-source-id: cb0d8b3a06d3f80d61ad107d0d41a633d8e69307
fix(core): simplify serialization for code heap object (#122) Summary: MemLab could run out of memory if the JS heap under analysis has complex code heap objects (i.e., JS interpreted, and compiled code representation and their context graph in heap) which may take a lot of time and memory to serialize: #122 This diff fixes this issue by simplifying the code heap object serialization process and output. Reviewed By: tulga1970 Differential Revision: D59541476 fbshipit-source-id: a4eb00e0f914d4694a1fe562abe0c861ca641ad1
feat(core): add config to skip waiting for browser close (#120) Summary: Issue: #95 Pull Request resolved: #120 Test Plan: ``` memlab build-core && memlab test && arc lint ``` Reviewed By: twobassdrum Differential Revision: D57819075 Pulled By: JacksonGL fbshipit-source-id: e60d1aa9d8b59565534a660bb029ceb68499b3d6
Prevent external retainer trace edge filter from OOMing memlab path f… …inder (#117) Summary: External leak filter's `retainerReferenceFilter` callback could return `true` for edges that shouldn't be used. For example, self-referencing edges cause to infinite loop when traversing from a node to the GC root. MemLab's default edge filter excludes these kind of edges, but MemLab's path finder didn't consider the case where external leak filter may bypass MemLab's internal edge filter. This diff makes a patch to MemLab so that its path finder will consider the case where external edge filter includes edges that should be bypassed. Differential Revision: D56803842 fbshipit-source-id: d25ab366c5a1562927d284299a0bcfb057d9330a
PreviousNext