diff --git a/.gitignore b/.gitignore index 9dcf0e17b..427d5ddaf 100644 --- a/.gitignore +++ b/.gitignore @@ -50,8 +50,6 @@ experimental/genreport/genreport experimental/graphviz/graphviz experimental/oneshot/oneshot experimental/_integration/_integration -experimental/tracer/main/main -experimental/tracer/tracer.tar *sublime-project *sublime-workspace *npm-debug.log diff --git a/experimental/example/app/app.py b/experimental/example/app/app.py index 696cc2a83..356ff040d 100644 --- a/experimental/example/app/app.py +++ b/experimental/example/app/app.py @@ -48,12 +48,26 @@ def ignore_error(f): logging.error("Error executing function", exc_info=sys.exc_info()) return "Error" -@app.route('/') +# this root is for the tracing demo +@app.route('/hello') def hello(): qotd_msg = do_qotd() qotd_msg = do_echo(qotd_msg) return qotd_msg +# this is for normal demos +@app.route('/') +def root(): + counter_future = pool.submit(do_redis) + search_future = pool.submit(do_search) + qotd_future = pool.submit(do_qotd) + echo_future = pool.submit(lambda: do_echo("foo")) + result = 'Hello World! I have been seen %s times.' % ignore_error(counter_future.result) + result += ignore_error(search_future.result) + result += ignore_error(qotd_future.result) + result += ignore_error(echo_future.result) + return result + if __name__ == "__main__": logging.basicConfig(format='%(asctime)s %(levelname)s %(filename)s:%(lineno)d - %(message)s', level=logging.INFO) WSGIRequestHandler.protocol_version = "HTTP/1.1" diff --git a/experimental/example/run.sh b/experimental/example/run.sh index 8696d4dab..8be48875e 100755 --- a/experimental/example/run.sh +++ b/experimental/example/run.sh @@ -19,6 +19,12 @@ start_container() { done } +start_container 1 elasticsearch elasticsearch +start_container 2 tomwilkie/searchapp searchapp +start_container 1 redis redis start_container 1 tomwilkie/qotd qotd -start_container 1 tomwilkie/app app start_container 1 tomwilkie/echo echo +start_container 2 tomwilkie/app app +start_container 2 tomwilkie/frontend frontend --add-host=dns.weave.local:$(weave docker-bridge-ip) +start_container 1 tomwilkie/client client +