summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_structs.h
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-01-08 17:35:20 +0000
committerAndrey Hristov <andrey@php.net>2010-01-08 17:35:20 +0000
commita98a67940a0808196078f2493553329e9de81592 (patch)
tree3cf28fec297dd83726526d2c6254940fee065971 /ext/mysqlnd/mysqlnd_structs.h
parentfcef58951b8441934304252ff9e5497118147043 (diff)
downloadphp-git-a98a67940a0808196078f2493553329e9de81592.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.h14
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;
};