Skip to content

Commit

Permalink
Add getters to Bitmap Pool for cache statistics.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 271557242
  • Loading branch information
sjudd authored and glide-copybara-robot committed Sep 27, 2019
1 parent 1ddd1a2 commit 1382e56
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ repositories {
}
dependencies {
 implementation 'com.github.bumptech.glide:glide:4.10.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
 implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
```

Expand All @@ -42,12 +42,12 @@ Or Maven:
<dependency>
<groupId>com.github.bumptech.glide</groupId>
<artifactId>glide</artifactId>
<version>4.10.0</version>
<version>4.9.0</version>
</dependency>
<dependency>
<groupId>com.github.bumptech.glide</groupId>
<artifactId>compiler</artifactId>
<version>4.10.0</version>
<version>4.9.0</version>
<optional>true</optional>
</dependency>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,26 @@ public LruBitmapPool(long maxSize, Set<Bitmap.Config> allowedConfigs) {
this(maxSize, getDefaultStrategy(), allowedConfigs);
}

/** Returns the number of cache hits for bitmaps in the pool. */
public long hitCount() {
return hits;
}

/** Returns the number of cache misses for bitmaps in the pool. */
public long missCount() {
return misses;
}

/** Returns the number of bitmaps that have been evicted from the pool. */
public long evictionCount() {
return evictions;
}

/** Returns the current size of the pool in bytes. */
public long getCurrentSize() {
return currentSize;
}

@Override
public long getMaxSize() {
return maxSize;
Expand Down

0 comments on commit 1382e56

Please sign in to comment.