Akonadi::Server::CollectionStatistics

Search for usage in LXR

Akonadi::Server::CollectionStatistics Class Reference

#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()

CollectionStatistics::CollectionStatistics ( bool prefetch = true)
explicit

Definition at line 20 of file server/storage/collectionstatistics.cpp.

Member Function Documentation

◆ calculateCollectionStatistics()

CollectionStatistics::Statistics CollectionStatistics::calculateCollectionStatistics ( const Collection & col)
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()

QueryBuilder CollectionStatistics::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

QHash<qint64, Statistics> Akonadi::Server::CollectionStatistics::mCache
protected

Definition at line 58 of file server/storage/collectionstatistics.h.

◆ mCacheLock

QMutex Akonadi::Server::CollectionStatistics::mCacheLock
protected

Definition at line 57 of file server/storage/collectionstatistics.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Sep 27 2024 11:50:58 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.