Java 类com.squareup.picasso.StatsSnapshot 实例源码

项目:Green    文件:PicassoCard.java   
@Override
protected void onBindInformation() {
    StatsSnapshot info = Picasso.with(getContext())
            .getSnapshot();

    setSubHeading("Cache", String.format("%s / %s (%f percent)",
            humanReadableByteCount(info.size, true),
            humanReadableByteCount(info.maxSize, true),
            ((info.size * 100f) / info.maxSize)));

    setValue("\tHits", String.valueOf(info.cacheHits));
    setValue("\tMisses", String.valueOf(info.cacheMisses));

    setSubHeading("Decoded", String.valueOf(info.downloadCount));
    setValue("\tTotal", humanReadableByteCount(info.totalDownloadSize, true));
    setValue("\tAverage", humanReadableByteCount(info.averageDownloadSize, true));

    setSubHeading("Transformed", String.valueOf(info.transformedBitmapCount));
    setValue("\tTotal", humanReadableByteCount(info.totalTransformedBitmapSize, true));
    setValue("\tAverage", humanReadableByteCount(info.averageTransformedBitmapSize, true));
}
项目:superglue    文件:DebugView.java   
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));
}
项目:superglue    文件:DebugView.java   
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));
}
项目:android-tutorials-picasso    文件:UsageExampleLoggingAndStats.java   
/**
 * overarching stats of all Picasso requests
 */
private void printPicassoStatsSnapshot() {
    StatsSnapshot picassoStats = Picasso.with(context).getSnapshot();

    // you could set the debugger here to analyze the picassoStats object

    // or print the stats to Android Logcat
    Log.d("Picasso Stats", picassoStats.toString());
}
项目:DebugDrawer    文件:PicassoModule.java   
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));
}
项目:ponyville-live-android    文件:DebugAppContainer.java   
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));
}
项目:u2020-mvp    文件:DebugView.java   
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));
}
项目:u2020    文件:DebugView.java   
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));
}
项目:android-couchpotato    文件:DebugAppContainer.java   
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));
}