Statistics

Statistics — Data statistics.

Synopsis

#include <libtracker-client/tracker-client.h>

void                (*TrackerReplyGPtrArray)            (GPtrArray *result,
                                                         GError *error,
                                                         gpointer user_data);
GPtrArray *         tracker_statistics_get              (TrackerClient *client,
                                                         GError **error);
guint               tracker_statistics_get_async        (TrackerClient *client,
                                                         TrackerReplyGPtrArray callback,
                                                         gpointer user_data);

Description

This API is meant to get statistics about the stored data.

Details

TrackerReplyGPtrArray ()

void                (*TrackerReplyGPtrArray)            (GPtrArray *result,
                                                         GError *error,
                                                         gpointer user_data);

Warning

TrackerReplyGPtrArray is deprecated and should not be used in newly-written code.

The result is returned as a GPtrArray containing an array of GStrv with the results from the query unless there is an error. If there is an error the error is populated with the details. The user_data is provided in the callback.

result :

a GPtrArray with the results of the query.

error :

a GError.

user_data :

a gpointer for user data.

tracker_statistics_get ()

GPtrArray *         tracker_statistics_get              (TrackerClient *client,
                                                         GError **error);

Warning

tracker_statistics_get has been deprecated since version 0.10 and should not be used in newly-written code. Use tracker_sparql_stats() in libtracker-sparql instead.

Requests statistics about each class in the ontology (for example, nfo:Image and nmm:Photo which indicate the number of images and the number of photos).

The returned GPtrArray contains an array of GStrv which have 2 strings. The first is the class (e.g. nfo:Image), the second is the count for that class.

This API call is completely synchronous so it may block.

client :

a TrackerClient.

error :

a GError.

Returns :

A GPtrArray with the statistics which must be freed using g_ptr_array_free().

Since 0.8


tracker_statistics_get_async ()

guint               tracker_statistics_get_async        (TrackerClient *client,
                                                         TrackerReplyGPtrArray callback,
                                                         gpointer user_data);

Warning

tracker_statistics_get_async has been deprecated since version 0.10 and should not be used in newly-written code. Use tracker_sparql_stats_async() in libtracker-sparql instead.

This behaves exactly as tracker_statistics_get() but asynchronously.

client :

a TrackerClient.

callback :

a TrackerReplyGPtrArray to be used when the data is available.

user_data :

user data to pass to callback.

Returns :

A guint representing the operation ID. See tracker_cancel_call(). In the event of failure, 0 is returned.

Since 0.8