diff --git a/router/api.py b/router/api.py index 8b849a3..5478412 100644 --- a/router/api.py +++ b/router/api.py @@ -54,8 +54,9 @@ def orders_count_by_name(): finally: # 取消订阅并关闭消费者 consumer.close() - + print(messages) return jsonify(messages) + @api_bp.route('/stream/ordernamecount') diff --git a/router/page.py b/router/page.py index 91ea9b5..8b9a7a5 100644 --- a/router/page.py +++ b/router/page.py @@ -10,3 +10,19 @@ def index(): @page_bp.route('/show') def test(): return render_template('show.html') + +@page_bp.route('/ordercount') +def ordercount(): + return render_template('ordercount.html') + +@page_bp.route('/streamordersummary') +def streamodersummary(): + return render_template('streamordersummary.html') + +@page_bp.route('/streamordernamecount') +def streamodernamecount(): + return render_template('streamordernamecount.html') + +@page_bp.route('/streamsummary') +def streamsummary(): + return render_template('streamsummary.html') diff --git a/templates/index.html b/templates/index.html index 77ecd81..249b922 100644 --- a/templates/index.html +++ b/templates/index.html @@ -3,13 +3,81 @@ - 哇哦哦哦哦哦哦哦哦哦哦哦哦哦哦哦哦 + 订单信息实时统计系统 + + + -
-
- + +
+ + + +
+
+ +
+
+ + +
+ +
+ +
+ +
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+

制作人员名单

+

郭子奇:架构设计,服务器部署和Python代码调试

+

许家禾:spark streaming&spark core/rdd

+

李尧宇:环境部署,在Kafka中创建主题order用Python代码实现producer,并每隔5秒推送数据给Kafka的order主题

+

李烁升:使用spark streaming每隔两秒实时统计所有订单类别的数量

+

郭志胜:数据生产及数据展示

+

陈楠:使用spark sql统计各个订单的有效数和无效数量

+ + + + - \ No newline at end of file + diff --git a/templates/ordercount.html b/templates/ordercount.html new file mode 100644 index 0000000..4accd45 --- /dev/null +++ b/templates/ordercount.html @@ -0,0 +1,89 @@ + + + + + + 动态订单柱状图 + + + + +

订单数量柱状图

+ + + + + diff --git a/templates/streamordernamecount.html b/templates/streamordernamecount.html new file mode 100644 index 0000000..abfc0cf --- /dev/null +++ b/templates/streamordernamecount.html @@ -0,0 +1,91 @@ + + + + + + 动态订单数量图表 + + + + +

订单名称数量动态图表

+ + + + + diff --git a/templates/streamordersummary.html b/templates/streamordersummary.html new file mode 100644 index 0000000..1f0dff0 --- /dev/null +++ b/templates/streamordersummary.html @@ -0,0 +1,91 @@ + + + + + + 动态订单数量图表 + + + + +

订单数量动态图表

+ + + + + diff --git a/templates/streamsummary.html b/templates/streamsummary.html new file mode 100644 index 0000000..e4343c2 --- /dev/null +++ b/templates/streamsummary.html @@ -0,0 +1,100 @@ + + + + + + 订单数量随时间变化图表 + + + + +

订单数量随时间变化图表

+ + + + +