On Thu, Nov 5, 2009 at 9:47 AM, Jay Pipes <[email protected]> wrote: > Joe Daly wrote: >> >> Joe Daly has proposed merging lp:~skinny.moey/drizzle/stats into >> lp:drizzle. > > Hi! Good work getting this far! I know the code can be difficult to follow > in a number of places. :) I'm cc'ing drizzle-discuss@ as well, to get more > suggestions and input from the mailing list. > >> What works right now (not much) (updates done in different connection): >> >> drizzle> select * from DRIZZLE_STATS_I_S; >> +------+-----------------+ >> | USER | UPDATE_COMMANDS | >> +------+-----------------+ >> | root | 1 | >> +------+-----------------+ >> 1 row in set (0 sec) >> >> drizzle> select * from DRIZZLE_STATS_I_S; >> +------+-----------------+ >> | USER | UPDATE_COMMANDS | >> +------+-----------------+ >> | root | 2 | >> +------+-----------------+ >> 1 row in set (0 sec) >> >> drizzle> select * from DRIZZLE_STATS_I_S; >> +---------+-----------------+ >> | USER | UPDATE_COMMANDS | >> +---------+-----------------+ >> | drizzle | 1 | >> | root | 2 | >> +---------+-----------------+ >> 2 rows in set (0 sec) > > OK, so here are my general thoughts on the functionality exposed in this > patch. I'll comment on the code specifics later on during code review and > on IRC... > > The overall goal is to get two views (tables) added to the > INFORMATION_SCHEMA virtual database which contain counter information > segmented by username and hostname. > > The V2 Google patch of MySQL had the following definition for its > USER_STATISTICS view: > > CREATE TABLE INFORMATION_SCHEMA.USER_STATISTICS ( > USER VARCHAR(255) NOT NULL > , TOTAL_CONNECTIONS BIGINT NOT NULL > , CONCURRENT_CONNECTIONS BIGINT NOT NULL > , CONNECTED_TIME BIGINT NOT NULL > , BUSY_TIME BIGINT NOT NULL > , CPU_TIME BIGINT NOT NULL > , BYTES_RECEIVED BIGINT NOT NULL > , BYTES_SENT BIGINT NOT NULL > , BINLOG_BYTES_WRITTEN BIGINT NOT NULL > , ROWS_FETCHED BIGINT NOT NULL > , ROWS_UPDATED BIGINT NOT NULL > , TABLE_ROWS_READ BIGINT NOT NULL > , SELECT_COMMANDS BIGINT NOT NULL > , UPDATE_COMMANDS BIGINT NOT NULL > , OTHER_COMMANDS BIGINT NOT NULL > , COMMIT_TRANSACTIONS BIGINT NOT NULL > , ROLLBACK_TRANSACTIONS BIGINT NOT NULL > , DENIED_CONNECTIONS BIGINT NOT NULL > , LOST_CONNECTIONS BIGINT NOT NULL > , ACCESS_DENIED BIGINT NOT NULL > , EMPTY_QUERIES BIGINT NOT NULL > , PRIMARY KEY (USER) > ); > > Info on this is available here: > > http://code.google.com/p/google-mysql-tools/wiki/UserTableMonitoring > > A similar view, called CLIENT_STATISTICS, differs only in the primary key, > which instead of the user name is the user's host ip address. > > I think that before you continue any more work on this branch, we should > first discuss whether the above view definition is appropriate for Drizzle > and whether we should change it up... > > Personally, I think we should change it up. :) Here are the > issues/questions I have about the above definition: > > 1) Why have ROWS_UPDATED instead of ROWS_INSERTED, ROWS_DELETED, > ROWS_UPDATED? I'd prefer to have more granular stats for the user, myself, > and knowing the code, it wouldn't be particularly difficult to make the > collection more granular.
I much prefer to have the data split as you describe. The port of TABLE_STATISTICS to the Facebook MySQL patch does the same. > > 2) CONCURRENT_CONNECTIONS is supposed to represent the "current value" of > the number of concurrent connections this user has to the server. I think > that having an additional column containing the maximum number of concurrent > connections this user has created would be useful as well: That would be nice to have. I was asked for it several times internally. You need a way to reset it over time. > > MAX_CONCURRENT_CONNECTIONS BIGINT NOT NULL Computing concurrent connections per-account made the feature much more complex. Can you avoid the complexity in the Drizzle version of this? > > 3) ROWS_FETCHED vs TABLE_ROWS_READ. What's the difference? ROWS_FETCHED needs a better name -- ROWS_RETURNED. -- Mark Callaghan [email protected] _______________________________________________ Mailing list: https://launchpad.net/~drizzle-discuss Post to : [email protected] Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp

