php-apm
                                
                                 php-apm copied to clipboard
                                
                                    php-apm copied to clipboard
                            
                            
                            
                        Documentation and SQL create queries
Hi,
I'm trying to configure APM on my local machine but I'm a bit put off by the lack of documentation. Is there any documentation outside of the source code, explaining how we're supposed to setup and check if the extension is actually doing anything? I see the wiki is empty and there's no doc/ folder. The README focuses on installing but it doesn't give much information about how to manage issues, so I was looking for someplace else to find the info but couldn't.
I've initially installed it with SQLite3 because I didn't understand why it wouldn't compile with MariaDB support if the (PECL installer) menu clearly offers MySQL/MariaDB and I had both libmariadbd-dev and libmariadb-client-lgpl-dev installed (on Ubuntu), but then I realized (after installing it with the SQLite driver) that maybe it was specifically asking for the MySQL dev packages, and indeed, installing libmysqld-dev and libmysqlclient-dev, I "pecl uninstall"ed APM and then it installed with MySQL/MariaDB support.
Then (probably because of the weird install/uninstall/install steps, it installed but did not create the database structure. I had to go find the CREATE TABLE queries in driver_mysql.c (pasting them below for a copy-paste by others, maybe that will help).
Finally, now I'm up with php-apm installed, php-apm-web install (and it loads the index) and I've enabled APM in one of my PHP applications, but I can see no data in either the event, request or stats tables.
So my initial question remains: how do I know if it's doing something?
Here is the copy paste of the MySQL tables CREATE queries:
CREATE TABLE IF NOT EXISTS request (
    id INTEGER UNSIGNED PRIMARY KEY auto_increment,
    application VARCHAR(255) NOT NULL,
    ts TIMESTAMP NOT NULL,
    script TEXT NOT NULL,
    uri TEXT NOT NULL,
    host TEXT NOT NULL,
    ip INTEGER UNSIGNED NOT NULL,
    cookies TEXT NOT NULL,
    post_vars TEXT NOT NULL,
    referer TEXT NOT NULL,
    method TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS event (
    id INTEGER UNSIGNED PRIMARY KEY auto_increment,
    request_id INTEGER UNSIGNED,
    ts TIMESTAMP NOT NULL,
    type SMALLINT UNSIGNED NOT NULL,
    file TEXT NOT NULL,
    line MEDIUMINT UNSIGNED NOT NULL,
    message TEXT NOT NULL,
    backtrace BLOB NOT NULL,
    KEY request (request_id)
);
CREATE TABLE IF NOT EXISTS stats (
    id INTEGER UNSIGNED PRIMARY KEY auto_increment,
    request_id INTEGER UNSIGNED,
    duration FLOAT UNSIGNED NOT NULL,
    user_cpu FLOAT UNSIGNED NOT NULL,
    sys_cpu FLOAT UNSIGNED NOT NULL,
    mem_peak_usage INTEGER UNSIGNED NOT NULL,
    KEY request (request_id)
);
Did you get it full working? Seems like the only open source apm out there for PHP, but there is almost no documentation on it and I can't really find any other sites talking about using it.
Nope. To be honest I'm not sure what I should expect to see... it was pretty much personal research so far, but I have not extended further (no time left for that topic atm). Sorry.