@@ -71,10 +71,6 @@ def get_weighted_avg_latency(sql_filter):
71
71
# Intitialize the total_latency variable
72
72
total_latency = Decimal (0 )
73
73
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
-
78
74
# Get the volume percent for each call
79
75
# Returns a dictionary
80
76
env_call_volumes = calc_call_volume (sql_filter )
@@ -101,15 +97,6 @@ def index():
101
97
102
98
sql_filter = '%prod%'
103
99
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
-
113
100
avg_latency = get_weighted_avg_latency (sql_filter )
114
101
115
102
# Compare avg_latency to a range of values.
@@ -173,18 +160,30 @@ def calls_by_type():
173
160
174
161
return render_template ("calls.html" , agg_requests = agg_requests , env_total = env_total )
175
162
163
+
176
164
@app .route ('/d3' )
177
165
def show_apps_customers ():
178
166
"""Show relationship of apps to their customers and vice versa."""
179
167
180
168
return render_template ("d3.html" )
181
169
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 ():
184
180
"""Show relationship of apps to their customers and vice versa."""
185
181
182
+ json_string = open ('miserables.json' ).read ()
183
+
184
+ # data_dict = json.loads(json_string)
186
185
187
- return render_template ( "d3-force.html" , jsonify ( graph . json ))
186
+ return json_string
188
187
189
188
190
189
################################################################################
0 commit comments