Merge pull request #546 from fkautz/pr_out_adding_debug_statements_for_testing

This commit is contained in:
Frederick F. Kautz IV 2015-04-29 21:15:12 -07:00
commit 446a137904
1 changed files with 3 additions and 1 deletions

View File

@ -309,6 +309,7 @@ func (memory *memoryDriver) CreateObject(bucket, key, contentType, expectedMD5Su
if memory.totalSize > memory.maxSize {
memory.objects.RemoveOldest()
}
log.Println("Size:", memory.totalSize)
memory.lock.Unlock()
return nil
}
@ -492,7 +493,8 @@ func (memory *memoryDriver) GetObjectMetadata(bucket, key, prefix string) (drive
func (memory *memoryDriver) evictObject(key lru.Key, value interface{}) {
k := key.(string)
memory.totalSize = memory.totalSize - uint64(memory.objectMetadata[k].metadata.Size)
log.Println("evicting:", k)
log.Println("evicting:", k, memory.objectMetadata[k].metadata.Size)
log.Println("Size:", memory.totalSize)
delete(memory.objectMetadata, k)
}