mirror of
https://github.com/LBRYFoundation/reflector.go.git
synced 2025-08-23 17:27:25 +00:00
export fields
This commit is contained in:
parent
557c595e90
commit
390d2b1eec
1 changed files with 14 additions and 14 deletions
|
@ -25,7 +25,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Summary struct {
|
type Summary struct {
|
||||||
total, alreadyStored, sd, blob, err int
|
Total, AlreadyStored, Sd, Blob, Err int
|
||||||
}
|
}
|
||||||
|
|
||||||
type Uploader struct {
|
type Uploader struct {
|
||||||
|
@ -61,7 +61,7 @@ func (u *Uploader) Upload(dirOrFilePath string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
u.count.total = len(paths)
|
u.count.Total = len(paths)
|
||||||
|
|
||||||
hashes := make([]string, len(paths))
|
hashes := make([]string, len(paths))
|
||||||
for i, p := range paths {
|
for i, p := range paths {
|
||||||
|
@ -76,10 +76,10 @@ func (u *Uploader) Upload(dirOrFilePath string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
u.count.alreadyStored = len(exists)
|
u.count.AlreadyStored = len(exists)
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Infof("%d new blobs to upload", u.count.total-u.count.alreadyStored)
|
log.Infof("%d new blobs to upload", u.count.Total-u.count.AlreadyStored)
|
||||||
|
|
||||||
workerWG := sync.WaitGroup{}
|
workerWG := sync.WaitGroup{}
|
||||||
pathChan := make(chan string)
|
pathChan := make(chan string)
|
||||||
|
@ -120,11 +120,11 @@ Upload:
|
||||||
u.stopper.Stop()
|
u.stopper.Stop()
|
||||||
|
|
||||||
log.Infoln("SUMMARY")
|
log.Infoln("SUMMARY")
|
||||||
log.Infof("%d blobs total", u.count.total)
|
log.Infof("%d blobs total", u.count.Total)
|
||||||
log.Infof("%d blobs already stored", u.count.alreadyStored)
|
log.Infof("%d blobs already stored", u.count.AlreadyStored)
|
||||||
log.Infof("%d SD blobs uploaded", u.count.sd)
|
log.Infof("%d SD blobs uploaded", u.count.Sd)
|
||||||
log.Infof("%d content blobs uploaded", u.count.blob)
|
log.Infof("%d content blobs uploaded", u.count.Blob)
|
||||||
log.Infof("%d errors encountered", u.count.err)
|
log.Infof("%d errors encountered", u.count.Err)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -200,15 +200,15 @@ func (u *Uploader) counter() {
|
||||||
}
|
}
|
||||||
switch incrementType {
|
switch incrementType {
|
||||||
case sdInc:
|
case sdInc:
|
||||||
u.count.sd++
|
u.count.Sd++
|
||||||
case blobInc:
|
case blobInc:
|
||||||
u.count.blob++
|
u.count.Blob++
|
||||||
case errInc:
|
case errInc:
|
||||||
u.count.err++
|
u.count.Err++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (u.count.sd+u.count.blob)%50 == 0 {
|
if (u.count.Sd+u.count.Blob)%50 == 0 {
|
||||||
log.Infof("%d of %d done (%s elapsed, %.3fs per blob)", u.count.sd+u.count.blob, u.count.total-u.count.alreadyStored, time.Since(start).String(), time.Since(start).Seconds()/float64(u.count.sd+u.count.blob))
|
log.Infof("%d of %d done (%s elapsed, %.3fs per blob)", u.count.Sd+u.count.Blob, u.count.Total-u.count.AlreadyStored, time.Since(start).String(), time.Since(start).Seconds()/float64(u.count.Sd+u.count.Blob))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue