8000 Small refactor of gc/scheduler to remove import of metadata by dnephin · Pull Request #1956 · containerd/containerd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Small refactor of gc/scheduler to remove import of metadata #1956

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 3, 2018

Conversation

dnephin
Copy link
Contributor
@dnephin dnephin commented Jan 3, 2018

In the gc/scheduler package replace metadata.GCStats with an interface for exposing elapsed time. This change removes the need to import metadata from the scheduler package.

In the future the Stats interface can be expanded with a method to expose all of the stats, and the scheduler could be used with collections of things other than metadata.

// GarbageCollect starts garbage collection
func (m *DB) GarbageCollect(ctx context.Context) (stats GCStats, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably return nil, err now

@dnephin dnephin force-pushed the use-clockwork-for-testing-gc branch from 69ff032 to 51d9449 Compare January 3, 2018 19:34
Replace metadata.GCStats with an interface for exposing elapsed time

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin dnephin force-pushed the use-clockwork-for-testing-gc branch from 51d9449 to 06edd19 Compare January 3, 2018 19:36
@dmcgowan
Copy link
Member
dmcgowan commented Jan 3, 2018

Thanks for cleaning this up, I appreciate more loosely coupled packages. I wonder if we may need to communicate more clearly what the Elapsed represents for the metadata db, as it only represents the time the metadata database is write locked. This will require more thought in the future.

LGTM

@codecov-io
Copy link

Codecov Report

Merging #1956 into master will decrease coverage by 0.02%.
The diff coverage is 45%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1956      +/-   ##
=========================================
- Coverage   45.72%   45.7%   -0.03%     
=========================================
  Files          94      94              
  Lines        9301    9308       +7     
=========================================
+ Hits         4253    4254       +1     
- Misses       4345    4351       +6     
  Partials      703     703
Flag Coverage Δ
#linux 50.33% <47.36%> (-0.03%) ⬇️
#windows 40.5% <45%> (-0.03%) ⬇️
Impacted Files Coverage Δ
gc/gc.go 67.85% <ø> (ø) ⬆️
metadata/db.go 66.53% <42.85%> (-0.41%) ⬇️
gc/scheduler/scheduler.go 67.96% <46.15%> (-1.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e755ad...06edd19. Read the comment docs.

@stevvooe
Copy link
Member
stevvooe commented Jan 3, 2018

LGTM

@stevvooe stevvooe merged commit a85b1f8 into containerd:master Jan 3, 2018
@dnephin dnephin deleted the use-clockwork-for-testing-gc branch January 3, 2018 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0