Initialize a new `ProxyReporter` reporter.

@param {Runner} runner
@api public
555276
function ForwardMochaReporter(mochaRunner, options) {
    Base.call(this, mochaRunner, options);
    forwardEvent(mochaRunner, runner, 'start');
    forwardEvent(mochaRunner, runner, 'suite');
    forwardEvent(mochaRunner, runner, 'suite end');
    forwardEvent(mochaRunner, runner, 'pending');
    forwardEvent(mochaRunner, runner, 'pass');
    forwardEvent(mochaRunner, runner, 'fail');
    // when runner output should be captured, it is done for the end event only.
    mochaRunner.on('end', function () {
        try {
            if (outputFile) {
                console.log(outputFile);
                captureStdout(outputFile);
            }
            var args = Array.prototype.slice.call(arguments, 0);
            runner.emit.apply(runner, ['end'].concat(args));
            releaseStdout();
        } catch (e) {
            releaseStdout();
        }
    });
  }
754114
def methodreporter(self):
        
        # Ensure that the analyses are set to complete
        self.analysescomplete = True
        # Reset the report path to original value
        self.reportpath = os.path.join(self.path, 'reports')
        # Clear the runmetadata - it will be populated with all the metadata from completemetadata
        self.runmetadata = MetadataObject()
        self.runmetadata.samples = list()
        # As the samples were entered into self.completemetadata depending on when they passed the quality threshold,
        # this list is not ordered numerically/alphabetically like the original runmetadata. Reset the order.
        for strain in self.samples:
            for sample in self.completemetadata:
                if sample.name == strain:
                    # Append the sample to the ordered list of objects
                    self.runmetadata.samples.append(sample)
        # Create the reports
        self.reporter()
        self.genusspecific()
        self.sixteensreporter()
        self.gdcsreporter()
        self.confindr_reporter()
1254192
public void addNewReporter(ContextAwareReporter reporter) {
    this.reporters.add(this.closer.register(reporter));
    if (this.reportingStarted) {
      reporter.start();
    }
  }
1053276
function createRunner(builderInstance) {
    
    var runnerInstance={
        name:builderInstance.name,
        builder:builderInstance,
        run: function (input,callback) {
            
            var context =
                createContext(null, (input==null) ? {} : input);
            
            exec(builderInstance.root, context, function(err,result){
                if (callback){
                    callback(err,result);
                }
            });
        },
    };
    
    return runnerInstance;
}
324099
function runInspectorProxy(port: number) {
  const inspectorProxy = new InspectorProxy();
  const app = require('connect')();
  app.use(inspectorProxy.processRequest.bind(inspectorProxy));

  const httpServer = require('http').createServer(app);
  httpServer.listen(port, '127.0.0.1', () => {
    inspectorProxy.addWebSocketListener(httpServer);
  });
}
366901
function createStatsCollector(runner) {
  /**
   * @type StatsCollector
   */
  var stats = {
    suites: 0,
    tests: 0,
    passes: 0,
    pending: 0,
    failures: 0
  };

  if (!runner) {
    throw new TypeError('Missing runner argument');
  }

  runner.stats = stats;

  runner.once(EVENT_RUN_BEGIN, function() {
    stats.start = new Date();
  });
  runner.on(EVENT_SUITE_BEGIN, function(suite) {
    suite.root || stats.suites++;
  });
  runner.on(EVENT_TEST_PASS, function() {
    stats.passes++;
  });
  runner.on(EVENT_TEST_FAIL, function() {
    stats.failures++;
  });
  runner.on(EVENT_TEST_PENDING, function() {
    stats.pending++;
  });
  runner.on(EVENT_TEST_END, function() {
    stats.tests++;
  });
  runner.once(EVENT_RUN_END, function() {
    stats.end = new Date();
    stats.duration = stats.end - stats.start;
  });
}
1007566
private void initReporter() {
    String reporterType =
      System.getProperty("net.spy.metrics.reporter.type", DEFAULT_REPORTER_TYPE);
    String reporterInterval =
      System.getProperty("net.spy.metrics.reporter.interval", DEFAULT_REPORTER_INTERVAL);
    String reporterDir =
      System.getProperty("net.spy.metrics.reporter.outdir", DEFAULT_REPORTER_OUTDIR);

    if(reporterType.equals("console")) {
      final ConsoleReporter reporter = ConsoleReporter.forRegistry(registry)
        .convertRatesTo(TimeUnit.SECONDS)
        .convertDurationsTo(TimeUnit.SECONDS)
        .build();
      reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS);
    } else if (reporterType.equals("jmx")) {
      final JmxReporter reporter = JmxReporter.forRegistry(registry)
        .convertRatesTo(TimeUnit.SECONDS)
        .convertDurationsTo(TimeUnit.SECONDS)
        .build();
      reporter.start();
    } else if (reporterType.equals("csv")) {
      final CsvReporter reporter = CsvReporter.forRegistry(registry)
        .convertRatesTo(TimeUnit.SECONDS)
        .convertDurationsTo(TimeUnit.SECONDS)
        .build(new File(reporterDir));
      reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS);
    } else if (reporterType.equals("slf4j")) {
      final Slf4jReporter reporter = Slf4jReporter.forRegistry(registry)
        .convertRatesTo(TimeUnit.SECONDS)
        .convertDurationsTo(TimeUnit.SECONDS)
        .outputTo(LoggerFactory.getLogger(MetricCollector.class))
        .build();
      reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS);
    } else {
        throw new IllegalStateException("Unknown Metrics Reporter Type: " + reporterType);
    }
  }
