From b6e862af7b8491eb1659a0d674ee1937a04568d3 Mon Sep 17 00:00:00 2001 From: Brian Gitonga Marete Date: Wed, 12 Feb 2014 00:39:10 +0300 Subject: [PATCH] pkg/blobserver/encrypt: Log time it takes to read encryption metadata. We'll use this later on to see the effect of using blob streaming rather than enumeration. In particular, we will be looking for a significant speed-up with diskpacked when metadata processing uses streaming rather than enumeration. Change-Id: I8295d05d74a84518844237bc48d4f11db8ea14b0 --- pkg/blobserver/encrypt/encrypt.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/blobserver/encrypt/encrypt.go b/pkg/blobserver/encrypt/encrypt.go index 57d6af891..9c9340504 100644 --- a/pkg/blobserver/encrypt/encrypt.go +++ b/pkg/blobserver/encrypt/encrypt.go @@ -47,6 +47,7 @@ import ( "strconv" "strings" "sync" + "time" "camlistore.org/pkg/blob" "camlistore.org/pkg/blobserver" @@ -596,11 +597,12 @@ func newFromConfig(ld blobserver.Loader, config jsonconfig.Obj) (bs blobserver.S return nil, err } + start := time.Now() log.Printf("Reading encryption metadata...") if err := sto.readAllMetaBlobs(); err != nil { return nil, fmt.Errorf("Error scanning metadata on start-up: %v", err) } - log.Printf("Read all encryption metadata.") + log.Printf("Read all encryption metadata in %.3f seconds", time.Since(start).Seconds()) return sto, nil }