예제 #1
0
func describe(s *serieslyclient.Seriesly, dbs ...string) <-chan *serieslyclient.DBInfo {
	rv := make(chan *serieslyclient.DBInfo)
	go func() {
		defer close(rv)
		for _, db := range dbs {
			di, err := s.DB(db).Info()
			maybeFatal(err, "Couldn't fetch info for %v: %v", db, err)
			di.DBName = db
			rv <- di
		}
	}()
	return rv
}
예제 #2
0
func dump(wg *sync.WaitGroup, s *serieslyclient.Seriesly, ch <-chan string) {
	defer wg.Done()

	t := time.Now()
	for db := range ch {
		start := time.Now()
		vlog("Dumping %v", db)
		n, err := dumpOne(s.DB(db), t)
		maybeFatal(err, "Error dumping %v: %v", db, err)

		if !*noop {
			vlog("Dumped %v of %v in %v",
				humanize.Bytes(uint64(n)), db, time.Since(start))
		}
	}
}