## Statistics

Statistics — Data statistics.

## Synopsis

    #include <libtracker-client/tracker.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);

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);

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);

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