# dkim_getcachestats()

[back to index]

SYNOPSIS

    #include <dkim.h>

    DKIM_STAT dkim_getcachestats(
    			u_int *queries,
    			u_int *hits,
    			u_int *expired);
    );

Retrieve libopendkim caching statistics.

DESCRIPTION

Called When | `dkim_getcachestats()` can be called at any time.

ARGUMENTS

Argument | Description
--- | ---
queries | Pointer to an unsigned integer which will receive the number of queries libopendkim has processed. This can be NULL if that datum is not of interest to the caller.
hits | Pointer to an unsigned integer which will receive the number of queries which were found in the cache being maintained by the library. This can be NULL if that datum is not of interest to the caller.
expired | Pointer to an unsigned integer which will receive the number of queries which were found in the cache but whose time-to-live value had expired and thus a re-query was required. This can be NULL if that datum is not of interest to the caller.

RETURN VALUES

- DKIM_STAT_OK -- requested values returned
- DKIM_STAT_NOTIMPLEMENT -- library was not compiled with caching enabled

NOTES

- All values can be zero even if caching is not enabled. Use `dkim_flush_cache()` to see if caching is in effect.
- Caching is enabled via the setting of the `DKIM_LIBFLAGS_CACHE` library option using the `dkim_options()` function.
- Caching must be enabled in the library at compile time since it establishes an extra library dependency.

Copyright (c) 2007 Sendmail, Inc. and its suppliers. All rights reserved.
Copyright (c) 2009-2011, The OpenDKIM Project. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the respective licenses.