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:
6
gc/gc.go
6
gc/gc.go
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user