mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Replace curl with little python script
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import os
|
||||
import socket
|
||||
import requests
|
||||
import random
|
||||
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
from flask import Flask
|
||||
from redis import Redis
|
||||
@@ -9,6 +11,8 @@ app = Flask(__name__)
|
||||
redis = Redis(host='redis', port=6379)
|
||||
pool = ThreadPoolExecutor(max_workers=10)
|
||||
|
||||
goapps = ['http://goapp1:8080/', 'http://goapp2:8080/']
|
||||
|
||||
def do_redis():
|
||||
redis.incr('hits')
|
||||
return redis.get('hits')
|
||||
@@ -23,7 +27,7 @@ def do_qotd():
|
||||
s.close()
|
||||
|
||||
def do_search():
|
||||
r = requests.get('http://goapp:8080/')
|
||||
r = requests.get(random.choice(goapps))
|
||||
return r.text
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user