So, yesterday we left off with the knowledge that
fromAll().whenAny(function(s, e) {
if(e.body && e.body.repo) {
var date = new Date(e.body.created_at)
var dateString = date.getUTCFullYear() + ‘’ + date.getUTCMonth() + ‘’ + date.getUTCDate()
linkTo(‘day-’ + dateString, e)
}
}
)
combined with
fromCategory(‘day’)
.foreachStream()
.whenAny(function(s, e) {
if(e.body && e.body.repo) {
var date = new Date(e.body.created_at)
var hour = date.getUTCHours()
if(typeof s[hour] === ‘undefined’)
s[hour] = 0
s[hour]++
}
})
wasn’t going to work, although
fromStream(‘day-20121112’)
.whenAny(function(s, e) {
if(e.body && e.body.repo) {
var date = new Date(e.body.created_at)
var hour = date.getUTCHours()
if(typeof s[hour] === ‘undefined’)
s[hour] = 0
s[hour]++
}
})
would - so that left me with a sadface as my per-day statistics can’t happen otherwise.
Moving on, I have some more queries to look at and can ignore that these don’t work for now in doing that and look at how to do
-
Most active users
-
Most active repos
This would ordinarily be done per re-partitioned day-stream, but I’ll have a stab at doing them on the main github event stream instead
I’ll also go on and see if I can do some temporal work, such as
“how long does it usually take before an issue gets closed”
“which projects have their owners respond to new issues fastest”
“which projects have their owners respond to new issues slowest”
I’m not sure how to do any of this, although with some digging around I’m sure I’ll manage, as per yesterday, any tips for the above would be appreciated as well as “That’s not possible” or “that’s not what you’d use that for”