@@ -99,6 +99,10 @@ function getDisplayName(moduleName, filename) {
9999 return filename ;
100100}
101101
102+ function samplesToMilliseconds ( samples , data ) {
103+ return ( samples * data . stats . sample_interval_usec / 1000 ) . toFixed ( 2 ) ;
104+ }
105+
102106function selectFlamegraphData ( selectedThreadId = null ) {
103107 let baseData = isShowingElided ? elidedFlamegraphData : normalData ;
104108
@@ -255,12 +259,12 @@ function setupLogos() {
255259// Status Bar
256260// ============================================================================
257261
258- function updateStatusBar ( nodeData , rootValue ) {
262+ function updateStatusBar ( nodeData , rootValue , data ) {
259263 const funcname = resolveString ( nodeData . funcname ) || resolveString ( nodeData . name ) || "--" ;
260264 const filename = resolveString ( nodeData . filename ) || "" ;
261265 const moduleName = resolveString ( nodeData . module ) || "" ;
262266 const lineno = nodeData . lineno ;
263- const timeMs = ( nodeData . value / 1000 ) . toFixed ( 2 ) ;
267+ const timeMs = samplesToMilliseconds ( nodeData . value , data ) ;
264268 const percent = rootValue > 0 ? ( ( nodeData . value / rootValue ) * 100 ) . toFixed ( 1 ) : "0.0" ;
265269
266270 const brandEl = document . getElementById ( 'status-brand' ) ;
@@ -322,9 +326,9 @@ function createPythonTooltip(data) {
322326 . style ( "opacity" , 0 ) ;
323327 }
324328
325- const timeMs = ( d . data . value / 1000 ) . toFixed ( 2 ) ;
329+ const timeMs = samplesToMilliseconds ( d . data . value , data ) ;
326330 const selfSamples = d . data . self || 0 ;
327- const selfMs = ( selfSamples / 1000 ) . toFixed ( 2 ) ;
331+ const selfMs = samplesToMilliseconds ( selfSamples , data ) ;
328332 const percentage = ( ( d . data . value / data . value ) * 100 ) . toFixed ( 2 ) ;
329333 const relativePercentage = Math . min ( 100 , ( ( d . data . value / ( zoomedNodeValue ?? data . value ) ) * 100 ) ) . toFixed ( 2 ) ;
330334 const calls = d . data . calls || 0 ;
@@ -408,9 +412,9 @@ function createPythonTooltip(data) {
408412 // Differential stats section
409413 let diffSection = "" ;
410414 if ( d . data . diff !== undefined && d . data . baseline !== undefined ) {
411- const baselineSelf = ( d . data . baseline / 1000 ) . toFixed ( 2 ) ;
412- const currentSelf = ( ( d . data . self_time || 0 ) / 1000 ) . toFixed ( 2 ) ;
413- const diffMs = ( d . data . diff / 1000 ) . toFixed ( 2 ) ;
415+ const baselineSelf = samplesToMilliseconds ( d . data . baseline , data ) ;
416+ const currentSelf = samplesToMilliseconds ( d . data . self_time || 0 , data ) ;
417+ const diffMs = samplesToMilliseconds ( d . data . diff , data ) ;
414418 const diffPct = d . data . diff_pct ;
415419 const sign = d . data . diff >= 0 ? "+" : "" ;
416420 const diffClass = d . data . diff > 0 ? "regression" : ( d . data . diff < 0 ? "improvement" : "neutral" ) ;
@@ -508,7 +512,7 @@ function createPythonTooltip(data) {
508512 . style ( "opacity" , 1 ) ;
509513
510514 // Update status bar
511- updateStatusBar ( d . data , data . value ) ;
515+ updateStatusBar ( d . data , data . value , data ) ;
512516 } ;
513517
514518 pythonTooltip . hide = function ( ) {
0 commit comments