test
This commit is contained in:
20
app.py
Normal file
20
app.py
Normal file
@ -0,0 +1,20 @@
|
||||
from flask import Flask, jsonify, render_template
|
||||
from monitor.node import check_network_health, measure_latency, check_bandwidth
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
return render_template('index.html')
|
||||
|
||||
@app.route('/api/metrics')
|
||||
def get_metrics():
|
||||
metrics = {
|
||||
'network_health': check_network_health(),
|
||||
'latency': measure_latency(),
|
||||
'bandwidth': check_bandwidth()
|
||||
}
|
||||
return jsonify(metrics)
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True)
|
||||
Reference in New Issue
Block a user