iconara/cql-rb — pull request #54 by iconara (2013-10-27 19:02:35+00:00)
Title: Tracing support

I've started to implement #38, but haven't found a good way to make it work with both the synchronous and asynchronous API.

With this implementation you can do (notice the call to `#value` because `#trace` returns a future, even when the `QueryResult` was obtained through a synchronous client):

```ruby
result = client.execute('SELECT * FROM something', trace: true)
value = result.trace.value
puts trace.duration
trace.events.each do |event|
puts event.activity
end
```

If a trace hasn't been fully written (i.e. the `duration` field hasn't been set) calling `#trace` will raise a `IncompleteTraceError`. This is how the Java driver works (although it also automatically retries the request in an ugly synchronous loop).