     addError : () ->
         @errorCount++
 
+    mergeStat : (stat) ->
+        @count += stat.count
+        @total += stat.total
+        @errorCount += stat.errorCount
+        return this
 
 
 # eventCount contains the event to create browser

, 3000
)
###

clientProcess = new ClientProcess({
    browserCount : 2
    clientCount : 4
    eventCount : 500*500
    appAddress : 'http://localhost:3000/benchmark'
    cbhost : 'http://localhost:3000'
    delay : 1500
    processId : 'p01'
    clientEvent : dumbEvent
    })







        @stopped = true
        return true

    computeStat:()->
        @stat = new Stat()
        @otherStat = {}
        for clientGroup in @clientGroups
            for client in clientGroup.clients
                @stat.mergeStat(client.stat)
                for k, v of client.otherStat
                    if not @otherStat[k]
                        @otherStat[k] = new Stat()
                    @otherStat[k].add(v)


# clients that share 1 browser
