Re: Lua script to count executed queries
if not proxy.global.stats then
proxy.global.stats = {
}
end
function read_query(packet)
local stats = proxy.global.stats
local db = proxy.connection.client.default_db
if not stats[db] then
stats[db] = {
queries = 0
}
end
stats[db].queries = stats[db].queries + 1
end
That's all you have to do. Check the code in the lib-folder how to intercept queries to return the counters.
--
Jan Kneschke, MySQL Enterprise Tools
Subject
Views
Written By
Posted
3995
April 02, 2008 08:31AM
Re: Lua script to count executed queries
2846
April 02, 2008 10:36AM
2631
April 03, 2008 04:49AM
2528
April 04, 2008 10:23AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.