@@ -63,18 +63,43 @@ export class CustomSourceList extends LocalSourceList {
63
63
const startTime = process . hrtime ( )
64
64
const result = await getQuoteSuper ( request , sourceId )
65
65
const elapsedSeconds = parseHrtimeToSeconds ( process . hrtime ( startTime ) )
66
- if ( elapsedSeconds > LOG_SLOW_QUERY_TIMEOUT_SECONDS ) {
67
- const { chainId, sellToken, buyToken, order } = request
68
- const requestGist = {
69
- chainId,
70
- sellToken,
71
- buyToken,
72
- order,
73
- }
66
+ // if (elapsedSeconds > LOG_SLOW_QUERY_TIMEOUT_SECONDS) {
67
+ // const { chainId, sellToken, buyToken, order } = request
68
+ // const requestGist = {
69
+ // chainId,
70
+ // sellToken,
71
+ // buyToken,
72
+ // order,
73
+ // }
74
+ // console.log(
75
+ // `SLOW QUERY: ${sourceId} ${elapsedSeconds}s ${stringify(requestGist)}`,
76
+ // )
77
+ // }
78
+ const { chainId, sellToken, buyToken, order } = request
79
+ const requestGist = {
80
+ chainId,
81
+ sellToken,
82
+ buyToken,
83
+ order,
84
+ }
85
+ if ( elapsedSeconds > 10 ) {
86
+ console . log (
87
+ `SLOW QUERY [10]: ${ sourceId } ${ elapsedSeconds } s ${ stringify ( requestGist ) } ` ,
88
+ )
89
+ } else if ( elapsedSeconds > 5 ) {
90
+ console . log (
91
+ `SLOW QUERY [5]: ${ sourceId } ${ elapsedSeconds } s ${ stringify ( requestGist ) } ` ,
92
+ )
93
+ } else if ( elapsedSeconds > 3 ) {
94
+ console . log (
95
+ `SLOW QUERY [3]: ${ sourceId } ${ elapsedSeconds } s ${ stringify ( requestGist ) } ` ,
96
+ )
97
+ } else if ( elapsedSeconds > 1 ) {
74
98
console . log (
75
- `SLOW QUERY: ${ sourceId } ${ elapsedSeconds } s ${ stringify ( requestGist ) } ` ,
99
+ `SLOW QUERY [1] : ${ sourceId } ${ elapsedSeconds } s ${ stringify ( requestGist ) } ` ,
76
100
)
77
101
}
102
+
78
103
return result
79
104
}
80
105
}
0 commit comments