708915
def start_proxy(self, port=None):
        

        self.runner.info_log("Starting proxy...")

        # Get a random port that is available
        if not port:
            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            sock.bind(('0.0.0.0', 0))
            sock.listen(5)
            self.proxy_port = sock.getsockname()[1]
            sock.close()

        network_data_path = os.path.join(
            self.runner.runner_dir,
            'network_capture'
        )
        create_dir_if_doesnt_exist(network_data_path)

        self.proxy_output_path = os.path.join(
            network_data_path,
            string_to_filename('%s.data' % self.test_name)
        )

        path_to_mitmproxy = BROME_CONFIG['mitmproxy']['path']

        if not path_to_mitmproxy:
            raise Exception("""
                You need to set the mitmproxy:path config to be able
                to the use the proxy with this browser
            """)

        filter_ = BROME_CONFIG['mitmproxy']['filter']
        command = [
            path_to_mitmproxy,
            "-p",
            "%s" % self.proxy_port,
            "-w",
            self.proxy_output_path
        ]

        if filter_:
            command.append(filter_)

        process = self.execute_command(command)

        self.proxy_pid = process.pid

        self.runner.info_log("Proxy pid: %s" % self.proxy_pid)
1028368
function JSONReporter(detector) {
  BaseReporter.call(this, detector);

  detector.on('start', function() {
    process.stdout.write('[');
  });

  detector.on('end', function() {
    process.stdout.write("]\n");
  });
}
700859
protected function initializeProxy(): void
    {
        //Initialize internal vars
        $this->states = [];
        $this->activesStates = [];
        $this->callerStatedClassesStack = new \SplStack();
        //Creates
        $this->loadStates();
    }
208862
private static synchronized void proxyInit() {
        if (PROXY_HOST != null && customRouterPlanner == null) {
            HttpHost proxy = new HttpHost(PROXY_HOST, PROXY_PORT);
            customRouterPlanner = new DefaultProxyRoutePlanner(proxy);
        }
    }
234113
function createProxyHandler (proxies, urlRoot) {
  if (!proxies.length) {
    const nullProxy = (request, response, next) => next()
    nullProxy.upgrade = () => {}
    return nullProxy
  }

  function createProxy (request, response, next) {
    const proxyRecord = proxies.find((p) => request.url.startsWith(p.path))
    if (proxyRecord) {
      log.debug(`proxying request - ${request.url} to ${proxyRecord.host}:${proxyRecord.port}`)
      request.url = request.url.replace(proxyRecord.path, proxyRecord.baseUrl)
      proxyRecord.proxy.web(request, response)
    } else {
      return next()
    }
  }

  createProxy.upgrade = function (request, socket, head) {
    // special-case karma's route to avoid upgrading it
    if (request.url.startsWith(urlRoot)) {
      log.debug(`NOT upgrading proxyWebSocketRequest ${request.url}`)
      return
    }

    const proxyRecord = proxies.find((p) => request.url.startsWith(p.path))
    if (proxyRecord) {
      log.debug(`upgrade proxyWebSocketRequest ${request.url} to ${proxyRecord.host}:${proxyRecord.port}`)
      request.url = request.url.replace(proxyRecord.path, proxyRecord.baseUrl)
      proxyRecord.proxy.ws(request, socket, head)
    }
  }

  return createProxy
}
93059
def init_report(self, reporter=None):
        """"""
        self.options.report = (reporter or self.options.reporter)(self.options)
        return self.options.report
1289297
def init_runner(**kwargs):
    '''
    
    '''
    dump_artifacts(kwargs)

    debug = kwargs.pop('debug', None)
    logfile = kwargs.pop('logfile', None)

    if not kwargs.pop("ignore_logging", True):
        output.configure()
        if debug in (True, False):
            output.set_debug('enable' if debug is True else 'disable')

        if logfile:
            output.set_logfile(logfile)

    if kwargs.get("process_isolation", False):
        check_isolation_executable_installed(kwargs.get("process_isolation_executable", "bwrap"))

    event_callback_handler = kwargs.pop('event_handler', None)
    status_callback_handler = kwargs.pop('status_handler', None)
    cancel_callback = kwargs.pop('cancel_callback', None)
    finished_callback = kwargs.pop('finished_callback',  None)

    rc = RunnerConfig(**kwargs)
    rc.prepare()

    return Runner(rc,
                  event_handler=event_callback_handler,
                  status_handler=status_callback_handler,
                  cancel_callback=cancel_callback,
                  finished_callback=finished_callback)
1028159
def runner(self):
        
        if os.path.isfile(self.report):
            self.report_parse()
        else:
            logging.info('Starting {} analysis pipeline'.format(self.analysistype))
            # Create the objects to be used in the analyses (if required)
            general = None
            for sample in self.runmetadata.samples:
                general = getattr(sample, 'general')
            if general is None:
                # Create the objects to be used in the analyses
                objects = Objectprep(self)
                objects.objectprep()
                self.runmetadata = objects.samples
            # Run the analyses
            MLSTmap(self, self.analysistype, self.cutoff)
            # Create the reports
            self.reporter()
            # Print the metadata to a .json file
            MetadataPrinter(self)
323465
function XUnit(runner, options) {
  Base.call(this, runner, options);

  var stats = this.stats;
  var tests = [];
  var self = this;

  // the name of the test suite, as it will appear in the resulting XML file
  var suiteName;

  // the default name of the test suite if none is provided
  var DEFAULT_SUITE_NAME = 'Mocha Tests';

  if (options && options.reporterOptions) {
    if (options.reporterOptions.output) {
      if (!fs.createWriteStream) {
        throw createUnsupportedError('file output not supported in browser');
      }

      mkdirp.sync(path.dirname(options.reporterOptions.output));
      self.fileStream = fs.createWriteStream(options.reporterOptions.output);
    }

    // get the suite name from the reporter options (if provided)
    suiteName = options.reporterOptions.suiteName;
  }

  // fall back to the default suite name
  suiteName = suiteName || DEFAULT_SUITE_NAME;

  runner.on(EVENT_TEST_PENDING, function(test) {
    tests.push(test);
  });

  runner.on(EVENT_TEST_PASS, function(test) {
    tests.push(test);
  });

  runner.on(EVENT_TEST_FAIL, function(test) {
    tests.push(test);
  });

  runner.once(EVENT_RUN_END, function() {
    self.write(
      tag(
        'testsuite',
        {
          name: suiteName,
          tests: stats.tests,
          failures: 0,
          errors: stats.failures,
          skipped: stats.tests - stats.failures - stats.passes,
          timestamp: new Date().toUTCString(),
          time: stats.duration / 1000 || 0
        },
        false
      )
    );

    tests.forEach(function(t) {
      self.test(t);
    });

    self.write('</testsuite>');
  });
}
597252
function Runner(emitter, config) {
  debug('RUNNER INIT');
  var dotStrider = path.join(process.env.HOME || '/', '.strider');
  this.config = _.extend({
    pty: false,
    io: new EventEmitter2({
      wildcard: true
    }),
    processJob: core.process,
    pluginDir: path.join(__dirname, '../node_modules'),
    dataDir: process.env.STRIDER_CLONE_DEST || dotStrider,
    concurrentJobs: parseInt(process.env.CONCURRENT_JOBS || '1', 10) || 1,
    defaultRecentBuilds: parseInt(process.env.DEFAULT_RECENT_BUILDS || '1', 10) || 1
  }, config);
  this.emitter = emitter;
  this.queue = new JobQueue(this.processJob.bind(this), this.config.concurrentJobs);
  this.io = this.config.io;
  this.callbackMap = {};
  this.hooks = [];
  this.jobdata = new JobData(this.io);
  this.attach();
}