MySQL Forums
Forum List  »  Router & Proxy

Re: i want to write lua script for mysql-proxy,but how can i know the data struct of mysql-proxy?
Posted by: Chris Calender
Date: December 04, 2009 08:51PM

You can see what is stored in proxy.global.backends using the following output commands (in read_query_result()):

print("| #proxy.global.backends = " .. #proxy.global.backends)
print("| proxy.global.backends[ndx].dst.name = " .. proxy.global.backends[backend_ndx].dst.name)
print("| proxy.global.backends[ndx].dst.address = " .. proxy.global.backends[backend_ndx].dst.address)
print("| proxy.global.backends[ndx].dst.port = " .. proxy.global.backends[backend_ndx].dst.port)
print("| proxy.global.backends[ndx].connected_clients = " .. proxy.global.backends[backend_ndx].connected_clients)
print("| proxy.global.backends[ndx].state = " .. proxy.global.backends[backend_ndx].state)
print("| proxy.global.backends[ndx].pool.max_idle_connections = " .. proxy.global.backends[backend_ndx].pool.max_idle_connections)
print("| proxy.global.backends[ndx].pool.min_idle_connections = " .. proxy.global.backends[backend_ndx].pool.min_idle_connections)
print("| proxy.global.backends[ndx].pool.users[1] = " .. proxy.global.backends[backend_ndx].pool.users[1].cur_idle_connections)

Note it is an array, so if you have more than 1 backend, you'll want to use a loop.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: i want to write lua script for mysql-proxy,but how can i know the data struct of mysql-proxy?
3028
December 04, 2009 08:51PM


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.