Akonadi::Server::CollectionStatistics
#include <collectionstatistics.h>
Public Member Functions | |
CollectionStatistics (bool prefetch=true) | |
void | expireCache () |
void | invalidateCollection (const Collection &col) |
void | itemAdded (const Collection &col, qint64 size, bool seen) |
void | itemsSeenChanged (const Collection &col, qint64 seenCount) |
Statistics | statistics (const Collection &col) |
Protected Member Functions | |
virtual Statistics | calculateCollectionStatistics (const Collection &col) |
QueryBuilder | prepareGenericQuery () |
Protected Attributes | |
QHash< qint64, Statistics > | mCache |
QMutex | mCacheLock |
Detailed Description
Provides cache for collection statistics.
Collection statistics are requested very often, so to take some load from the database we cache the results until the statistics are invalidated (see NotificationCollector, which takes care for invalidating the statistics).
The cache (together with optimization of the actual SQL query) seems to massively improve initial folder listing on system start (when IO and CPU loads are very high).
Definition at line 31 of file server/storage/collectionstatistics.h.
Constructor & Destructor Documentation
◆ CollectionStatistics()
|
explicit |
Definition at line 20 of file server/storage/collectionstatistics.cpp.
Member Function Documentation
◆ calculateCollectionStatistics()
|
protectedvirtual |
Definition at line 184 of file server/storage/collectionstatistics.cpp.
◆ expireCache()
void CollectionStatistics::expireCache | ( | ) |
Definition at line 117 of file server/storage/collectionstatistics.cpp.
◆ invalidateCollection()
void CollectionStatistics::invalidateCollection | ( | const Collection & | col | ) |
Definition at line 107 of file server/storage/collectionstatistics.cpp.
◆ itemAdded()
void CollectionStatistics::itemAdded | ( | const Collection & | col, |
qint64 | size, | ||
bool | seen ) |
Definition at line 75 of file server/storage/collectionstatistics.cpp.
◆ itemsSeenChanged()
void CollectionStatistics::itemsSeenChanged | ( | const Collection & | col, |
qint64 | seenCount ) |
Definition at line 92 of file server/storage/collectionstatistics.cpp.
◆ prepareGenericQuery()
|
protected |
Definition at line 133 of file server/storage/collectionstatistics.cpp.
◆ statistics()
CollectionStatistics::Statistics CollectionStatistics::statistics | ( | const Collection & | col | ) |
Definition at line 123 of file server/storage/collectionstatistics.cpp.
Member Data Documentation
◆ mCache
|
protected |
Definition at line 58 of file server/storage/collectionstatistics.h.
◆ mCacheLock
|
protected |
Definition at line 57 of file server/storage/collectionstatistics.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:31:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.