Skip to content

Commit 1382e56

Browse files
sjuddglide-copybara-robot
authored andcommitted
Add getters to Bitmap Pool for cache statistics.
PiperOrigin-RevId: 271557242
1 parent 1ddd1a2 commit 1382e56

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ repositories {
3131
}
3232
3333
dependencies {
34-
 implementation 'com.github.bumptech.glide:glide:4.10.0'
35-
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
34+
 implementation 'com.github.bumptech.glide:glide:4.9.0'
35+
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
3636
}
3737
```
3838

@@ -42,12 +42,12 @@ Or Maven:
4242
<dependency>
4343
<groupId>com.github.bumptech.glide</groupId>
4444
<artifactId>glide</artifactId>
45-
<version>4.10.0</version>
45+
<version>4.9.0</version>
4646
</dependency>
4747
<dependency>
4848
<groupId>com.github.bumptech.glide</groupId>
4949
<artifactId>compiler</artifactId>
50-
<version>4.10.0</version>
50+
<version>4.9.0</version>
5151
<optional>true</optional>
5252
</dependency>
5353
```

library/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/LruBitmapPool.java

+20
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,26 @@ public LruBitmapPool(long maxSize, Set<Bitmap.Config> allowedConfigs) {
6868
this(maxSize, getDefaultStrategy(), allowedConfigs);
6969
}
7070

71+
/** Returns the number of cache hits for bitmaps in the pool. */
72+
public long hitCount() {
73+
return hits;
74+
}
75+
76+
/** Returns the number of cache misses for bitmaps in the pool. */
77+
public long missCount() {
78+
return misses;
79+
}
80+
81+
/** Returns the number of bitmaps that have been evicted from the pool. */
82+
public long evictionCount() {
83+
return evictions;
84+
}
85+
86+
/** Returns the current size of the pool in bytes. */
87+
public long getCurrentSize() {
88+
return currentSize;
89+
}
90+
7191
@Override
7292
public long getMaxSize() {
7393
return maxSize;

0 commit comments

Comments
 (0)