translateMetrics(metrics) {
    const result = metrics.map((metric) => {
      const cpu = this.translateCpuMetrics(metric.cpu);
      let memory;
      // https://github.com/electron/electron/issues/16179
      if (metric.memory) {
        memory = this.translateMemoryMetrics(metric.memory);
      } else {
        memory = this._emptyMemoryInfo();
      }
      const title = this.translateMetricTitle(metric.type, metric.pid);
      return {
        pid: metric.pid,
        memory,
        cpu,
        title
      };
    });
    return result;
  }
/**
   * Translates electron app metrics into the data model.
   *
   * @param {Array<Object>} metrics List of current metrics
   * @return {Array} Internal data model.
   */
Translates electron app metrics into the data model.
@param {Array} metrics List of current metrics
@return {Array} Internal data model.
Translates electron app metrics into the data model . @param { Array } metrics List of current metrics @return { Array } Internal data model .
translateMetrics(metrics) {
    const result = metrics.map((metric) => {
      const cpu = this.translateCpuMetrics(metric.cpu);
      let memory;
      if (metric.memory) {
        memory = this.translateMemoryMetrics(metric.memory);
      } else {
        memory = this._emptyMemoryInfo();
      }
      const title = this.translateMetricTitle(metric.type, metric.pid);
      return {
        pid: metric.pid,
        memory,
        cpu,
        title
      };
    });
    return result;
  }
translateMetrics ( metrics ) { const result = metrics . map ( ( metric ) => { const cpu = this . translateCpuMetrics ( metric . cpu ) ; let memory ; if ( metric . memory ) { memory = this . translateMemoryMetrics ( metric . memory ) ; } else { memory = this . _emptyMemoryInfo ( ) ; } const title = this . translateMetricTitle ( metric . type , metric . pid ) ; return { pid : metric . pid , memory , cpu , title } ; } ) ; return result ; }
Translates electron app metrics into the data model.
Translates electron app metrics into the data model .
// https://github.com/electron/electron/issues/16179