Pre Merge pull request !335 from zhyoki/zh/get_memory_info
This commit is contained in:
commit
5a84523ebb
|
@ -380,4 +380,47 @@ export class ImageKnife {
|
||||||
getEngineKeyImpl(): IEngineKey {
|
getEngineKeyImpl(): IEngineKey {
|
||||||
return this.dispatcher.getEngineKeyImpl();
|
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