com.squareup.picasso.StatsSnapshot Java Examples

The following examples show how to use com.squareup.picasso.StatsSnapshot. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PicassoModule.java    From DebugDrawer with Apache License 2.0 5 votes vote down vote up
private void refresh() {
    final StatsSnapshot snapshot = picasso.getSnapshot();
    final String size = getSizeString(snapshot.size);
    final String total = getSizeString(snapshot.maxSize);
    final int percentage = (int) ((1f * snapshot.size / snapshot.maxSize) * 100);
    cacheLabel.setText(size + " / " + total + " (" + percentage + "%)");
    cacheHitsLabel.setText(String.valueOf(snapshot.cacheHits));
    cacheMissesLabel.setText(String.valueOf(snapshot.cacheMisses));
    decodedLabel.setText(String.valueOf(snapshot.originalBitmapCount));
    decodedTotalLabel.setText(getSizeString(snapshot.totalOriginalBitmapSize));
    decodedAverageLabel.setText(getSizeString(snapshot.averageOriginalBitmapSize));
    transformedLabel.setText(String.valueOf(snapshot.transformedBitmapCount));
    transformedTotalLabel.setText(getSizeString(snapshot.totalTransformedBitmapSize));
    transformedAverageLabel.setText(getSizeString(snapshot.averageTransformedBitmapSize));
}
 
Example #2
Source File: DebugView.java    From u2020-mvp with Apache License 2.0 5 votes vote down vote up
private void refreshPicassoStats() {
    StatsSnapshot snapshot = picasso.getSnapshot();
    String size = getSizeString(snapshot.size);
    String total = getSizeString(snapshot.maxSize);
    int percentage = (int) ((1f * snapshot.size / snapshot.maxSize) * 100);
    picassoCacheSizeView.setText(size + " / " + total + " (" + percentage + "%)");
    picassoCacheHitView.setText(String.valueOf(snapshot.cacheHits));
    picassoCacheMissView.setText(String.valueOf(snapshot.cacheMisses));
    picassoDecodedView.setText(String.valueOf(snapshot.originalBitmapCount));
    picassoDecodedTotalView.setText(getSizeString(snapshot.totalOriginalBitmapSize));
    picassoDecodedAvgView.setText(getSizeString(snapshot.averageOriginalBitmapSize));
    picassoTransformedView.setText(String.valueOf(snapshot.transformedBitmapCount));
    picassoTransformedTotalView.setText(getSizeString(snapshot.totalTransformedBitmapSize));
    picassoTransformedAvgView.setText(getSizeString(snapshot.averageTransformedBitmapSize));
}
 
Example #3
Source File: DebugView.java    From u2020 with Apache License 2.0 5 votes vote down vote up
private void refreshPicassoStats() {
  StatsSnapshot snapshot = picasso.getSnapshot();
  String size = getSizeString(snapshot.size);
  String total = getSizeString(snapshot.maxSize);
  int percentage = (int) ((1f * snapshot.size / snapshot.maxSize) * 100);
  picassoCacheSizeView.setText(size + " / " + total + " (" + percentage + "%)");
  picassoCacheHitView.setText(String.valueOf(snapshot.cacheHits));
  picassoCacheMissView.setText(String.valueOf(snapshot.cacheMisses));
  picassoDecodedView.setText(String.valueOf(snapshot.originalBitmapCount));
  picassoDecodedTotalView.setText(getSizeString(snapshot.totalOriginalBitmapSize));
  picassoDecodedAvgView.setText(getSizeString(snapshot.averageOriginalBitmapSize));
  picassoTransformedView.setText(String.valueOf(snapshot.transformedBitmapCount));
  picassoTransformedTotalView.setText(getSizeString(snapshot.totalTransformedBitmapSize));
  picassoTransformedAvgView.setText(getSizeString(snapshot.averageTransformedBitmapSize));
}