06/04/2021, 14:46

Hàm mysqli_get_client_stats() trong PHP - PHP Function

Code echo "<pre>"; print_r(mysqli_get_client_stats()); echo "</pre>";

Hàm mysqli_get_client_stats() sẽ trả về một mảng bao gồm các thông tin của client.

Cú pháp

Cú phápmysqli_get_client_stats();

Hàm mysqli_get_client_stats() không có tham số truyền vào.

Kết quả trả về

Hàm sẽ trả về một mảng bao gồm các thông tin của client.

Ví dụ

Cách sử dụng hàm mysqli_get_client_stats():

Code
echo "<pre>";
	print_r(mysqli_get_client_stats());
echo "</pre>";

Kết quả
Array
(
    [bytes_sent] => 179478
    [bytes_received] => 376981
    [packets_sent] => 2644
    [packets_received] => 8014
    [protocol_overhead_in] => 32056
    [protocol_overhead_out] => 10576
    [bytes_received_ok_packet] => 0
    [bytes_received_eof_packet] => 0
    [bytes_received_rset_header_packet] => 5436
    [bytes_received_rset_field_meta_packet] => 0
    [bytes_received_rset_row_packet] => 12348
    [bytes_received_prepare_response_packet] => 271168
    [bytes_received_change_user_packet] => 73228
    [packets_sent_command] => 1212
    [packets_received_ok] => 0
    [packets_received_eof] => 0
    [packets_received_rset_header] => 604
    [packets_received_rset_field_meta] => 0
    [packets_received_rset_row] => 1071
    [packets_received_prepare_response] => 4020
    [packets_received_change_user] => 2068
    [result_set_queries] => 604
    [non_result_set_queries] => 460
    [no_index_used] => 332
    [bad_index_used] => 0
    [slow_queries] => 0
    [buffered_sets] => 604
    [unbuffered_sets] => 0
    [ps_buffered_sets] => 0
    [ps_unbuffered_sets] => 0
    [flushed_normal_sets] => 0
    [flushed_ps_sets] => 0
    [ps_prepared_never_executed] => 0
    [ps_prepared_once_executed] => 0
    [rows_fetched_from_server_normal] => 1464
    [rows_fetched_from_server_ps] => 0
    [rows_buffered_from_client_normal] => 1464
    [rows_buffered_from_client_ps] => 0
    [rows_fetched_from_client_normal_buffered] => 1028
    [rows_fetched_from_client_normal_unbuffered] => 0
    [rows_fetched_from_client_ps_buffered] => 0
    [rows_fetched_from_client_ps_unbuffered] => 0
    [rows_fetched_from_client_ps_cursor] => 0
    [rows_affected_normal] => 200
    [rows_affected_ps] => 0
    [rows_skipped_normal] => 1464
    [rows_skipped_ps] => 0
    [copy_on_write_saved] => 1998
    [copy_on_write_performed] => 5390
    [command_buffer_too_small] => 0
    [connect_success] => 110
    [connect_failure] => 0
    [connection_reused] => 0
    [reconnect] => 0
    [pconnect_success] => 48
    [active_connections] => 18446744073709551506
    [active_persistent_connections] => 18446744073709551568
    [explicit_close] => 110
    [implicit_close] => 0
    [disconnect_close] => 0
    [in_middle_of_command_close] => 0
    [explicit_free_result] => 604
    [implicit_free_result] => 0
    [explicit_stmt_close] => 0
    [implicit_stmt_close] => 0
    [mem_emalloc_count] => 1673
    [mem_emalloc_amount] => 319670
    [mem_ecalloc_count] => 5256
    [mem_ecalloc_amount] => 1941100
    [mem_erealloc_count] => 817
    [mem_erealloc_amount] => 73780
    [mem_efree_count] => 7597
    [mem_efree_amount] => 2273574
    [mem_malloc_count] => 6574
    [mem_malloc_amount] => 10108236
    [mem_calloc_count] => 4198
    [mem_calloc_amount] => 593372
    [mem_realloc_count] => 0
    [mem_realloc_amount] => 0
    ...
)

Tham khảo: w3schools.com

Nguồn: Zaidap.com.net

Tạ Quốc Bảo

23 chủ đề

7270 bài viết

Cùng chủ đề
0