General tools for queueing analysis