Skip to content

Commit 906ba91

Browse files
committed
Adding misc files to support flot graph library. Also completed phase 1 of getting the curved force diagram working. Closes #21.
1 parent 7b47773 commit 906ba91

24 files changed

+11964
-35
lines changed

graph.json

+1,330
Large diffs are not rendered by default.

miserables.json

+337
Large diffs are not rendered by default.

seed.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def load_env(data):
9494
def load_api(data):
9595
"""Load values relating to the API as a whole."""
9696

97-
# [[TODO: Merge identical lines into the DB]]
97+
# [[TODO: Don't issue api_id unless successful add]]
9898

9999
# Read data from csv file and insert rows
100100
# But skip the header row: data[0]

server.py

+15-16
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ def get_weighted_avg_latency(sql_filter):
7171
# Intitialize the total_latency variable
7272
total_latency = Decimal(0)
7373

74-
# Iterate through each item in the list and add it to the total
75-
# for latency in all_latency:
76-
# total_latency += latency[0]
77-
7874
# Get the volume percent for each call
7975
# Returns a dictionary
8076
env_call_volumes = calc_call_volume(sql_filter)
@@ -101,15 +97,6 @@ def index():
10197

10298
sql_filter = '%prod%'
10399

104-
# all_latency = db.session.query(Agg_Request.avg_response_time).filter(Agg_Request.call_code.like(sql_filter)).all()
105-
106-
# total_latency = Decimal(0)
107-
108-
# for latency in all_latency:
109-
# total_latency += latency[0]
110-
111-
# avg_latency = total_latency / len(all_latency)
112-
113100
avg_latency = get_weighted_avg_latency(sql_filter)
114101

115102
# Compare avg_latency to a range of values.
@@ -173,18 +160,30 @@ def calls_by_type():
173160

174161
return render_template("calls.html", agg_requests=agg_requests, env_total=env_total)
175162

163+
176164
@app.route('/d3')
177165
def show_apps_customers():
178166
"""Show relationship of apps to their customers and vice versa."""
179167

180168
return render_template("d3.html")
181169

182-
@app.route('/d3-force')
183-
def show_apps():
170+
171+
@app.route('/d3-force-curve')
172+
def show_apps_curve():
173+
"""Show relationship of apps to their customers and vice versa."""
174+
175+
return render_template("d3-force-curve.html")
176+
177+
178+
@app.route('/miserables.json')
179+
def render_d3_relationships():
184180
"""Show relationship of apps to their customers and vice versa."""
185181

182+
json_string = open('miserables.json').read()
183+
184+
# data_dict = json.loads(json_string)
186185

187-
return render_template("d3-force.html", jsonify(graph.json))
186+
return json_string
188187

189188

190189
################################################################################

static/img/favicon-96x96.png

4.85 KB
Loading

0 commit comments

Comments
 (0)