This repository was archived by the owner on Jun 26, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed
Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ class Query extends React.Component {
3535 backgroundColor : statusColors [ status ] || statusColors . error ,
3636 } ;
3737
38+ const start = data . get ( 'start' ) ;
39+ const end = data . get ( 'end' ) ;
40+
3841 return (
3942 < tr onClick = { this . props . onSelect } style = { containerStyle } >
4043 < td style = { styles . tdFirst } >
@@ -44,10 +47,10 @@ class Query extends React.Component {
4447 { data . get ( 'name' ) }
4548 </ td >
4649 < td style = { styles . td } >
47- { new Date ( data . get ( ' start' ) ) . toLocaleTimeString ( ) }
50+ { Math . round ( start ) / 1000 } s
4851 </ td >
4952 < td style = { styles . td } >
50- { data . get ( ' end' ) - data . get ( ' start' ) } ms
53+ { Math . round ( end - start ) } ms
5154 </ td >
5255 </ tr >
5356 ) ;
Original file line number Diff line number Diff line change @@ -54,11 +54,14 @@ class QueryViewer {
5454 </ DetailPaneSection > ;
5555 }
5656
57+ const start = data . get ( 'start' ) ;
58+ const end = data . get ( 'end' ) ;
59+
5760 return (
5861 < DetailPane header = { data . get ( 'type' ) + ': ' + data . get ( 'name' ) } >
5962 < DetailPaneSection title = "Start" >
6063 < div >
61- { new Date ( data . get ( ' start' ) ) . toLocaleTimeString ( ) }
64+ { Math . round ( start ) / 1000 } s since page load
6265 </ div >
6366 </ DetailPaneSection >
6467 < DetailPaneSection title = "Status" >
@@ -68,7 +71,7 @@ class QueryViewer {
6871 </ DetailPaneSection >
6972 < DetailPaneSection title = "Duration" >
7073 < div >
71- { data . get ( ' end' ) - data . get ( ' start' ) } ms
74+ { Math . round ( end - start ) } ms
7275 </ div >
7376 </ DetailPaneSection >
7477 < DetailPaneSection title = "Query" >
Original file line number Diff line number Diff line change @@ -62,22 +62,22 @@ function installRelayHook(window: Object) {
6262 response => {
6363 emit ( 'relay:success' , {
6464 id : id ,
65- end : Date . now ( ) ,
65+ end : performance . now ( ) ,
6666 response : response . response ,
6767 } ) ;
6868 } ,
6969 error => {
7070 emit ( 'relay:failure' , {
7171 id : id ,
72- end : Date . now ( ) ,
72+ end : performance . now ( ) ,
7373 error : error ,
7474 } ) ;
7575 } ,
7676 ) ;
7777 return {
7878 id : id ,
7979 name : request . getDebugName ( ) ,
80- start : Date . now ( ) ,
80+ start : performance . now ( ) ,
8181 text : request . getQueryString ( ) ,
8282 type : type ,
8383 variables : request . getVariables ( ) ,
You can’t perform that action at this time.
0 commit comments