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
@@ -4,8 +4,25 @@ const log = {
|
||||
info: console.log,
|
||||
trace: console.trace,
|
||||
debug: console.debug,
|
||||
time: console.time,
|
||||
timeEnd: console.timeEnd,
|
||||
time: key => {
|
||||
log.timingKeys[key] = true;
|
||||
console.time(key);
|
||||
},
|
||||
timeEnd: key => {
|
||||
if (!log.timingKeys[key]) {
|
||||
return;
|
||||
}
|
||||
log.timingKeys[key] = false;
|
||||
console.timeEnd(key);
|
||||
},
|
||||
// Store the timing keys to allow knowing whether or not to log events
|
||||
timingKeys: {
|
||||
// script time values are added during the index.html initial load,
|
||||
// before log (this file) is loaded, and the log
|
||||
// can't depend on the enums, so for this case recreate the string.
|
||||
// See TimingEnum for details
|
||||
scriptToView: true,
|
||||
},
|
||||
};
|
||||
|
||||
export default log;
|
||||
@@ -0,0 +1,24 @@
|
||||
export enum TimingEnum {
|
||||
// The time from when the users selects a study until the study metadata
|
||||
// is loaded (and the display sets are ready)
|
||||
STUDY_TO_DISPLAY_SETS = 'studyToDisplaySetsLoaded',
|
||||
|
||||
// The time from when the user selects a study until any viewport renders
|
||||
STUDY_TO_FIRST_IMAGE = 'studyToFirstImage',
|
||||
|
||||
// The time from when display sets are loaded until any viewport renders
|
||||
// an image.
|
||||
DISPLAY_SETS_TO_FIRST_IMAGE = 'displaySetsToFirstImage',
|
||||
|
||||
// The time from when display sets are loaded until all viewports have images
|
||||
DISPLAY_SETS_TO_ALL_IMAGES = 'displaySetsToAllImages',
|
||||
|
||||
// The time from when the user hits search until the worklist is displayed
|
||||
SEARCH_TO_LIST = 'searchToList',
|
||||
|
||||
// The time from when the html script first starts being evaluated (before
|
||||
// any other scripts or CSS is loaded), until the time that the first image
|
||||
// is viewed for viewer endpoints, or the time that the first search for studies
|
||||
// completes.
|
||||
SCRIPT_TO_VIEW = 'scriptToView',
|
||||
}
|
||||
@@ -19,6 +19,9 @@ export type * from './PanelModule';
|
||||
export type * from './IPubSub';
|
||||
export type * from './Color';
|
||||
|
||||
// Enum exports
|
||||
export * from './TimingEnum';
|
||||
|
||||
/**
|
||||
* Export the types used within the various services and managers, but
|
||||
* not the services/managers themselves, which are exported at the top level.
|
||||
|
||||
@@ -78,9 +78,12 @@ export default function getPixelSpacingInformation(instance) {
|
||||
pixelSpacing => pixelSpacing / EstimatedRadiographicMagnificationFactor
|
||||
);
|
||||
} else {
|
||||
log.info(
|
||||
'EstimatedRadiographicMagnificationFactor was not present. Unable to correct ImagerPixelSpacing.'
|
||||
);
|
||||
if (!instance._loggedSpacingMessage) {
|
||||
log.info(
|
||||
'EstimatedRadiographicMagnificationFactor was not present. Unable to correct ImagerPixelSpacing.'
|
||||
);
|
||||
instance._loggedSpacingMessage = true;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user