js-platform/node-webrtc — pull request #143 by markandrus (2014-09-09 02:53:53+00:00)
Title: Add getStats support

Branching off of #128, this adds minimal `getStats` support, roughly matching the interface in Chrome today.

Here's how I'm using it in my script (same as in Chrome):

```js
peerConnection.getStats(function(response) {
var reports = response.result();
reports.forEach(function(report) {
var obj = {
timestamp: report.timestamp,
type: report.type
};
var names = report.names();
names.forEach(function(name) {
obj[name] = report.stat(name);
});
console.log(obj);
});
}, console.error.bind(console));
```

This adds a new `AsyncEventType`, `GetStatsEvent`, and a `StatsObserver`.

@modeswitch Wondering if you have any insight into how to more programmatically generate these bindings? This was pretty mechanical.