Beispiel #1
0
  parseCommandLine(
    type: string,
    action: DebuggerConfigAction,
    exclude: Set<string>,
    includeDefaults: Set<string>,
    customArguments: CustomArgumentMap,
  ): Map<string, any> {
    const propertyMap = this._optionsData.adapterPropertiesForAction(
      type,
      action,
    );

    let args = mapFilter(
      propertyMap,
      (name, prop) => prop.default != null && name in includeDefaults,
    );
    args = mapTransform(args, (prop, name) => [name, prop.default]);

    const parser = this._yargsFromPropertyMap(propertyMap, customArguments);

    this._applyCommandLineToArgs(
      args,
      parser.argv,
      propertyMap,
      customArguments,
    );

    return args;
  }
export function childProcessTree(ps: Map<number, PsInfo>): ?ChildProcessInfo {
  const ioMap = mapIoStats();
  const viewPs = mapFilter(
    ps,
    (k, v) => v.command !== 'ps -eo pid,ppid,pcpu,time,rss,vsz,command',
  );
  return postOrder(process.pid, mapChildren(viewPs), (pid, children) => {
    const process = nullthrows(viewPs.get(pid));
    return {
      pid,
      command: process.command,
      cpuPercentage: process.pcpu,
      children,
      ioBytesStats: ioMap.get(pid),
    };
  });
}