   
   unregister: (id = null) ->
     return Hapi.Error.badRequest("No such benchmark found by that id (#{id})") if id == null or (@benchmark and @benchmark.id and @benchmark.id != id)
-    benchmark = finalizeData()
+    benchmark = @finalizeData()
     stats = @statistics(benchmark)
     return stats
   

  
  cleanup: (err = null) =>
    throw err if err
    @stop()
    @stopAdmin()
    process.nextTick(() ->
      process.exit()
    )
    # clear timers, etc
  
  pollMetrics: () =>
    if @server and @server.send

    benchmark = @benchmark
    @benchmark = null
    # TODO: write backup of benchmark data to disk
    backupFilename = path.join(__dirname, "../support/", @now() + ".coffee")
    fs.writeFileSync(backupFilename, JSON.stringify(benchmark))
    
    return benchmark
  
  statistics: (data) ->
    console.log(data)
    return data # TODO:
  
  aggregate: (action, timestamp, increment = 1) ->
    return null if @benchmark == null
    
    inc = parseInt(increment)
    throw "#{increment} is not a valid increment value for @aggregate" if isNaN(inc)
    
    if not @benchmark.hasOwnProperty(action)
      @benchmark[action] = {} 
    if not @benchmark[action].hasOwnProperty(timestamp)
      @benchmark[action][timestamp] = 0
    @benchmark[action][timestamp] += inc
  
  record: (action, timestamp, data = true) ->
    return null if @benchmark == null
