@@ -210,7 +210,7 @@ class Main {
210
210
// Round to closest interval to make query faster.
211
211
this . startTime = new Date (
212
212
Math . round ( new Date ( ) . getTime ( ) / this . interval ) * this . interval -
213
- dateOffset
213
+ dateOffset
214
214
) ;
215
215
}
216
216
@@ -233,6 +233,15 @@ class Main {
233
233
this . previousSubmittedEvent = { } ;
234
234
// Dictionary to store previous submissions for each lambda function
235
235
this . previousLambdaPayload = { } ;
236
+
237
+ // Store previous errorId found in logs
238
+ this . prevErrorId = "" ;
239
+ // Flag to avoid getting notifications on first retrieval of logs
240
+ this . firstLogsRetrieved = false ;
241
+ // Store events from cloudwatchLogs
242
+ this . events = [ ] ;
243
+ // Allows use of .bell() function for notifications
244
+ this . notifier = new blessed . Program ( ) ;
236
245
}
237
246
238
247
setKeypresses ( ) {
@@ -339,17 +348,22 @@ class Main {
339
348
340
349
async updateGraphs ( ) {
341
350
if ( this . resourceTable . fullFuncName ) {
342
- this . data = await getLambdaMetrics ( this , this . resourceTable . fullFuncName , cloudwatch ) ;
343
- getLogEvents ( `/aws/lambda/${ this . resourceTable . fullFuncName } ` , cloudwatchLogs ) . then (
344
- ( data ) => {
345
- this . events = data ;
346
- updateLogContentsFromEvents ( this . lambdaLog , this . events ) ;
347
- checkLogsForErrors ( this . events , this ) ;
348
- this . setFirstLogsRetrieved ( true ) ;
349
-
350
- this . durationBarChart . updateData ( ) ;
351
- }
351
+ this . data = await getLambdaMetrics (
352
+ this ,
353
+ this . resourceTable . fullFuncName ,
354
+ cloudwatch
352
355
) ;
356
+ getLogEvents (
357
+ `/aws/lambda/${ this . resourceTable . fullFuncName } ` ,
358
+ cloudwatchLogs
359
+ ) . then ( ( data ) => {
360
+ this . events = data ;
361
+ updateLogContentsFromEvents ( this . lambdaLog , this . events ) ;
362
+ checkLogsForErrors ( this . events , this ) ;
363
+ this . setFirstLogsRetrieved ( true ) ;
364
+
365
+ this . durationBarChart . updateData ( ) ;
366
+ } ) ;
353
367
}
354
368
355
369
this . padInvocationsAndErrorsWithZeros ( ) ;
0 commit comments