diff options
author | Andrey Hristov <andrey@php.net> | 2010-01-08 17:35:20 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2010-01-08 17:35:20 +0000 |
commit | d20fdd603bc01ba3910839a6f3b7d4094eba6a67 (patch) | |
tree | cde1e1822b62a92fd9b11b7d79641ca6a91b433a /ext/mysqlnd/mysqlnd_structs.h | |
parent | 3264e51983b46ee4951a14b591e8d80a542551b5 (diff) | |
download | php-git-d20fdd603bc01ba3910839a6f3b7d4094eba6a67.tar.gz |
improve the stats subsystem. Reduce the number of macro definitions
in half by smartly introducing 2 new macros. Make MYSQLND::stats a pointer
from being aggregated and add triggers.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_structs.h')
-rw-r--r-- | ext/mysqlnd/mysqlnd_structs.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index a186861b61..c7bd51297e 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -208,13 +208,19 @@ typedef enum_func_status (*mysqlnd_fetch_row_func)(MYSQLND_RES *result, zend_bool *fetched_anything TSRMLS_DC); -typedef struct st_mysqlnd_stats +typedef struct st_mysqlnd_stats MYSQLND_STATS; + +typedef void (*mysqlnd_stat_handler)(MYSQLND_STATS * stats, enum_mysqlnd_collected_stats stat, int64_t change TSRMLS_DC); + +struct st_mysqlnd_stats { - uint64_t values[STAT_LAST]; + uint64_t values[STAT_LAST]; + mysqlnd_stat_handler *handlers; + zend_bool in_handler; #ifdef ZTS MUTEX_T LOCK_access; #endif -} MYSQLND_STATS; +}; typedef struct st_mysqlnd_read_buffer { @@ -542,7 +548,7 @@ struct st_mysqlnd_connection MYSQLND_OPTIONS options; /* stats */ - MYSQLND_STATS stats; + MYSQLND_STATS * stats; struct st_mysqlnd_conn_methods *m; }; |