Add monitors for query cache and ast cache

add planning monitor
add timing listener to keep track of how much is spent in each planning phase