 {EventEmitter}   = require('events')
+parseUrl         = require('url').parse
 querystring      = require('querystring')
 
 request          = require('request')

    constructor : (options) ->
        # id is a unique client identifier in all client processes
        {@eventDescriptors, @createBrowser, 
        @appAddress, @cbhost, @stats,
        @id, @serverLogging} = options
        @stopped = false
        @eventContext = new benchmarkConfig.EventContext({clientId:@id})

}

opts = require('nomnom').options(options).script(process.argv[1]).parse()

if opts.appAddress?
    parsedUrl = parseUrl(opts.appAddress)
    opts.cbhost = "http://#{parsedUrl.hostname}"
    # host contains port
    opts.socketioUrl = "http://#{parsedUrl.host}"
    logger("assign cbhost #{opts.cbhost} , socketio url #{opts.socketioUrl}")


eventDescriptorReader = new benchmarkConfig.EventDescriptorsReader({fileName:opts.configFile})
eventDescriptorReader.read((err, eventDescriptors)->
