boto/boto — pull request #983 by jtlebi (2012-09-12 20:23:59+00:00)
Title: add perf logger + dynamodb trace

Add a new logger "boto.log" dedicated to performance analysis. It is separated from the main "boto" logger as their purpose is very different and I did not want to clutter my regular logs.

The first implementation is on dynamodb.layer1.make_request. It reports:

- API version + version ('X-Amz-Target' request header)
- Request ID ('RequestId' answer header)
- time in milliseconds using 2 datetimes

I see 2 use cases for this:

- track all requests to see what can can be optimized/caches (And I had surprises :) )
- record requestID which are needed by Amazon's support in case something goes wrong

I replaces a previous attempt which had a couple of design flaws

- use of instance members with no protection -> no thread safety
- array never cleaned -> memory leaks
- hard to use: you have to toggle an undocumented flag in layer1 directly with no helpers on a higher level.

Lat but not least, I saw no document about the loggers in the official documentation, I can drop a few lines if you want. What is the best place for this ?