-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add stats for time spent fetching data while searching snapshots #51866
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
Add stats for time spent fetching data while searching snapshots #51866
Conversation
This commit builds on elastic#51637, adding tracking of the total time spent fetching data from the blob store and a linear regression model for these fetches.
Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore) |
I'm not sure the linear regression is actually useful here. Since we're tracking stats on a file-by-file basis, essentially every fetch will be the same size, which stops us from building a meaningful model of the fetch time as a function of size. Maybe we just want to track the total took time? Possibly min and max too? |
I tend to agree with you, unless we implement different range sizes per files (which we could do easily) I'm not sure the linear regression is very useful. Maybe we could reuse the existing counters and track the total/min/max took times as you suggested. |
…e-snapshots-track-time-spent-fetching-from-blob-store
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated following discussions on other channels; this is ready for a proper review now.
@@ -106,7 +106,7 @@ public void onRepositoriesModule(RepositoriesModule repositoriesModule) { | |||
@Override | |||
public Map<String, DirectoryFactory> getDirectoryFactories() { | |||
return Map.of(SearchableSnapshotRepository.SNAPSHOT_DIRECTORY_FACTORY_KEY, | |||
SearchableSnapshotRepository.newDirectoryFactory(repositoriesService::get, cacheService::get)); | |||
SearchableSnapshotRepository.newDirectoryFactory(repositoriesService::get, cacheService::get, System::nanoTime)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using System::nanoTime
since we need finer resolution than ThreadPool::relativeTimeInNanos
offers.
...main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotShardStats.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/searchable-snapshots/qa/rest/src/test/resources/rest-api-spec/test/stats.yml
Show resolved
Hide resolved
...napshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/cache/CacheDirectory.java
Show resolved
Hide resolved
...main/java/org/elasticsearch/xpack/core/searchablesnapshots/SearchableSnapshotShardStats.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks David!
This commit builds on #51637, adding tracking of the total time spent fetching
data from the blob store.
Relates #50999.