Giter VIP home page Giter VIP logo

pinba_extension's Introduction

pinba_extension's People

Contributors

anton-povarov avatar aparkhomenko avatar octo avatar sannis avatar tony2001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pinba_extension's Issues

PHP-FPM's losts childs and consumes CPU with Pinba extension enabled

(I'm sorry for using Russian language, I just want to make sure that I describe all precisely. And I hope you respond on this issue anyway. But I can translate it to English by your first request.)

У нас есть две проблемы, касающиеся связки PHP-FPM 5.4.21 + pinba extension. До этого мы без проблем использовали PHP-FPM 5.3.x + extension v.0.0.6, но затем "проапгрейдились".
Обе проблемы связаны со временем работы PHP-чайлда:

  1. в логах PHP есть записи "PHP Fatal error: Maximum execution time of 30 seconds exceeded" (php.ini: max_execution_time = 30).
  2. чайлды PHP-FPM остаются работать и "выедать" по 1-му ядру CPU, но FPM их не "замечает" - в логах PFM есть только старт чайлда. Но когда мы убиваем чайлд руками, появляется запись "child ... exited on signal 15 (SIGTERM)". (php-fpm.conf: request_terminate_timeout = 31s)

Что удалось установить:

  1. Проблемы не зависит от версии pinba extension: я пробовал и 1.0.0 и 1.1.0 и последний коммит и даже версию 0.0.6 (+ commit, чтобы собиралось под 5.4).
  2. Проблемы не зависят от выполняемых скриптов, их имена случайны, а частота проявления проблемы на каждом скрипте зависит от частоты его запуска. Более того, может зависнуть даже скрипт с единственной строкой: "phpinfo()".
  3. Списки подвисших чайлдов и чайлдов, пожаловавшихся на 'Maximum execution time' не совпадают.
  4. Проблемы полностью исчезают, если выставить pinba.enabled=0.

Я собрал и запустил комплект из debug'овой версии PHP-FPM и всех extension'ов, но он работает нормально.

В относительных цифрах проблемы проявляется нечасто: всего 0,005% от общего числа запросов. Но в абсолютных цифрах мы имеем порядка 400 не отработавших скриптов в сутки. Плюс, источник этих проблем - неизвестен и это нервирует: вдруг проблема насчет проявляться чаще?

Можете ли Вы подсказать, куда двигаться дальше, чтобы найти источник проблемы?

Is the protocol used by Pinba still compatible with ProtoBuf?

There are apparently arrays in the Pinba Request structure that are not in its *.proto file:

request->timer_ru_stime = malloc(sizeof(float) * n);
request->timer_ru_utime = malloc(sizeof(float) * n);

This is disturbing. I'm working on porting the Pinba client to C++ (as a library), and seeing this effectively means I can't recompile the *.proto file to obtain an easy-to-use C++ code.

Are there custom modifications to ProtoBuf-generated code that people should be aware of? Is there hope of seeing the *.proto file retrofitted so that it's useful again?

[PHP 5.4] Pinba libprotobuf Core crash

php -v

PHP 5.4.3 (cli) (built: May 26 2012 01:07:26)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

gdb /usr/local/bin/php php.core

GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols found)...
Core was generated by `php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libcrypt.so.5
Reading symbols from /usr/local/lib/libpcre.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libpcre.so.1
Reading symbols from /lib/libm.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /usr/local/lib/libxml2.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libxml2.so.5
Reading symbols from /lib/libz.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libz.so.6
Reading symbols from /usr/local/lib/libiconv.so.3...(no debugging symbols found)...done.
Loaded symbols for /usr/local/lib/libiconv.so.3
Reading symbols from /lib/libc.so.7...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/lib/php/20100525/pinba.so...done.
Loaded symbols for /usr/local/lib/php/20100525/pinba.so
Reading symbols from /usr/local/lib/libprotobuf.so.7...done.
Loaded symbols for /usr/local/lib/libprotobuf.so.7
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0 0x00000008024968c8 in std::_Rb_tree<std::string, std::pair<std::string const, std::pair<void const*, int> >, std::_Select1st<std::pair<std::string const, std::pair<void const*, int> > >, std::lessstd::string, std::allocator<std::pair<std::string const, std::pair<void const*, int> > > >::_M_insert_unique () from /usr/local/lib/libprotobuf.so.7

(gdb) bt
#0 0x00000008024968c8 in std::_Rb_tree<std::string, std::pair<std::string const, std::pair<void const*, int> >, std::_Select1st<std::pair<std::string const, std::pair<void const*, int> > >, std::lessstd::string, std::allocator<std::pair<std::string const, std::pair<void const*, int> > > >::_M_insert_unique () from /usr/local/lib/libprotobuf.so.7
#1 0x0000000802495999 in google::protobuf::InsertIfNotPresent<std::map<std::string, std::pair<void const*, int>, std::lessstd::string, std::allocator<std::pair<std::string const, std::pair<void const*, int> > > >, std::string, std::pair<void const*, int> > () from /usr/local/lib/libprotobuf.so.7
#2 0x00000008024947bb in google::protobuf::SimpleDescriptorDatabase::DescriptorIndex<std::pair<void const*, int> >::AddFile

() from /usr/local/lib/libprotobuf.so.7

#3 0x0000000802493365 in google::protobuf::EncodedDescriptorDatabase::Add () from /usr/local/lib/libprotobuf.so.7
#4 0x0000000802463ab6 in google::protobuf::DescriptorPool::InternalAddGeneratedFile () from /usr/local/lib/libprotobuf.so.7
#5 0x000000080247c213 in google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto ()

from /usr/local/lib/libprotobuf.so.7
#6 0x00000008024c3632 in __do_global_ctors_aux () from /usr/local/lib/libprotobuf.so.7
#7 0x0000000802445c4e in _init () from /usr/local/lib/libprotobuf.so.7
#8 0x00007fffffffc870 in ?? ()
#9 0x00000008008b2497 in r_debug_state () from /libexec/ld-elf.so.1
#10 0x00000008008b3a23 in dlopen () from /libexec/ld-elf.so.1
#11 0x00000008008b349b in dlopen () from /libexec/ld-elf.so.1
#12 0x00000000004af935 in php_load_extension ()
#13 0x000000000056c037 in zend_llist_apply ()
#14 0x0000000000524bd3 in php_ini_register_extensions ()
#15 0x000000000051dd00 in php_module_startup ()
#16 0x00000000005fdeb1 in php_cli_startup ()
#17 0x00000000005fc765 in main ()

clang -v

FreeBSD clang version 3.0 (branches/release_30 142614) 20111021
Target: x86_64-unknown-freebsd9.0
Thread model: posix


с любовью ваш К.О.

compile failure

php -v

PHP 5.5.24 (cli) (built: Apr 18 2015 00:24:15)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
with blackfire v1.10.6, https://blackfire.io, by Blackfireio Inc.

make install

/bin/sh /home/foo/pinba_extension/libtool --mode=compile cc -DNDEBUG -I. -I/home/foo/pinba_extension -DPHP_ATOM_INC -I/home/foo/pinba_extension/include -I/home/foo/pinba_extension/main -I/home/foo/pinba_extension -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/foo/pinba_extension/pinba.c -o pinba.lo
libtool: compile: cc -DNDEBUG -I. -I/home/foo/pinba_extension -DPHP_ATOM_INC -I/home/foo/pinba_extension/include -I/home/foo/pinba_extension/main -I/home/foo/pinba_extension -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/foo/pinba_extension/pinba.c -fPIC -DPIC -o .libs/pinba.o
/home/foo/pinba_extension/pinba.c: In function 'php_timer_hash_dtor':
/home/foo/pinba_extension/pinba.c:319: warning: initialization makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c: In function 'php_tag_hash_dtor':
/home/foo/pinba_extension/pinba.c:330: warning: initialization makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c: At top level:
/home/foo/pinba_extension/pinba.c:381: error: expected ')' before '' token
/home/foo/pinba_extension/pinba.c: In function 'php_pinba_timer_stop_helper':
/home/foo/pinba_extension/pinba.c:407: warning: cast to pointer from integer of different size
/home/foo/pinba_extension/pinba.c: In function 'php_pinba_dict_find_or_add':
/home/foo/pinba_extension/pinba.c:509: warning: comparison between pointer and integer
/home/foo/pinba_extension/pinba.c: In function 'pinba_fetch_global_var':
/home/foo/pinba_extension/pinba.c:523: error: request for member 'type' in something not a structure or union
/home/foo/pinba_extension/pinba.c:524: error: request for member 'type' in something not a structure or union
/home/foo/pinba_extension/pinba.c:524: error: request for member 'value' in something not a structure or union
/home/foo/pinba_extension/pinba.c:524: error: request for member 'type' in something not a structure or union
/home/foo/pinba_extension/pinba.c:524: error: request for member 'value' in something not a structure or union
/home/foo/pinba_extension/pinba.c: In function 'php_create_pinba_packet':
/home/foo/pinba_extension/pinba.c:677: warning: passing argument 2 of 'zend_hash_sort' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:220: note: expected 'sort_func_t' but argument is of type 'int (
)(const void , const void *)'
/home/foo/pinba_extension/pinba.c:677: error: too few arguments to function 'zend_hash_sort'
/home/foo/pinba_extension/pinba.c:683: warning: assignment makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:685: error: 'zend_string' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:685: error: (Each undeclared identifier is reported only once
/home/foo/pinba_extension/pinba.c:685: error: for each function it appears in.)
/home/foo/pinba_extension/pinba.c:685: error: 'key' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:696: warning: passing argument 3 of 'zend_hash_get_current_key_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:179: note: expected 'uint *' but argument is of type 'zend_ulong *'
/home/foo/pinba_extension/pinba.c:696: warning: passing argument 4 of 'zend_hash_get_current_key_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:179: note: expected 'ulong *' but argument is of type 'struct Bucket *
'
/home/foo/pinba_extension/pinba.c:696: error: too few arguments to function 'zend_hash_get_current_key_ex'
/home/foo/pinba_extension/pinba.c:718: warning: assignment makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:730: warning: assignment makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:742: warning: assignment makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:772: warning: passing argument 2 of 'zend_hash_get_current_data_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:182: note: expected 'void *
' but argument is of type 'struct Bucket *'
/home/foo/pinba_extension/pinba.c:772: error: too few arguments to function 'zend_hash_get_current_data_ex'
/home/foo/pinba_extension/pinba.c:774: error: 'str' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:777: warning: passing argument 3 of 'zend_hash_get_current_key_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:179: note: expected 'uint ' but argument is of type 'zend_ulong *'
/home/foo/pinba_extension/pinba.c:777: warning: passing argument 4 of 'zend_hash_get_current_key_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:179: note: expected 'ulong *' but argument is of type 'struct Bucket *
'
/home/foo/pinba_extension/pinba.c:777: error: too few arguments to function 'zend_hash_get_current_key_ex'
/home/foo/pinba_extension/pinba.c:822: warning: assignment makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c: In function 'php_pinba_key_compare':
/home/foo/pinba_extension/pinba.c:995: error: 'Bucket' has no member named 'key'
/home/foo/pinba_extension/pinba.c:998: error: 'Bucket' has no member named 'key'
/home/foo/pinba_extension/pinba.c:1001: error: 'Bucket' has no member named 'key'
/home/foo/pinba_extension/pinba.c:1004: error: 'Bucket' has no member named 'key'
/home/foo/pinba_extension/pinba.c:1007: error: too few arguments to function 'string_compare_function'
/home/foo/pinba_extension/pinba.c: In function 'php_pinba_array_to_tags':
/home/foo/pinba_extension/pinba.c:1015: error: 'zend_string' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1015: error: 'tag_name_str' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1023: warning: passing argument 2 of 'zend_hash_sort' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:220: note: expected 'sort_func_t' but argument is of type 'int (
)(const void *, const void *)'
/home/foo/pinba_extension/pinba.c:1023: error: too few arguments to function 'zend_hash_sort'
/home/foo/pinba_extension/pinba.c:1026: error: expected ';' before '{' token
/home/foo/pinba_extension/pinba.c:1103:65: error: macro "add_assoc_stringl" requires 5 arguments, but only 4 given
/home/foo/pinba_extension/pinba.c: In function 'php_pinba_get_timer_info':
/home/foo/pinba_extension/pinba.c:1103: error: 'add_assoc_stringl' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1110: warning: passing argument 1 of 'zval_add_ref' from incompatible pointer type
/usr/include/php/Zend/zend_variables.h:78: note: expected 'struct zval *' but argument is of type 'struct zval '
/home/foo/pinba_extension/pinba.c: In function 'pinba_client_new':
/home/foo/pinba_extension/pinba.c:1171: error: 'zend_object' has no member named 'handlers'
/home/foo/pinba_extension/pinba.c:1173: warning: passing argument 4 of 'zend_hash_init' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:100: note: expected 'dtor_func_t' but argument is of type 'void (
)(struct zval )'
/home/foo/pinba_extension/pinba.c:1174: warning: passing argument 4 of 'zend_hash_init' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:100: note: expected 'dtor_func_t' but argument is of type 'void (
)(struct zval )'
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timer_start':
/home/foo/pinba_extension/pinba.c:1192: error: 'zend_resource' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1192: error: 'rsrc' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1228: warning: passing argument 1 of 'zend_register_resource' from incompatible pointer type
/usr/include/php/Zend/zend_list.h:82: note: expected 'struct zval *' but argument is of type 'struct pinba_timer_t *'
/home/foo/pinba_extension/pinba.c:1228: warning: passing argument 2 of 'zend_register_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:82: note: expected 'void *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1228: error: too few arguments to function 'zend_register_resource'
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timer_add':
/home/foo/pinba_extension/pinba.c:1252: error: 'zend_resource' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1252: error: 'rsrc' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1291: warning: passing argument 1 of 'zend_register_resource' from incompatible pointer type
/usr/include/php/Zend/zend_list.h:82: note: expected 'struct zval *' but argument is of type 'struct pinba_timer_t *'
/home/foo/pinba_extension/pinba.c:1291: warning: passing argument 2 of 'zend_register_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:82: note: expected 'void *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1291: error: too few arguments to function 'zend_register_resource'
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timer_stop':
/home/foo/pinba_extension/pinba.c:1316: warning: passing argument 1 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'struct zval *
' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1316: warning: passing argument 2 of 'zend_fetch_resource' makes integer from pointer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'int' but argument is of type 'char '
/home/foo/pinba_extension/pinba.c:1316: warning: passing argument 3 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'const char *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1316: error: too few arguments to function 'zend_fetch_resource'
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timer_delete':
/home/foo/pinba_extension/pinba.c:1339: warning: passing argument 1 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'struct zval *
' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1339: warning: passing argument 2 of 'zend_fetch_resource' makes integer from pointer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'int' but argument is of type 'char '
/home/foo/pinba_extension/pinba.c:1339: warning: passing argument 3 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'const char *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1339: error: too few arguments to function 'zend_fetch_resource'
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timer_data_merge':
/home/foo/pinba_extension/pinba.c:1367: warning: passing argument 1 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'struct zval *
' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1367: warning: passing argument 2 of 'zend_fetch_resource' makes integer from pointer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'int' but argument is of type 'char '
/home/foo/pinba_extension/pinba.c:1367: warning: passing argument 3 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'const char *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1367: error: too few arguments to function 'zend_fetch_resource'
/home/foo/pinba_extension/pinba.c:1372:74: error: macro "zend_hash_merge" requires 6 arguments, but only 4 given
/home/foo/pinba_extension/pinba.c:1372: error: 'zend_hash_merge' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timer_data_replace':
/home/foo/pinba_extension/pinba.c:1395: warning: passing argument 1 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'struct zval *
' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1395: warning: passing argument 2 of 'zend_fetch_resource' makes integer from pointer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'int' but argument is of type 'char '
/home/foo/pinba_extension/pinba.c:1395: warning: passing argument 3 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'const char *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1395: error: too few arguments to function 'zend_fetch_resource'
/home/foo/pinba_extension/pinba.c:1400: warning: passing argument 1 of 'zval_ptr_dtor' from incompatible pointer type
/usr/include/php/Zend/zend_variables.h:51: note: expected 'struct zval *
' but argument is of type 'struct zval '
/home/foo/pinba_extension/pinba.c:1405: warning: passing argument 1 of 'zval_ptr_dtor' from incompatible pointer type
/usr/include/php/Zend/zend_variables.h:51: note: expected 'struct zval *
' but argument is of type 'struct zval '
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timer_tags_merge':
/home/foo/pinba_extension/pinba.c:1433: warning: passing argument 1 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'struct zval *
' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1433: warning: passing argument 2 of 'zend_fetch_resource' makes integer from pointer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'int' but argument is of type 'char '
/home/foo/pinba_extension/pinba.c:1433: warning: passing argument 3 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'const char *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1433: error: too few arguments to function 'zend_fetch_resource'
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timer_tags_replace':
/home/foo/pinba_extension/pinba.c:1498: warning: passing argument 1 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'struct zval *
' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1498: warning: passing argument 2 of 'zend_fetch_resource' makes integer from pointer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'int' but argument is of type 'char '
/home/foo/pinba_extension/pinba.c:1498: warning: passing argument 3 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'const char *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1498: error: too few arguments to function 'zend_fetch_resource'
/home/foo/pinba_extension/pinba.c:1587:59: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_get_info':
/home/foo/pinba_extension/pinba.c:1587: error: 'add_assoc_string' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1589:61: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
/home/foo/pinba_extension/pinba.c:1593:69: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
/home/foo/pinba_extension/pinba.c:1595:66: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
/home/foo/pinba_extension/pinba.c:1599:69: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
/home/foo/pinba_extension/pinba.c:1601:66: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
/home/foo/pinba_extension/pinba.c:1604:63: error: macro "add_assoc_string" requires 4 arguments, but only 3 given
/home/foo/pinba_extension/pinba.c:1609: warning: passing argument 2 of 'zend_hash_get_current_data_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:182: note: expected 'void *
' but argument is of type 'struct Bucket *
'
/home/foo/pinba_extension/pinba.c:1609: error: too few arguments to function 'zend_hash_get_current_data_ex'
/home/foo/pinba_extension/pinba.c:1611: error: 'zend_resource' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1611: error: 'rsrc' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1628: warning: passing argument 2 of 'zend_hash_get_current_data_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:182: note: expected 'void *
' but argument is of type 'struct Bucket *
'
/home/foo/pinba_extension/pinba.c:1628: error: too few arguments to function 'zend_hash_get_current_data_ex'
/home/foo/pinba_extension/pinba.c:1630: error: 'zend_string' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1630: error: 'key' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1632: warning: initialization makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:1634: warning: passing argument 3 of 'zend_hash_get_current_key_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:179: note: expected 'uint *' but argument is of type 'zend_ulong *'
/home/foo/pinba_extension/pinba.c:1634: warning: passing argument 4 of 'zend_hash_get_current_key_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:179: note: expected 'ulong *' but argument is of type 'struct Bucket *
'
/home/foo/pinba_extension/pinba.c:1634: error: too few arguments to function 'zend_hash_get_current_key_ex'
/home/foo/pinba_extension/pinba.c:1635: error: too few arguments to function 'add_assoc_string_ex'
/home/foo/pinba_extension/pinba.c:1663:31: error: macro "RETVAL_STRINGL" requires 3 arguments, but only 2 given
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_get_data':
/home/foo/pinba_extension/pinba.c:1663: error: 'RETVAL_STRINGL' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timer_get_info':
/home/foo/pinba_extension/pinba.c:1680: warning: passing argument 1 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'struct zval *
' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1680: warning: passing argument 2 of 'zend_fetch_resource' makes integer from pointer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'int' but argument is of type 'char *'
/home/foo/pinba_extension/pinba.c:1680: warning: passing argument 3 of 'zend_fetch_resource' makes pointer from integer without a cast
/usr/include/php/Zend/zend_list.h:83: note: expected 'const char *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1680: error: too few arguments to function 'zend_fetch_resource'
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timers_stop':
/home/foo/pinba_extension/pinba.c:1699: warning: passing argument 2 of 'zend_hash_get_current_data_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:182: note: expected 'void *' but argument is of type 'struct Bucket *'
/home/foo/pinba_extension/pinba.c:1699: error: too few arguments to function 'zend_hash_get_current_data_ex'
/home/foo/pinba_extension/pinba.c:1701: error: 'zend_resource' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1701: error: 'rsrc' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_timers_get':
/home/foo/pinba_extension/pinba.c:1727: warning: passing argument 2 of 'zend_hash_get_current_data_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:182: note: expected 'void *' but argument is of type 'struct Bucket *'
/home/foo/pinba_extension/pinba.c:1727: error: too few arguments to function 'zend_hash_get_current_data_ex'
/home/foo/pinba_extension/pinba.c:1729: error: 'zend_resource' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1729: error: 'rsrc' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_tag_get':
/home/foo/pinba_extension/pinba.c:1884: warning: assignment makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:1888:21: error: macro "RETURN_STRING" requires 2 arguments, but only 1 given
/home/foo/pinba_extension/pinba.c:1888: error: 'RETURN_STRING' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c: In function 'zif_pinba_tags_get':
/home/foo/pinba_extension/pinba.c:1923: warning: assignment makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:1925: error: 'zend_string' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1925: error: 'key' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1928: warning: passing argument 3 of 'zend_hash_get_current_key_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:179: note: expected 'uint *' but argument is of type 'zend_ulong *'
/home/foo/pinba_extension/pinba.c:1928: warning: passing argument 4 of 'zend_hash_get_current_key_ex' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:179: note: expected 'ulong *' but argument is of type 'struct Bucket *_'
/home/foo/pinba_extension/pinba.c:1928: error: too few arguments to function 'zend_hash_get_current_key_ex'
/home/foo/pinba_extension/pinba.c:1929: error: too few arguments to function 'add_assoc_string_ex'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient___construct':
/home/foo/pinba_extension/pinba.c:1951: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object _' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:1955:45: error: macro "zend_hash_get_current_data" requires 2 arguments, but only 1 given
/home/foo/pinba_extension/pinba.c:1955: error: 'zend_hash_get_current_data' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1958: error: 'zend_string' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:1958: error: 'str' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setHostname':
/home/foo/pinba_extension/pinba.c:2001: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setServername':
/home/foo/pinba_extension/pinba.c:2002: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setScriptname':
/home/foo/pinba_extension/pinba.c:2003: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setSchema':
/home/foo/pinba_extension/pinba.c:2004: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setRequestCount':
/home/foo/pinba_extension/pinba.c:2025: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setMemoryFootprint':
/home/foo/pinba_extension/pinba.c:2026: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setMemoryPeak':
/home/foo/pinba_extension/pinba.c:2027: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setDocumentSize':
/home/foo/pinba_extension/pinba.c:2028: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setStatus':
/home/foo/pinba_extension/pinba.c:2029: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setRequestTime':
/home/foo/pinba_extension/pinba.c:2030: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setRusage':
/home/foo/pinba_extension/pinba.c:2044: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:2052:45: error: macro "zend_hash_get_current_data" requires 2 arguments, but only 1 given
/home/foo/pinba_extension/pinba.c:2052: error: 'zend_hash_get_current_data' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_setTag':
/home/foo/pinba_extension/pinba.c:2072: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'php_pinba_client_timer_add_set':
/home/foo/pinba_extension/pinba.c:2096: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:2121:46: error: macro "zend_hash_get_current_data" requires 2 arguments, but only 1 given
/home/foo/pinba_extension/pinba.c:2121: error: 'zend_hash_get_current_data' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:2153: warning: assignment makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_send':
/home/foo/pinba_extension/pinba.c:2202: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c: In function 'zim_PinbaClient_getData':
/home/foo/pinba_extension/pinba.c:2239: warning: passing argument 1 of 'php_pinba_client_object' makes pointer from integer without a cast
/home/foo/pinba_extension/pinba.c:135: note: expected 'struct zend_object *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:2247:31: error: macro "RETVAL_STRINGL" requires 3 arguments, but only 2 given
/home/foo/pinba_extension/pinba.c:2247: error: 'RETVAL_STRINGL' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c: In function 'OnUpdateCollectorAddress':
/home/foo/pinba_extension/pinba.c:2455: error: request for member 'val' in something not a structure or union
/home/foo/pinba_extension/pinba.c:2455: error: request for member 'len' in something not a structure or union
/home/foo/pinba_extension/pinba.c:2482: warning: passing argument 3 of 'OnUpdateString' makes integer from pointer without a cast
/usr/include/php/Zend/zend_ini.h:180: note: expected 'uint' but argument is of type 'void *'
/home/foo/pinba_extension/pinba.c:2482: warning: passing argument 6 of 'OnUpdateString' makes pointer from integer without a cast
/usr/include/php/Zend/zend_ini.h:180: note: expected 'void *' but argument is of type 'int'
/home/foo/pinba_extension/pinba.c:2482: error: too few arguments to function 'OnUpdateString'
/home/foo/pinba_extension/pinba.c: In function 'zm_startup_pinba':
/home/foo/pinba_extension/pinba.c:2516: error: 'php_timer_resource_dtor' undeclared (first use in this function)
/home/foo/pinba_extension/pinba.c:2525: warning: assignment from incompatible pointer type
/home/foo/pinba_extension/pinba.c:2526: warning: assignment from incompatible pointer type
/home/foo/pinba_extension/pinba.c:2530: error: too few arguments to function 'zend_register_internal_class_ex'
/home/foo/pinba_extension/pinba.c:2531: warning: assignment from incompatible pointer type
/home/foo/pinba_extension/pinba.c:2534: error: 'zend_object_handlers' has no member named 'dtor_obj'
/home/foo/pinba_extension/pinba.c:2535: error: 'zend_object_handlers' has no member named 'free_obj'
/home/foo/pinba_extension/pinba.c:2537: error: 'zend_object_handlers' has no member named 'offset'
/home/foo/pinba_extension/pinba.c: In function 'zm_activate_pinba':
/home/foo/pinba_extension/pinba.c:2579: warning: passing argument 4 of 'zend_hash_init' from incompatible pointer type
/usr/include/php/Zend/zend_hash.h:100: note: expected 'dtor_func_t' but argument is of type 'void (
)(struct zval )'
/home/foo/pinba_extension/pinba.c:2591: error: request for member 'type' in something not a structure or union
/home/foo/pinba_extension/pinba.c:2591: error: request for member 'value' in something not a structure or union
/home/foo/pinba_extension/pinba.c:2591: error: request for member 'type' in something not a structure or union
/home/foo/pinba_extension/pinba.c:2591: error: request for member 'value' in something not a structure or union
/home/foo/pinba_extension/pinba.c:2596: error: request for member 'type' in something not a structure or union
/home/foo/pinba_extension/pinba.c:2596: error: request for member 'value' in something not a structure or union
/home/foo/pinba_extension/pinba.c:2596: error: request for member 'type' in something not a structure or union
/home/foo/pinba_extension/pinba.c:2596: error: request for member 'value' in something not a structure or union
make: *
* [pinba.lo] Error 1

php80 support plz ?

Thank you so much for pinba ext
Will it possible to make pinba for php 8.0+

/root/pinba/pinba_extension/pinba.c: In function 'php_create_pinba_packet': /root/pinba/pinba_extension/pinba.c:730:3: warning: passing argument 3 of 'zend_hash_sort_ex' from incompatible pointer type [enabled by default] zend_hash_sort(tags, php_pinba_key_compare, 0); ^ In file included from /opt/alt/php80/usr/include/php/Zend/zend.h:33:0, from /opt/alt/php80/usr/include/php/main/php.h:31, from /root/pinba/pinba_extension/pinba.c:35: /opt/alt/php80/usr/include/php/Zend/zend_hash.h:268:30: note: expected 'bucket_compare_func_t' but argument is of type 'int (*)(const void *, const void *)' ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort_func, bucket_compare_func_t compare_func, zend_bool renumber); ^ /root/pinba/pinba_extension/pinba.c: In function 'php_pinba_array_to_tags': /root/pinba/pinba_extension/pinba.c:1100:2: warning: passing argument 3 of 'zend_hash_sort_ex' from incompatible pointer type [enabled by default] zend_hash_sort(array, php_pinba_key_compare, 0); ^ In file included from /opt/alt/php80/usr/include/php/Zend/zend.h:33:0, from /opt/alt/php80/usr/include/php/main/php.h:31, from /root/pinba/pinba_extension/pinba.c:35: /opt/alt/php80/usr/include/php/Zend/zend_hash.h:268:30: note: expected 'bucket_compare_func_t' but argument is of type 'int (*)(const void *, const void *)' ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort_func, bucket_compare_func_t compare_func, zend_bool renumber);

PHP7.3 support

Hi, thanks a lot for Pinba! Really great tool for php-monitoring 👍
But there is an issue with php:7.3-fpm version (see stack trace)

/usr/src/php/ext/pinba/pinba.c: In function 'zif_pinba_timer_start':
/usr/src/php/ext/pinba/pinba.c:1295:19: error: lvalue required as increment operand
  GC_REFCOUNT(rsrc)++;
                   ^~
/usr/src/php/ext/pinba/pinba.c: In function 'zif_pinba_timer_add':
/usr/src/php/ext/pinba/pinba.c:1354:19: error: lvalue required as increment operand
  GC_REFCOUNT(rsrc)++;
                   ^~
/usr/src/php/ext/pinba/pinba.c: In function 'zif_pinba_timers_get':
/usr/src/php/ext/pinba/pinba.c:1811:21: error: lvalue required as increment operand
    GC_REFCOUNT(rsrc)++;
                     ^~
make: *** [Makefile:195: pinba.lo] Error 1

wanna point out: php:7.2-fpm works just fine

[BUG] Query times inserted in exponential notation

I'm seeing data put into the pinba tables as exponential notation. The data itself is incorrect as queries aren't actually taking such a long time, and it's messing up Pinboard:

screen shot 2014-08-12 at 1 16 27 pm

I've had a bug opened on pinboard: intaro/pinboard#86 but I realize this seems to be a bug with either the php extension (master branch), or the engine (also master branch).

Problem compiling for Windows

Hi,

While compiling with VS2012 x64 Cross Tools Command Prompt I suddenly get many syntax errors:

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\nmake.exe" /I /nologo "php_pinba.dll

pinba-pb-c.c
ext\pinba\pinba-pb-c.c(54) : error C2059: syntax error : '.'
ext\pinba\pinba-pb-c.c(72) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(82) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(92) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(102) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(112) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(122) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(132) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(142) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(152) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(162) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(172) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(182) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(192) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(202) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(212) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(222) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(232) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(242) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(252) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(262) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(272) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(282) : error C2059: syntax error : ','
ext\pinba\pinba-pb-c.c(316) : error C2059: syntax error : '.'

Any idea?

Add schema field to pinba_get_info() result

Заметил, что это значение уходит только на сервер, тогда как все остальные новые поля (тэги, например), можно вытянуть из pinba_get_info().

cannot build on Solaris 10, timersub() undef

timersub() macro doesn't exist on Solaris 10.
in order to build pinba on Solaris 10 the following code needs to be added (I add it to pinba.c):

#ifndef timersub
# define timersub(a, b, result)                     \
    do {                                \
        (result)->tv_sec = (a)->tv_sec - (b)->tv_sec;       \
        (result)->tv_usec = (a)->tv_usec - (b)->tv_usec;        \
        if ((result)->tv_usec < 0) {                            \
            --(result)->tv_sec;             \
            (result)->tv_usec += 1000000;           \
        }                                                       \
    } while (0)
#endif

After this everything works like a charm.
Thanks for great piece of software.

Feature request for report_by_server_script_and_status

Hi.

The idea is to have a report with all of the following:

  • server_name
  • script_name
  • status

There currently is no report with all three. The only place with all three is request table (raw data), but docs say:

Running queries on raw data is very expensive and not quite reliable, since the data keeps updating in realtime.

PHP7 support

Hi, Anton! Do you plan to make php7 version of pinba extension?

The PinbaClient class incorrect work with request_time variable

Hello,

When I try to use:

php -r '$pc = new PinbaClient(array(ini_get("pinba.server"))); $pc->setRequestTime(0.1);'

I've got the warning
Warning: PinbaClient::setRequestTime(): request_time cannot be less than zero in Command line code on line 1

That's because you use:
SET_METHOD_NUM(setRequestTime, request_time, float, "d");

As I know php variables use type double but you compare with type float in that macros.

how to use it ?

i want to know how to use it in my php project ? and it must require pinba_engine is installed in mysql....?

did not compile on CentOS 7 64bit

HI peolple, I need help :)
I try to compile pinba_extesion on centos7 64bit

...
/usr/include/php/Zend/zend_operators.h:460:29: error: request for member 'type' in something not a structure or union
#define Z_TYPE(zval) (zval).type
^
/usr/include/php/Zend/zend_operators.h:461:26: note: in expansion of macro 'Z_TYPE'
#define Z_TYPE_P(zval_p) Z_TYPE(*zval_p)
^
/usr/include/php/Zend/zend_API.h:719:63: note: in expansion of macro 'Z_TYPE_P'
#define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
^
/TEMP/pinba_extension/pinba.c:2674:28: note: in expansion of macro 'HASH_OF'
tmp = zend_hash_str_find(HASH_OF(&PG(http_globals)[TRACK_VARS_SERVER]), "SERVER_NAME", sizeof("SERVER_NAME")-1);
^
/usr/include/php/Zend/zend_operators.h:421:32: error: request for member 'value' in something not a structure or union
#define Z_OBJVAL(zval) (zval).value.obj
^
/usr/include/php/Zend/zend_operators.h:423:26: note: in expansion of macro 'Z_OBJVAL'
#define Z_OBJ_HT(zval) Z_OBJVAL(zval).handlers
^
/usr/include/php/Zend/zend_operators.h:441:29: note: in expansion of macro 'Z_OBJ_HT'
#define Z_OBJ_HT_P(zval_p) Z_OBJ_HT(*zval_p)
^
/usr/include/php/Zend/zend_API.h:719:88: note: in expansion of macro 'Z_OBJ_HT_P'
#define HASH_OF(p) (Z_TYPE_P(p)==IS_ARRAY ? Z_ARRVAL_P(p) : ((Z_TYPE_P(p)==IS_OBJECT ? Z_OBJ_HT_P(p)->get_properties((p) TSRMLS_CC) : NULL)))
^
/TEMP/pinba_extension/pinba.c:2674:28: note: in expansion of macro 'HASH_OF'
tmp = zend_hash_str_find(HASH_OF(&PG(http_globals)[TRACK_VARS_SERVER]), "SERVER_NAME", sizeof("SERVER_NAME")-1);
^
make: *** [pinba.lo] Ошибка 1

What I do wrong?

php_pinba_req_data_send uses sendto incorrectly

php_pinba_req_data_send uses sendto in the same manner that write is used with slow devices. This is incorrect: each sendto call results in a separate datagram being sent, so if not all data fits into one datagram, several corrupted datagrams are sent instead.

If you insist on using datagrams for Pinba, you should probably check if the message size fits into one datagram and indicate an error if it doesn't.

HHVM extension

It would be great to use pinba under HHVM environment. Is it possible to implement such extension?

Speed up execution when pinba.enabled is set to 0

Atm, when pinba.enabled is set to 0, the extension code does still create timers, even though it does not flush them later on. The process of doing that does consume both cpu time (at least a gettimeofday call), and memory.

In order to minimize the impact of having one's code permanently sprinkled with pinba timer calls, it would be nice if such resource consumption was as limited as possible when pinba.enabled is set to 0.

Given that we now have the pinba.autoflush setting available to let users set up the code in a way that statistics are collected but not sent, it stands to reason that the BC break of changing the extension behaviour so that timers and tags are not created at all when pinba.enabled is set to 0 might be perceived as worthwhile

Problem compiling RELEASE_1_1_1

  • gcc версия 9.3.0 (Arch Linux 9.3.0-1)
  • Целевая архитектура: x86_64-pc-linux-gnu

Error:

pinba_extension-RELEASE_1_1_1/pinba.c: В функции «zif_pinba_timer_start»:
pinba_extension-RELEASE_1_1_1/pinba.c:1295:19: ошибка: операнд инкрементации должен быть lvalue-выражением
 1295 |  GC_REFCOUNT(rsrc)++;
      |                   ^~

pinba_extension-RELEASE_1_1_1/pinba.c: В функции «zif_pinba_timer_add»:
pinba_extension-RELEASE_1_1_1/pinba.c:1354:19: ошибка: операнд инкрементации должен быть lvalue-выражением
 1354 |  GC_REFCOUNT(rsrc)++;
      |                   ^~

pinba_extension-RELEASE_1_1_1/pinba.c: В функции «zif_pinba_timers_get»:
pinba_extension-RELEASE_1_1_1/pinba.c:1811:21: ошибка: операнд инкрементации должен быть lvalue-выражением
 1811 |    GC_REFCOUNT(rsrc)++;
      |                     ^~

make: *** [Makefile:193: pinba.lo] Ошибка 1

pinba_reset does not delete existing timers

Tested on pinba-php from Ubuntu Focal:

$t1 = pinba_timer_start(array('timerNr' => '1'));
pinba_tag_set('yo', 'lo');
var_dump(count(pinba_timers_get())); // 1
var_dump(count(pinba_tags_get())); // 1
pinba_reset();
echo "--\n";
var_dump(count(pinba_timers_get())); // 1 !!!
var_dump(count(pinba_tags_get())); // 0

I am not 100% sure about the intended behaviour, but I'd say that a "reset" function should clean up everything.

ATM, the workaround I found, is: in order to delete all timers, ini_set pinba_enabled to 0, call flush(), then reset pinba_enabled to its original value

No data collected

I have installed newest extension and engine, but no data collected, mysql tables is empty.

how to debug ?

extension=pinba.so
pinba.enabled=1
pinba.auto_flush=1
pinba.server=MYSQL_IP

Windows port

Hi Tony,
Can we expect a windows version of Pinba?
Thanks
Ricardo

Compilation error : 'zend_memory_peak_usage' was not declared in this scope

Hi,

Trying to compile Pinba extension on CentOS 5 using php-5.1.6 from standard RPMS, i get the following error :

phpize && ./configure --with-pinba=/usr/local/ && make

[snip]

g++ -DNDEBUG -I. -I/srv/pinbacompil_dat/sources/pinba_extension -DPHP_ATOM_INC -I/srv/pinbacompil_dat/sources/pinba_extension/include -I/srv/pinbacompil_dat/sources/pinba_extension/main -I/srv/pinbacompil_dat/sources/pinba_extension -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/local//include -DHAVE_CONFIG_H -c /srv/pinbacompil_dat/sources/pinba_extension/pinba.cc  -fPIC -DPIC -o .libs/pinba.o
/srv/pinbacompil_dat/sources/pinba_extension/pinba.cc: In function 'void php_pinba_flush_data(const char*)':
/srv/pinbacompil_dat/sources/pinba_extension/pinba.cc:484: error: 'zend_memory_peak_usage' was not declared in this scope
/srv/pinbacompil_dat/sources/pinba_extension/pinba.cc: In function 'void zif_pinba_get_info(int, zval*, zval**, zval*, int)':
/srv/pinbacompil_dat/sources/pinba_extension/pinba.cc:1070: error: 'zend_memory_peak_usage' was not declared in this scope
make: *** [pinba.lo] Error 1

regards.

Segfault in PHP 5.3 after latest commit bdbaa0fbbe

After upgrading to the latest commit bdbaa0f I see segfault in PHP 5.3 even when I just run php -m. There are no issues with PHP 5.4 and 5.5.
Reverting to the previous commit fixes this issue.

Core was generated by `php5.3 -m'.
Program terminated with signal 11, Segmentation fault.
#0  0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00000000006cda66 in php_ub_body_write_no_header ()
#2  0x00000000006b858b in php_printf ()
#3  0x0000000000475c20 in main ()

