Collecting performance metrics
- Dominant language
- Java
- Stars
- 35k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 8
Description
**Glide Version**: 4.15.1
**Integration libraries**: OkHttp3
**Issue details / Repro steps / Use case background**: I need to keep track of the image loading performance in the app on all the stages of image pipeline. For example for a given URL I would like to track:
1. Time to fetch from remote
2. Decode/encode/transcode time
3. Time to apply transformations
4. Overall time to process image request
For the fetching I was able to figure out how to do that - by implementing custom fetcher `AnalyticsStreamFetcher extends OkHttpStreamFetcher`. But for the others it is a bit less straightforward. In some cases Glide measures these timings internally like in [SourceGenerator.java#cacheData](https://github.com/bumptech/glide/blob/ebad66bf87742bf4afb545f73b9e7bf25bf72518/library/src/main/java/com/bumptech/glide/load/engine/SourceGenerator.java#L145) and logs them but end users don't have access to these timings unfortunately.
```java
Log.v(
TAG,
"Finished encoding source to cache"
+ ", key: "
+ newOriginalKey
+ ", data: "
+ dataToCache
+ ", encoder: "
+ encoder
+ ", duration: "
+ LogTime.getElapsedMillis(startTime));
}
```
Is there a recommended way to do that? Might be relevant to the issue #2235
Contributor guide
Assessment
This issue has not been assessed yet.