@@ -224,9 +224,10 @@ var cmdCreate = &cli.Command{
224
224
225
225
t := export .TimeAtHeight (gtp , confidenceHeight , 30 * time .Second )
226
226
227
- logger . Infow ( "snapshot" , "snapshot_height" , height , "current_height" , expected , "confidence_height" , confidenceHeight , "run_at" , t )
228
-
227
+ // Snapshots started
228
+ logger . Infow ( "snapshot job started" , "snapshot_height" , height , "current_height" , expected , "confidence_height" , confidenceHeight , "run_at" , t )
229
229
time .Sleep (time .Until (t ))
230
+ bt := time .Now ()
230
231
231
232
tsk , err := cm .GetTipset (ctx , height )
232
233
if err != nil {
@@ -321,14 +322,18 @@ var cmdCreate = &cli.Command{
321
322
}
322
323
}()
323
324
325
+ var snapshotSize int64
326
+
324
327
if flagDiscard {
325
328
logger .Infow ("discarding output" )
326
329
io .Copy (ioutil .Discard , r )
330
+ snapshotSize = 0
327
331
328
332
if err := <- errCh ; err != nil {
329
333
return err
330
334
}
331
335
} else {
336
+
332
337
host := u .Hostname ()
333
338
port := u .Port ()
334
339
if port == "" {
@@ -359,7 +364,7 @@ var cmdCreate = &cli.Command{
359
364
return fmt .Errorf ("failed to upload object (%s): %w" , fmt .Sprintf ("%s%s.car" , flagNamePrefix , name ), err )
360
365
}
361
366
362
- logger .Infow ("upload" ,
367
+ logger .Infow ("snapshot upload" ,
363
368
"bucket" , info .Bucket ,
364
369
"key" , info .Key ,
365
370
"etag" , info .ETag ,
@@ -369,6 +374,7 @@ var cmdCreate = &cli.Command{
369
374
"expiration" , info .Expiration ,
370
375
"expiration_rule_id" , info .ExpirationRuleID ,
371
376
)
377
+ snapshotSize = info .Size
372
378
373
379
if err := <- errCh ; err != nil {
374
380
return err
@@ -398,7 +404,7 @@ var cmdCreate = &cli.Command{
398
404
return fmt .Errorf ("failed to write latest" , "object" , fmt .Sprintf ("%slatest" , flagNamePrefix ), "err" , err )
399
405
}
400
406
401
- logger .Infow ("upload" ,
407
+ logger .Infow ("latest upload" ,
402
408
"bucket" , info .Bucket ,
403
409
"key" , info .Key ,
404
410
"etag" , info .ETag ,
@@ -410,7 +416,7 @@ var cmdCreate = &cli.Command{
410
416
)
411
417
}
412
418
413
- logger .Infow ("finished" , "digiest" , fmt .Sprintf ("%x" , h .Sum (nil )))
419
+ logger .Infow ("snapshot job finished" , "digiest" , fmt .Sprintf ("%x" , h .Sum (nil )), "elapsed" , int64 ( time . Since ( bt ). Round ( time . Second ). Seconds ()), "size" , snapshotSize , "peer" , peerID )
414
420
415
421
return nil
416
422
},
0 commit comments