From b966e55154136ec037f39c479a09e5d32d9bd60e Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 28 Sep 2011 19:08:17 -0700 Subject: [PATCH] Start of camput files memstat flag, for Issue 18 Change-Id: I2b35bd9ed83e1fb899cf165ad82da95e16d0deba --- clients/go/camput/files.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clients/go/camput/files.go b/clients/go/camput/files.go index 5988a518b..5c800d677 100644 --- a/clients/go/camput/files.go +++ b/clients/go/camput/files.go @@ -34,6 +34,9 @@ type fileCmd struct { rollSplits bool havecache, statcache bool + + // Go into in-memory stats mode only; doesn't actually upload. + memstats bool } func init() { @@ -46,6 +49,7 @@ func init() { flags.BoolVar(&cmd.havecache, "statcache", false, "Use the stat cache, assuming unchanged files already uploaded in the past are still there. Fast, but potentially dangerous.") flags.BoolVar(&cmd.statcache, "havecache", false, "Use the 'have cache', a cache keeping track of what blobs the remote server should already have from previous uploads.") flags.BoolVar(&cmd.rollSplits, "rolling", false, "Use rolling checksum file splits.") + flags.BoolVar(&cmd.memstats, "debug-memstats", false, "Enter debug in-memory mode; collecting stats only. Doesn't upload anything.") flagCacheLog = flags.Bool("logcache", false, "log caching details") @@ -74,6 +78,10 @@ func (c *fileCmd) RunCommand(up *Uploader, args []string) os.Error { if c.tag != "" && !c.makePermanode { return UsageError("Can't set tag without using --permanode") } + if c.memstats { + // TODO(bradfitz): implement + return os.NewError("TODO(bradfitz): implement") + } if c.statcache { cache := NewFlatStatCache()