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

adds batch based metrics #2510

Merged
merged 2 commits into from
Aug 19, 2020
Merged

Conversation

owen-d
Copy link
Member

@owen-d owen-d commented Aug 14, 2020

This should help us prove which parts of the batching code deserve attention for improvement.

@codecov-commenter
Copy link

Codecov Report

Merging #2510 into master will increase coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2510      +/-   ##
==========================================
+ Coverage   63.45%   63.56%   +0.10%     
==========================================
  Files         163      163              
  Lines       14263    14305      +42     
==========================================
+ Hits         9051     9093      +42     
- Misses       4499     4500       +1     
+ Partials      713      712       -1     
Impacted Files Coverage Δ
pkg/storage/batch.go 85.79% <100.00%> (+1.59%) ⬆️
pkg/storage/store.go 67.39% <100.00%> (+0.91%) ⬆️
pkg/querier/queryrange/downstreamer.go 95.87% <0.00%> (-2.07%) ⬇️
pkg/logql/evaluator.go 92.88% <0.00%> (+0.40%) ⬆️

Copy link
Contributor

@sandeepsukhani sandeepsukhani left a comment

Choose a reason for hiding this comment

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

Looks good to me with some minor suggestions.

filteredRefs: promauto.With(r).NewCounter(prometheus.CounterOpts{
Namespace: "loki",
Subsystem: "store",
Name: "chunk_refs_filtered_downloaded_total",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we call this something like chunk_refs_post_filtering_total because the refs are downloaded already, we are just filtering them? Just a suggestion, would love to hear your thoughts on it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think on this same line of thinking chunk_refs_pre_filtering and chunk_refs_post_filtering seem intuitive to me?

Also the "Subsystem" store would index make this easier to understand in the future?

batches: promauto.With(r).NewHistogram(prometheus.HistogramOpts{
Namespace: "loki",
Subsystem: "store",
Name: "effective_batch_size",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we prefix the name with chunks or maybe call it chunks_per_batch_post_filtering ?

@@ -510,7 +567,7 @@ func fetchChunkBySeries(ctx context.Context, chunks []*LazyChunk, matchers []*la

// Now that we have the first chunk for each series loaded,
// we can proceed to filter the series that don't match.
chksBySeries = filterSeriesByMatchers(chksBySeries, matchers)
chksBySeries = filterSeriesByMatchers(chksBySeries, matchers, metrics)

var allChunks []*LazyChunk
for _, series := range chksBySeries {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wondering what a good way would be to also track how many series there were.

I'm not sure this is a fully vetted thought yet but part of me thinks we will want to know something about the number of series involved too.

@slim-bean slim-bean merged commit 6b6b33f into grafana:master Aug 19, 2020
@cyriltovena
Copy link
Contributor

Cool stuff !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants