mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 02:00:43 +00:00
Update example app.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user