@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));
}
java类com.squareup.picasso.StatsSnapshot的实例源码
PicassoCard.java 文件源码
项目:Green
阅读 19
收藏 0
点赞 0
评论 0
DebugView.java 文件源码
项目:superglue
阅读 22
收藏 0
点赞 0
评论 0
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));
}
DebugView.java 文件源码
项目:superglue
阅读 22
收藏 0
点赞 0
评论 0
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));
}
UsageExampleLoggingAndStats.java 文件源码
项目:android-tutorials-picasso
阅读 21
收藏 0
点赞 0
评论 0
/**
* 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());
}
PicassoModule.java 文件源码
项目:DebugDrawer
阅读 20
收藏 0
点赞 0
评论 0
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));
}
DebugAppContainer.java 文件源码
项目:ponyville-live-android
阅读 21
收藏 0
点赞 0
评论 0
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));
}
DebugView.java 文件源码
项目:u2020-mvp
阅读 22
收藏 0
点赞 0
评论 0
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));
}
DebugView.java 文件源码
项目:u2020
阅读 21
收藏 0
点赞 0
评论 0
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));
}
DebugAppContainer.java 文件源码
项目:android-couchpotato
阅读 20
收藏 0
点赞 0
评论 0
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));
}