def get(self): cache_stats = caching_services.get_memory_cache_stats() self.render_json({ 'total_allocation': cache_stats.total_allocated_in_bytes, 'peak_allocation': cache_stats.peak_memory_usage_in_bytes, 'total_keys_stored': cache_stats.total_number_of_keys_stored })
def test_retrieved_memory_profile_contains_correct_elements(self) -> None: memory_profile = caching_services.get_memory_cache_stats() self.assertIsInstance(memory_profile, caching_domain.MemoryCacheStats) self.assertIsNotNone(memory_profile.total_allocated_in_bytes) self.assertIsNotNone(memory_profile.peak_memory_usage_in_bytes) self.assertIsNotNone(memory_profile.total_number_of_keys_stored)