Start of camput files memstat flag, for Issue 18

Change-Id: I2b35bd9ed83e1fb899cf165ad82da95e16d0deba
This commit is contained in:
Brad Fitzpatrick 2011-09-28 19:08:17 -07:00
parent 2ec0a974b6
commit b966e55154
1 changed files with 8 additions and 0 deletions

View File

@ -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()