@@ -12,6 +12,7 @@ import (
12
12
"os/exec"
13
13
"path/filepath"
14
14
"strings"
15
+ "time"
15
16
16
17
"github.com/gitpod-io/gitpod/common-go/log"
17
18
"github.com/gitpod-io/gitpod/content-service/pkg/archive"
@@ -308,11 +309,14 @@ func (s3st *s3Storage) download(ctx context.Context, destination string, obj str
308
309
tempFile .Name (),
309
310
}
310
311
cmd := exec .Command ("s5cmd" , args ... )
312
+ downloadStart := time .Now ()
311
313
out , err := cmd .CombinedOutput ()
312
314
if err != nil {
313
315
log .WithError (err ).WithField ("out" , string (out )).Error ("unexpected error downloading file" )
314
- return true , xerrors .Errorf ("unexpected error downloading file" )
316
+ return false , xerrors .Errorf ("unexpected error downloading file" )
315
317
}
318
+ downloadDuration := time .Since (downloadStart )
319
+ log .WithField ("downloadDuration" , downloadDuration .String ()).Info ("S3 download duration" )
316
320
317
321
tempFile , err = os .Open (tempFile .Name ())
318
322
if err != nil {
@@ -322,10 +326,13 @@ func (s3st *s3Storage) download(ctx context.Context, destination string, obj str
322
326
defer os .Remove (tempFile .Name ())
323
327
defer tempFile .Close ()
324
328
329
+ extractStart := time .Now ()
325
330
err = archive .ExtractTarbal (ctx , tempFile , destination , archive .WithUIDMapping (mappings ), archive .WithGIDMapping (mappings ))
326
331
if err != nil {
327
332
return true , xerrors .Errorf ("tar %s: %s" , destination , err .Error ())
328
333
}
334
+ extractDuration := time .Since (extractStart )
335
+ log .WithField ("extractdDuration" , extractDuration .String ()).Info ("tarbar extraction duration" )
329
336
330
337
return true , nil
331
338
}
0 commit comments