feat(debug): Add timing information about time to first image/all images, and query time (#3681)
This commit is contained in:
1 parent
1b207f14d2
commit
108383b9ef
10 files changed
+125
-18
No files matched your search
@@ -42,6 +42,10 @@
|
||||
name="msapplication-config"
|
||||
content="<%= PUBLIC_URL %>assets/browserconfig.xml"
|
||||
/>
|
||||
<script type="text/javascript">
|
||||
console.time('scriptToView');
|
||||
window.PUBLIC_URL = '<%= PUBLIC_URL %>';
|
||||
</script>
|
||||
<link
|
||||
rel="manifest"
|
||||
href="<%= PUBLIC_URL %>manifest.json"
|
||||
@@ -183,9 +187,6 @@
|
||||
<!-- Targets IE11 -->
|
||||
<!-- <script
|
||||
src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>!-->
|
||||
<script type="text/javascript">
|
||||
window.PUBLIC_URL = '<%= PUBLIC_URL %>';
|
||||
</script>
|
||||
<script
|
||||
rel="preload"
|
||||
as="script"
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
/* eslint-disable react/jsx-props-no-spreading */
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { ExtensionManager, MODULE_TYPES } from '@ohif/core';
|
||||
import { ExtensionManager, MODULE_TYPES, Types, log } from '@ohif/core';
|
||||
//
|
||||
import { extensionManager } from '../App.tsx';
|
||||
import { useParams, useLocation } from 'react-router';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import useSearchParams from '../hooks/useSearchParams.ts';
|
||||
|
||||
const { TimingEnum } = Types;
|
||||
|
||||
/**
|
||||
* Determines if two React Router location objects are the same.
|
||||
*/
|
||||
@@ -149,7 +151,7 @@ function DataSourceWrapper(props) {
|
||||
// 204: no content
|
||||
async function getData() {
|
||||
setIsLoading(true);
|
||||
|
||||
log.time(TimingEnum.SEARCH_TO_LIST);
|
||||
const studies = await dataSource.query.studies.search(queryFilterValues);
|
||||
|
||||
setData({
|
||||
@@ -159,6 +161,8 @@ function DataSourceWrapper(props) {
|
||||
pageNumber: queryFilterValues.pageNumber,
|
||||
location,
|
||||
});
|
||||
log.timeEnd(TimingEnum.SCRIPT_TO_VIEW);
|
||||
log.timeEnd(TimingEnum.SEARCH_TO_LIST);
|
||||
|
||||
setIsLoading(false);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import React, { useEffect, useState, useRef } from 'react';
|
||||
import { useParams, useLocation, useNavigate } from 'react-router';
|
||||
import PropTypes from 'prop-types';
|
||||
// TODO: DicomMetadataStore should be injected?
|
||||
import { DicomMetadataStore, ServicesManager, utils } from '@ohif/core';
|
||||
import { DicomMetadataStore, ServicesManager, utils, Types, log } from '@ohif/core';
|
||||
import { DragAndDropProvider, ImageViewerProvider } from '@ohif/ui';
|
||||
import { useSearchParams } from '@hooks';
|
||||
import { useAppConfig } from '@state';
|
||||
@@ -14,6 +14,7 @@ import loadModules from '../../pluginImports';
|
||||
import isSeriesFilterUsed from '../../utils/isSeriesFilterUsed';
|
||||
|
||||
const { getSplitParam } = utils;
|
||||
const { TimingEnum } = Types;
|
||||
|
||||
/**
|
||||
* Initialize the route.
|
||||
@@ -60,6 +61,8 @@ function defaultRouteInit(
|
||||
|
||||
unsubscriptions.push(instanceAddedUnsubscribe);
|
||||
|
||||
log.time(TimingEnum.STUDY_TO_DISPLAY_SETS);
|
||||
log.time(TimingEnum.STUDY_TO_FIRST_IMAGE);
|
||||
const allRetrieves = studyInstanceUIDs.map(StudyInstanceUID =>
|
||||
dataSource.retrieve.series.metadata({
|
||||
StudyInstanceUID,
|
||||
@@ -81,6 +84,9 @@ function defaultRouteInit(
|
||||
// until we run the hanging protocol matching service.
|
||||
|
||||
Promise.allSettled(allRetrieves).then(() => {
|
||||
log.timeEnd(TimingEnum.STUDY_TO_DISPLAY_SETS);
|
||||
log.time(TimingEnum.DISPLAY_SETS_TO_FIRST_IMAGE);
|
||||
log.time(TimingEnum.DISPLAY_SETS_TO_ALL_IMAGES);
|
||||
const displaySets = displaySetService.getActiveDisplaySets();
|
||||
|
||||
if (!displaySets || !displaySets.length) {
|
||||
|
||||
Reference in new issue
Block a user