Beispiel #1
0
    def _prepare_env(self, car, node_name, java_home, t):
        env = {}
        env.update(os.environ)
        env.update(car.env)
        self._set_env(env,
                      "PATH",
                      os.path.join(java_home, "bin"),
                      separator=os.pathsep)
        # Don't merge here!
        env["JAVA_HOME"] = java_home

        # we just blindly trust telemetry here...
        for k, v in t.instrument_candidate_env(car, node_name).items():
            self._set_env(env, k, v)

        exit_on_oome_flag = "-XX:+ExitOnOutOfMemoryError"
        if jvm.supports_option(java_home, exit_on_oome_flag):
            self.logger.info(
                "Setting [%s] to detect out of memory errors during the benchmark.",
                exit_on_oome_flag)
            self._set_env(env, "ES_JAVA_OPTS", exit_on_oome_flag)
        else:
            self.logger.info(
                "JVM does not support [%s]. A JDK upgrade is recommended.",
                exit_on_oome_flag)

        self.logger.debug("env for [%s]: %s", node_name, str(env))
        return env
Beispiel #2
0
    def _prepare_env(self, car, node_name, t):
        env = {}
        env.update(os.environ)
        env.update(car.env)
        # Unix specific!:
        self._set_env(env, "PATH", "%s/bin" % self.java_home, separator=":")
        # Don't merge here!
        env["JAVA_HOME"] = self.java_home

        # we just blindly trust telemetry here...
        for k, v in t.instrument_candidate_env(car, node_name).items():
            self._set_env(env, k, v)

        exit_on_oome_flag = "-XX:+ExitOnOutOfMemoryError"
        if jvm.supports_option(self.java_home, exit_on_oome_flag):
            logger.info(
                "JVM supports [%s]. Setting this option to detect out of memory errors during the benchmark."
                % exit_on_oome_flag)
            self._set_env(env, "ES_JAVA_OPTS", exit_on_oome_flag)
        else:
            logger.info(
                "JVM does not support [%s]. Cannot detect out of memory errors. Please consider a JDK upgrade."
                % exit_on_oome_flag)

        logger.info("env for [%s]: %s" % (node_name, str(env)))
        return env
Beispiel #3
0
    def _prepare_env(self, car, node_name, t):
        env = {}
        env.update(os.environ)
        env.update(car.env)
        # Unix specific!:
        self._set_env(env, "PATH", "%s/bin" % self.java_home, separator=":")
        # Don't merge here!
        env["JAVA_HOME"] = self.java_home

        # we just blindly trust telemetry here...
        for k, v in t.instrument_candidate_env(car, node_name).items():
            self._set_env(env, k, v)

        exit_on_oome_flag = "-XX:+ExitOnOutOfMemoryError"
        if jvm.supports_option(self.java_home, exit_on_oome_flag):
            logger.info("JVM supports [%s]. Setting this option to detect out of memory errors during the benchmark." % exit_on_oome_flag)
            self._set_env(env, "ES_JAVA_OPTS", exit_on_oome_flag)
        else:
            logger.info("JVM does not support [%s]. Cannot detect out of memory errors. Please consider a JDK upgrade." % exit_on_oome_flag)

        logger.info("env for [%s]: %s" % (node_name, str(env)))
        return env