Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  ui.js   Sprache: JAVA

 
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


"use strict";

const {
  createSelector,
} = require("resource://devtools/client/shared/vendor/reselect.js");
const {
  REQUESTS_WATERFALL,
} = require("resource://devtools/client/netmonitor/src/constants.js");

const EPSILON = 0.001;

const getWaterfallScale = createSelector(
  state => state.requests.firstStartedMs,
  state => state.requests.lastEndedMs,
  state => state.timingMarkers.firstDocumentDOMContentLoadedTimestamp,
  state => state.timingMarkers.firstDocumentLoadTimestamp,
  state => state.ui.waterfallWidth,
  (
    firstStartedMs,
    lastEndedMs,
    firstDocumentDOMContentLoadedTimestamp,
    firstDocumentLoadTimestamp,
    waterfallWidth
  ) => {
    if (firstStartedMs === +Infinity || waterfallWidth === null) {
      return null;
    }

    const lastEventMs = Math.max(
      lastEndedMs,
      firstDocumentDOMContentLoadedTimestamp,
      firstDocumentLoadTimestamp
    );
    const longestWidth = lastEventMs - firstStartedMs;

    // Reduce 20px for the last request's requests-list-timings-total
    return Math.min(
      Math.max(
        (waterfallWidth - REQUESTS_WATERFALL.LABEL_WIDTH - 20) / longestWidth,
        EPSILON
      ),
      1
    );
  }
);

function getVisibleColumns(columns) {
  return Object.entries(columns).filter(([_, shown]) => shown);
}

const getColumns = createSelector(
  state => state.ui.columns,
  state => state.ui.networkDetailsOpen || state.search.panelOpen,
  (columns, isSidePanelOpen) => {
    const isWaterfallOnly =
      getVisibleColumns(columns).length === 1 && columns.waterfall;
    if (isSidePanelOpen && !isWaterfallOnly) {
      // Remove the Waterfall column if it is not the only column and a side
      // panel is open.
      columns = { ...columns };
      delete columns.waterfall;
    }
    return columns;
  }
);

module.exports = {
  getColumns,
  getVisibleColumns,
  getWaterfallScale,
};

Messung V0.5
C=89 H=95 G=91

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge