         # at this point.
         # forceNew is mandatory or socket-io will reuse a connection!!!!
         @socket = socketio(@cbhost, { query: queryString, forceNew:true })
-        @otherStat.socketioClientCreateTime = @_timpeElapsed()
+        @stats.add('socketioClientCreateTime', @_timpeElapsed())
+        
         @socket.on('error',(err)=>
             @_fatalErrorHandler(err)
         )

            clientGroupOptions.clientCount = clientsPerGroup
            clientGroupOptions.browserCount = browsersPerGroup
            clientGroupOptions.groupName = "#{@processId}_g#{i}"
            clientGroup = new ClientGroup(clientGroupOptions)
            @clientGroups.push(clientGroup)
        # set up a timeout checker per process

        @errorCount += stat.errorCount
        return this

class StatProvider
    constructor: () ->
        @stats = {}

    _getStat : (key)->
        if not @stats[key]?
            @stats[key] = new Stat()
        return @stats[key]

    add: (key, num)->
        @_getStat(key).add(num)

    addError : (key)->
        @_getStat(key).addError()

        
    



# eventCount contains the event to create browser
class Client extends EventEmitter
    constructor : (options) ->
        # id is a unique client identifier in all client processes
        {@eventDescriptors, @createBrowser, 
        @appAddress, @cbhost, @stats,
        @id, @serverLogging} = options
        @eventContext = new benchmarkConfig.EventContext({clientId:@id})
        @eventQueue = new benchmarkConfig.EventQueue({
            descriptors : @eventDescriptors
            context : @eventContext
            })

    addChild : (child) ->
        @once('browserconfig', (browserConfig)->