cannot use on Solaris 10, timeradd() undef

While it's building properly on Solaris 10, and even it's capable of sending stats, when using pinba-enabled PHP code php will complain about undefined symbol timersub().

This code fixes it:

#ifndef timersub
#define timersub(tvp, uvp, vvp)                                 \
        do                                                              \
        {                                                               \
                (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec;          \
                (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec;       \
                if ((vvp)->tv_usec < 0)                                 \
                {                                                       \
                        (vvp)->tv_sec--;                                \
                        (vvp)->tv_usec += 1000000;                      \
                }                                                       \
        } while (0)
#endif

apache2 gracefull restart problem

Hey,
I get that error every time I'm trying to do "service apache2 reload" on my Ubuntu 14.04 server. And Apache stops working.

[Thu Dec 24 00:13:39.016451 2015] [mpm_prefork:notice] [pid 8721] AH00171: Graceful restart requested, doing restart
[libprotobuf ERROR google/protobuf/descriptor_database.cc:57] File already exists in database: pinba.proto
[libprotobuf FATAL google/protobuf/descriptor.cc:954] CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): CHECK failed: generated_database_->Add(encoded_file_descriptor, size):
[Thu Dec 24 00:13:42.926783 2015] [core:notice] [pid 8721] AH00060: seg fault or similar nasty error detected in the parent process

After "server apache2 restart" server goes online.
Could you please help how to fix that error?
P.S. Ubuntu 14.04.3, Apache-ITK 2.4, PHP 5.5 and pinba extension were installed from official repo.

Thanks!

bug

[protobuf-c.c:170]: (error) Possible null pointer dereference: new_data

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.