andrey Fri, 05 Nov 2010 20:07:34 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=305109
Log:
two new stats
Changed paths:
U
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_get_client_stats.phpt
U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h
U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c
U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
U php/php-src/trunk/ext/mysqli/tests/mysqli_get_client_stats.phpt
U php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h
U php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c
U php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c
Modified:
php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_get_client_stats.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_get_client_stats.phpt
2010-11-05 18:53:48 UTC (rev 305108)
+++ php/php-src/branches/PHP_5_3/ext/mysqli/tests/mysqli_get_client_stats.phpt
2010-11-05 20:07:34 UTC (rev 305109)
@@ -887,7 +887,7 @@
mysqli_close($link);
?>
--EXPECTF--
-array(158) {
+array(160) {
[%u|b%"bytes_sent"]=>
%unicode|string%(1) "0"
[%u|b%"bytes_received"]=>
@@ -1204,6 +1204,10 @@
%unicode|string%(1) "0"
[%u|b%"com_deamon"]=>
%unicode|string%(1) "0"
+ [%u|b%"bytes_received_real_data_normal"]=>
+ %unicode|string%(1) "0"
+ [%u|b%"bytes_received_real_data_ps"]=>
+ %unicode|string%(1) "0"
}
Testing buffered normal...
Testing buffered normal... - SELECT id, label FROM test
Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h
2010-11-05 18:53:48 UTC (rev 305108)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h
2010-11-05 20:07:34 UTC (rev 305109)
@@ -502,6 +502,8 @@
STAT_COM_SET_OPTION,
STAT_COM_STMT_FETCH,
STAT_COM_DAEMON,
+ STAT_BYTES_RECEIVED_PURE_DATA_TEXT,
+ STAT_BYTES_RECEIVED_PURE_DATA_PS,
STAT_LAST /* Should be always the last */
} enum_mysqlnd_collected_stats;
Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c
2010-11-05 18:53:48 UTC (rev 305108)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_statistics.c
2010-11-05 20:07:34 UTC (rev 305109)
@@ -190,7 +190,9 @@
{ STR_W_LEN("com_stmt_reset") },
{ STR_W_LEN("com_stmt_set_option") },
{ STR_W_LEN("com_stmt_fetch") },
- { STR_W_LEN("com_deamon") }
+ { STR_W_LEN("com_deamon") },
+ { STR_W_LEN("bytes_received_real_data_normal") },
+ { STR_W_LEN("bytes_received_real_data_ps") }
};
/* }}} */
Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
2010-11-05 18:53:48 UTC (rev 305108)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_wireprotocol.c
2010-11-05 20:07:34 UTC (rev 305109)
@@ -1223,6 +1223,7 @@
for (i = 0, current_field = start_field; current_field < end_field;
current_field++, i++) {
enum_mysqlnd_collected_stats statistic;
+ zend_uchar * orig_p = p;
DBG_INF_FMT("Into zval=%p decoding column %u [%s.%s.%s] type=%u
field->flags&unsigned=%u flags=%u is_bit=%u as_unicode=%u",
*current_field, i,
@@ -1269,7 +1270,10 @@
}
}
}
- MYSQLND_INC_CONN_STATISTIC(stats, statistic);
+ MYSQLND_INC_CONN_STATISTIC_W_VALUE2(stats, statistic, 1,
+
STAT_BYTES_RECEIVED_PURE_DATA_PS,
+
(Z_TYPE_PP(current_field) == IS_STRING)?
+
Z_STRLEN_PP(current_field) : (p - orig_p));
if (!((bit<<=1) & 255)) {
bit = 1; /* to the following byte */
@@ -1376,9 +1380,8 @@
case MYSQL_TYPE_GEOMETRY:
statistic = STAT_TEXT_TYPE_FETCHED_GEOMETRY; break;
default: statistic =
STAT_TEXT_TYPE_FETCHED_OTHER; break;
}
- MYSQLND_INC_CONN_STATISTIC(stats, statistic);
+ MYSQLND_INC_CONN_STATISTIC_W_VALUE2(stats,
statistic, 1, STAT_BYTES_RECEIVED_PURE_DATA_TEXT, len);
}
-
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
if (as_int_or_float && perm_bind.php_type == IS_LONG) {
zend_uchar save = *(p + len);
Modified: php/php-src/trunk/ext/mysqli/tests/mysqli_get_client_stats.phpt
===================================================================
--- php/php-src/trunk/ext/mysqli/tests/mysqli_get_client_stats.phpt
2010-11-05 18:53:48 UTC (rev 305108)
+++ php/php-src/trunk/ext/mysqli/tests/mysqli_get_client_stats.phpt
2010-11-05 20:07:34 UTC (rev 305109)
@@ -887,7 +887,7 @@
mysqli_close($link);
?>
--EXPECTF--
-array(158) {
+array(160) {
[%u|b%"bytes_sent"]=>
%unicode|string%(1) "0"
[%u|b%"bytes_received"]=>
@@ -1204,6 +1204,10 @@
%unicode|string%(1) "0"
[%u|b%"com_deamon"]=>
%unicode|string%(1) "0"
+ [%u|b%"bytes_received_real_data_normal"]=>
+ %unicode|string%(1) "0"
+ [%u|b%"bytes_received_real_data_ps"]=>
+ %unicode|string%(1) "0"
}
Testing buffered normal...
Testing buffered normal... - SELECT id, label FROM test
Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h 2010-11-05 18:53:48 UTC
(rev 305108)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h 2010-11-05 20:07:34 UTC
(rev 305109)
@@ -502,6 +502,8 @@
STAT_COM_SET_OPTION,
STAT_COM_STMT_FETCH,
STAT_COM_DAEMON,
+ STAT_BYTES_RECEIVED_PURE_DATA_TEXT,
+ STAT_BYTES_RECEIVED_PURE_DATA_PS,
STAT_LAST /* Should be always the last */
} enum_mysqlnd_collected_stats;
Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c 2010-11-05 18:53:48 UTC
(rev 305108)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_statistics.c 2010-11-05 20:07:34 UTC
(rev 305109)
@@ -190,7 +190,9 @@
{ STR_W_LEN("com_stmt_reset") },
{ STR_W_LEN("com_stmt_set_option") },
{ STR_W_LEN("com_stmt_fetch") },
- { STR_W_LEN("com_deamon") }
+ { STR_W_LEN("com_deamon") },
+ { STR_W_LEN("bytes_received_real_data_normal") },
+ { STR_W_LEN("bytes_received_real_data_ps") }
};
/* }}} */
Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c 2010-11-05
18:53:48 UTC (rev 305108)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_wireprotocol.c 2010-11-05
20:07:34 UTC (rev 305109)
@@ -1223,6 +1223,7 @@
for (i = 0, current_field = start_field; current_field < end_field;
current_field++, i++) {
enum_mysqlnd_collected_stats statistic;
+ zend_uchar * orig_p = p;
DBG_INF_FMT("Into zval=%p decoding column %u [%s.%s.%s] type=%u
field->flags&unsigned=%u flags=%u is_bit=%u as_unicode=%u",
*current_field, i,
@@ -1269,7 +1270,10 @@
}
}
}
- MYSQLND_INC_CONN_STATISTIC(stats, statistic);
+ MYSQLND_INC_CONN_STATISTIC_W_VALUE2(stats, statistic, 1,
+
STAT_BYTES_RECEIVED_PURE_DATA_PS,
+
(Z_TYPE_PP(current_field) == IS_STRING)?
+
Z_STRLEN_PP(current_field) : (p - orig_p));
if (!((bit<<=1) & 255)) {
bit = 1; /* to the following byte */
@@ -1376,9 +1380,8 @@
case MYSQL_TYPE_GEOMETRY:
statistic = STAT_TEXT_TYPE_FETCHED_GEOMETRY; break;
default: statistic =
STAT_TEXT_TYPE_FETCHED_OTHER; break;
}
- MYSQLND_INC_CONN_STATISTIC(stats, statistic);
+ MYSQLND_INC_CONN_STATISTIC_W_VALUE2(stats,
statistic, 1, STAT_BYTES_RECEIVED_PURE_DATA_TEXT, len);
}
-
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
if (as_int_or_float && perm_bind.php_type == IS_LONG) {
zend_uchar save = *(p + len);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php