Branch: Tag:

2017-02-23

2017-02-23 13:54:28 by Marcus Wellhardh <wellhard@roxen.com>

RAM-cache: Added byte_add_count to CacheManager.

Fixes some of [WS-19].

254:    int entry_add_count;    //! Number of entries added since this cache manager was created.    +  int byte_add_count; +  //! Number of bytes added since this cache manager was created. +     mapping(string:mapping(mixed:CacheEntry)) lookup = ([]);    //! Lookup mapping on the form @expr{(["cache_name": ([key: data])])@}.    //!
363:    cs->size += entry->size;    size += entry->size;    recent_added_bytes += entry->size; +  byte_add_count += entry->size;       if (!(++entry_add_count & 0x3fff)) // = 16383    update_size_limit();
748:    cs->size += size_diff;    size += size_diff;    recent_added_bytes += size_diff; +  byte_add_count += size_diff;    }    }