Small refactor of gc/scheduler to remove import of metadata

Replace metadata.GCStats with an interface for exposing elapsed time

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
Daniel Nephin
2018-01-03 14:15:07 -05:00
parent e479165a38
commit 06edd193ef
5 changed files with 52 additions and 29 deletions

View File

@@ -8,6 +8,7 @@ package gc
import (
"context"
"sync"
"time"
)
// ResourceType represents type of resource at a node
@@ -21,6 +22,11 @@ type Node struct {
Key string
}
// Stats about a garbage collection run
type Stats interface {
Elapsed() time.Duration
}
// Tricolor implements basic, single-thread tri-color GC. Given the roots, the
// complete set and a refs function, this function returns a map of all
// reachable objects.