Skip to content
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

Refactor caching layers in dynamo collector #1616

Merged
merged 8 commits into from
Jun 30, 2016
Merged

Conversation

jml
Copy link
Contributor

@jml jml commented Jun 30, 2016

I wanted to better understand what was going on, so I refactored it.

Highlights:

  • S3 client code moved from dynamo_collector into a new file, and given same interface as MemcacheClient
  • NewDynamoDBCollector now takes both a memcache client and an s3 client, rather than being responsible for constructing both
  • FetchReports returns a map of fetched reports, making it easier to write back to the in-process cache

Lowlights:

  • We write back to the in-process cache after retrieving from the in-process cache
  • memcache constants now in prog/app.go
  • despite branch name, doesn't actually instrument

This change is Reviewable

@tomwilkie tomwilkie self-assigned this Jun 30, 2016
@@ -102,18 +91,17 @@ type DynamoDBCollector interface {

// ReportStore is a thing that we can get reports from.
type ReportStore interface {
FetchReports([]string) ([]report.Report, []string, error)
FetchReports([]string) (map[string]report.Report, []string, error)
}

type dynamoDBCollector struct {

This comment was marked as abuse.

This comment was marked as abuse.

@jml jml force-pushed the debug-instrument-memcache branch from a87dafd to baacaa8 Compare June 30, 2016 15:47
@jml
Copy link
Contributor Author

jml commented Jun 30, 2016

PTAL.

@tomwilkie
Copy link
Contributor

LGTM!

@jml jml merged commit 682edd3 into master Jun 30, 2016
@jml jml deleted the debug-instrument-memcache branch June 30, 2016 17:10
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.

2 participants