获取磁盘缓存和内存缓存的信息
This commit is contained in:
parent
7ecc9faf9f
commit
bbb5819217
|
@ -380,4 +380,47 @@ export class ImageKnife {
|
|||
getEngineKeyImpl(): IEngineKey {
|
||||
return this.dispatcher.getEngineKeyImpl();
|
||||
}
|
||||
|
||||
// 获取磁盘和memory的情况
|
||||
public getMemoryMaxSize(): number {
|
||||
if (this.memoryCache instanceof MemoryLruCache) {
|
||||
return this.memoryCache.maxMemory;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public getCurrentMemoryCount(): number {
|
||||
if (this.memoryCache instanceof MemoryLruCache) {
|
||||
return this.memoryCache.size();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public getCurrentMemorySize(): number {
|
||||
if (this.memoryCache instanceof MemoryLruCache) {
|
||||
return this.memoryCache.currentMemory;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public getDiskMaxSize(): number {
|
||||
if (this.fileCache) {
|
||||
return this.fileCache.maxMemory;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public getCurrentDiskCount(): number {
|
||||
if (this.fileCache) {
|
||||
return this.fileCache.size();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public getCurrentDiskSize(): number {
|
||||
if (this.fileCache) {
|
||||
return this.fileCache.currentMemory;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue