def _setup_services(self, watchman):
    # N.B. This inline import is currently necessary to avoid a circular reference in the import
    # of LocalPantsRunner for use by DaemonPantsRunner. This is because LocalPantsRunner must
    # ultimately import the pantsd services in order to itself launch pantsd.
    from pants.bin.daemon_pants_runner import DaemonExiter, DaemonPantsRunner

    pailgun_service = PailgunService((self._pailgun_host, self._pailgun_port),
                                     DaemonExiter,
                                     DaemonPantsRunner)
    services = [pailgun_service]

    if self._fs_event_enabled and self._scheduler:
      fs_event_service = FSEventService(watchman, self._build_root, self._fs_event_workers)
      scheduler_service = SchedulerService(self._scheduler, fs_event_service)
      services.extend((fs_event_service, scheduler_service))

    # Construct a mapping of named ports used by the daemon's services. In the default case these
    # will be randomly assigned by the underlying implementation so we can't reference via options.
    port_map = dict(pailgun=pailgun_service.pailgun_port)

    return tuple(services), port_map
Reads the index-wide stats.
dataset/ETHPy150Open pantsbuild/pants/src/python/pants/pantsd/subsystem/pants_daemon_launcher.py/PantsDaemonLauncher._setup_services--crossover with--dataset/ETHPy150Open toastdriven/microsearch/microsearch.py/Microsearch.read_stats