Last active
July 12, 2017 21:22
-
-
Save ttaylorr/21d05c2a6f727be00badce4ccd2d2aef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"runtime" | |
"time" | |
"github.com/git-lfs/git-lfs/git/odb/pack" | |
"github.com/git-lfs/git-lfs/tools/humanize" | |
) | |
func main() { | |
done := make(chan struct{}) | |
go func() { | |
for { | |
select { | |
case <-time.After(100 * time.Millisecond): | |
var stat runtime.MemStats | |
runtime.GC() | |
runtime.ReadMemStats(&stat) | |
fmt.Fprintf(os.Stderr, "System:\t%s\n", humanize.FormatBytes(stat.Sys)) | |
case <-done: | |
return | |
} | |
} | |
}() | |
for _, fpath := range os.Args { | |
f, err := os.Open(fpath) | |
if err != nil { | |
panic(err.Error()) | |
} | |
if _, err := pack.DecodeIndex(f); err != nil { | |
panic(err.Error()) | |
} | |
f.Close() | |
} | |
close(done) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment