From b7c2cf8d15ac0889cd76c4aeac9c193102b484ae Mon Sep 17 00:00:00 2001 From: Matthew Johnson Date: Wed, 14 Feb 2018 13:27:03 -0800 Subject: [PATCH] Add timing information for chroot building step This timing should be printed to assist in evaluating the move to the new chroot builder. Signed-off-by: Matthew Johnson --- builder/builder.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/builder/builder.go b/builder/builder.go index cb92104..27c4928 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -1204,6 +1204,11 @@ func (b *Builder) BuildChroots(template *x509.Certificate, privkey *rsa.PrivateK // Generate the yum config file if it does not exist. // This takes the template and adds the relevant local rpm repo path if needed fmt.Println("Building chroots..") + + timer := &stopWatch{w: os.Stdout} + defer timer.WriteSummary(os.Stdout) + + timer.Start("BUILD CHROOTS") if _, err := os.Stat(b.YumConf); os.IsNotExist(err) { outfile, err := os.Create(b.YumConf) if err != nil { @@ -1323,6 +1328,8 @@ func (b *Builder) BuildChroots(template *x509.Certificate, privkey *rsa.PrivateK // TODO: Remove all the files-* entries since they're now copied into the noship dir // do code stuff here + timer.Stop() + return nil }