funboost 48.0__py3-none-any.whl → 48.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of funboost might be problematic. Click here for more details.

Files changed (33) hide show
  1. funboost/__init__.py +1 -1
  2. funboost/constant.py +7 -0
  3. funboost/consumers/base_consumer.py +129 -68
  4. funboost/core/active_cousumer_info_getter.py +60 -0
  5. funboost/core/function_result_status_saver.py +1 -1
  6. funboost/function_result_web/__pycache__/functions.cpython-37.pyc +0 -0
  7. funboost/function_result_web/__pycache__/functions.cpython-39.pyc +0 -0
  8. funboost/function_result_web/app.py +104 -7
  9. funboost/function_result_web/functions.py +17 -4
  10. funboost/function_result_web/static/css/content_page_style.css +39 -0
  11. funboost/function_result_web/static/images/favicon.ico +0 -0
  12. funboost/function_result_web/static/js/bootstrap-datetimepicker.min.js +2 -0
  13. funboost/function_result_web/static/js/echarts.min.js +32478 -0
  14. funboost/function_result_web/static/js/moment-with-locales.min.js +1 -0
  15. funboost/function_result_web/static/js/select2.min.js +2 -0
  16. funboost/function_result_web/templates/about.html +67 -0
  17. funboost/function_result_web/templates/conusme_speed.html +217 -0
  18. funboost/function_result_web/templates/fun_result_table.html +433 -0
  19. funboost/function_result_web/templates/index.html +194 -423
  20. funboost/function_result_web/templates/index_backup.html +475 -0
  21. funboost/function_result_web/templates/index_/321/204/342/225/225/320/235/321/205/320/237/320/277/321/206/320/232/320/250/321/205/320/237/320/260.html +153 -0
  22. funboost/function_result_web/templates/queue_op.html +490 -0
  23. funboost/function_result_web/templates/running_consumer_by_ip.html +220 -0
  24. funboost/function_result_web/templates/running_consumer_by_queue_name.html +216 -0
  25. funboost/timing_job/timing_push.py +24 -24
  26. funboost/utils/dependency_packages_in_pythonpath/aioredis/readme.md +0 -6
  27. funboost/utils/dependency_packages_in_pythonpath/readme.md +0 -6
  28. {funboost-48.0.dist-info → funboost-48.1.dist-info}/METADATA +78 -76
  29. {funboost-48.0.dist-info → funboost-48.1.dist-info}/RECORD +33 -18
  30. {funboost-48.0.dist-info → funboost-48.1.dist-info}/WHEEL +1 -1
  31. {funboost-48.0.dist-info → funboost-48.1.dist-info}/LICENSE +0 -0
  32. {funboost-48.0.dist-info → funboost-48.1.dist-info}/entry_points.txt +0 -0
  33. {funboost-48.0.dist-info → funboost-48.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,433 @@
1
+ <!DOCTYPE html>
2
+ <html lang="zh">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
7
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
8
+ <title>pytho万能分布式函数调度框架</title>
9
+ <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
10
+ <link href="http://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
11
+ <link rel="stylesheet"
12
+ href="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/css/bootstrap-datetimepicker.min.css">
13
+ <link rel="stylesheet" href="{{ url_for('static',filename='assets/css/jquery.mCustomScrollbar.min.css') }}">
14
+ <link rel="stylesheet" href="{{ url_for('static',filename='assets/css/custom.css') }}">
15
+ <!-- 在其他 link 标签后添加 -->
16
+ <link href="https://cdn.bootcdn.net/ajax/libs/select2/4.0.13/css/select2.min.css" rel="stylesheet">
17
+ <link href="{{ url_for('static',filename='css/content_page_style.css') }}" rel="stylesheet">
18
+
19
+
20
+ <script src="{{ url_for('static',filename='js/jquery-1.11.0.min.js') }}" type="text/javascript"></script>
21
+ <!-- <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.11.0/jquery.min.js"></script> -->
22
+ <!-- 在其他 script 标签后添加 -->
23
+ <!-- <script src="https://cdn.bootcdn.net/ajax/libs/select2/4.0.13/js/select2.min.js"></script> -->
24
+ <script src="{{ url_for('static',filename='/js/select2.min.js') }}"></script>
25
+ <script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
26
+
27
+
28
+ <script src="{{ url_for('static',filename='js/moment-with-locales.min.js') }}"></script>
29
+ <script src="{{ url_for('static',filename='js/bootstrap-datetimepicker.min.js') }}"></script>
30
+ <!-- <script src="https://cdn.bootcss.com/bootstrap-datetimepicker/4.17.47/js/bootstrap-datetimepicker.min.js"></script> -->
31
+ <!-- <script type="text/javascript" src="https://cdn.bootcss.com/echarts/3.3.0/echarts.js"></script> -->
32
+ <script type="text/javascript" src="{{ url_for('static',filename='js/echarts.min.js') }}"></script>
33
+
34
+ <script src="{{ url_for('static',filename='assets/js/jquery.mCustomScrollbar.concat.min.js') }}"></script>
35
+ <script src="{{ url_for('static',filename='assets/js/custom.js') }}"></script>
36
+ <style>
37
+
38
+ </style>
39
+ </head>
40
+
41
+ <body>
42
+
43
+
44
+
45
+
46
+
47
+ <!-- <li><a href="{{url_for('logout')}}">退出</a></li> -->
48
+
49
+ <!-- 添加固定导航栏
50
+ <nav class="navbar navbar-default navbar-fixed-top" style="min-height: 40px;">
51
+ <div class="container-fluid">
52
+ <div class="navbar-header pull-right">
53
+ <a href="{{url_for('logout')}}" class="btn btn-danger" style="margin: 4px 15px;">
54
+ <i class="fa fa-sign-out"></i> 退出
55
+ </a>
56
+ </div>
57
+ </div>
58
+ </nav> -->
59
+
60
+ <!-- 删除原来的退出按钮 -->
61
+ <!-- 调整主容器的上边距 -->
62
+ <div class="container-fluid" style="margin-top: 5px;">
63
+ <div style="margin-top: 5px;">
64
+ <!-- {# <h1 style="text-align:center;">Pro sidebar template</h1>#} -->
65
+
66
+
67
+ <form class="form-inline" role="form" style="float: left">
68
+ <div class="form-group ">
69
+ <label for="col_name_search">队列名称:</label>
70
+ <select class="form-control" id="col_name_search">
71
+ <option value="">请选择队列...</option>
72
+ </select>
73
+ </div>
74
+ <div class="form-group marginLeft20">
75
+ <label for="start_time">起始时间:</label>
76
+ <input type="text" class="form-control" id="start_time">
77
+ </div>
78
+ <div class="form-group marginLeft20">
79
+ <label for="end_time">截止时间:</label>
80
+ <input type="text" class="form-control" id="end_time">
81
+ </div>
82
+ <label for="sucess_status" class="marginLeft20">函数运行状态:</label>
83
+ <select class="form-control" id="sucess_status">
84
+ <option value="1">全部</option>
85
+ <option value="2">成功</option>
86
+ <option value="3">失败</option>
87
+
88
+ </select>
89
+ <div class="form-group marginLeft20">
90
+ <label for="params">函数参数:</label>
91
+ <input type="text" class="form-control" id="params" placeholder="请输入参数。。">
92
+ </div>
93
+ <button type="button" class="btn btn-default marginLeft20"
94
+ onclick="document.getElementById('table').style.display = 'block';$('#echartsArea').css('display','none');startRun();queryResult(currentColName,0,true)">查询</button>
95
+ </form>
96
+
97
+ <!-- <button id="statistic" type="button" class="btn btn-info btn-sm marginLeft20" onclick="statistic()">生成统计表</button> -->
98
+
99
+ <button id="autoFresh" type="button" class="btn btn-success btn-sm marginLeft20" style="float2: right"
100
+ onclick="startOrStop()">自动刷新中</button>
101
+ <!-- <p id="echartsInfoTex" style="clear: both;margin-top: 30px;background-color:yellowgreen ;width:600px;color: white;text-shadow: 0 0 10px black;font-size: 16px;display: none"></p>
102
+ <p id="Last1minInfoTex" style="clear: both;margin-top: 10px;background-color:#00ccff;width:600px;color: white;text-shadow: 0 0 10px black;font-size: 16px;"></p>
103
+ <p id="resultInfoTex" style="clear: both;margin-top: 10px;background-color:green;width:600px;color: white;text-shadow: 0 0 10px black;font-size: 16px;"></p>
104
+ -->
105
+ <p id="echartsInfoTex"
106
+ style="clear: both;margin-top: 30px;background-color:yellowgreen ;width:600px;color: white;text-shadow: 0 0 10px black;font-size: 16px;display: none">
107
+ </p>
108
+ <div style="display: flex; gap: 20px; margin-top: 10px;">
109
+ <p id="resultInfoTex"
110
+ style="margin: 0; background-color:green;width:600px;color: white;text-shadow: 0 0 10px black;font-size: 16px;">
111
+ </p>
112
+ <p id="Last1minInfoTex"
113
+ style="margin: 0; background-color:#00ccff;width:600px;color: white;text-shadow: 0 0 10px black;font-size: 16px;">
114
+ </p>
115
+ </div>
116
+
117
+
118
+ <div class="table-responsive" style="margin-top: 10px;">
119
+ <table id="table" class="table table-striped">
120
+
121
+ </table>
122
+ </div>
123
+ </div>
124
+ </div>
125
+
126
+
127
+
128
+
129
+
130
+ <script>
131
+
132
+ // 在现有的变量声明后添加
133
+ var allQueues = []; // 存储所有队列数据
134
+ var currentColName;
135
+ var runStatus = 1;
136
+
137
+ $(document).ready(function () {
138
+ // ... 现有的代码 ...
139
+
140
+ // 初始化日期时间选择器
141
+ $('#start_time, #end_time').datetimepicker({
142
+ format: 'YYYY-MM-DD HH:mm:ss',
143
+ locale: 'zh-cn',
144
+ sideBySide: true, // 日期和时间选择器并排显示
145
+ showClear: true, // 显示清除按钮
146
+ showClose: true, // 显示关闭按钮
147
+ showTodayButton: true, // 显示今天按钮
148
+ icons: {
149
+ time: 'fa fa-clock-o',
150
+ date: 'fa fa-calendar',
151
+ up: 'fa fa-chevron-up',
152
+ down: 'fa fa-chevron-down',
153
+ previous: 'fa fa-chevron-left',
154
+ next: 'fa fa-chevron-right',
155
+ today: 'fa fa-crosshairs',
156
+ clear: 'fa fa-trash',
157
+ close: 'fa fa-times'
158
+ }
159
+ });
160
+
161
+ // ... 现有的代码 ...
162
+ });
163
+
164
+ // 页面加载完成后立即获取所有队列
165
+ $(document).ready(function () {
166
+ $.ajax({
167
+ url: "{{ url_for('query_cols_view')}}",
168
+ data: { col_name_search: '' },
169
+ async: true,
170
+ success: function (result) {
171
+ allQueues = result;
172
+ var html = '<option value="">请选择队列...</option>';
173
+ for (var item of result) {
174
+ html += '<option value="' + item.collection_name + '">' +
175
+ item.collection_name + ' (' + item.count + ')</option>';
176
+ }
177
+ $("#col_name_search").html(html);
178
+
179
+ // 初始化选择框的搜索功能
180
+ $("#col_name_search").select2({
181
+ placeholder: "请输入队列名称搜索...",
182
+ allowClear: true,
183
+ width: '300px'
184
+ });
185
+
186
+ // 监听选择变化
187
+ $("#col_name_search").on('change', function () {
188
+ var selectedQueue = $(this).val();
189
+ console.log("Selected queue:", selectedQueue);
190
+ currentColName = selectedQueue;
191
+ // if(selectedQueue) {
192
+ // queryResult(selectedQueue, 0, true);
193
+ // }
194
+ });
195
+ }
196
+ });
197
+ });
198
+
199
+
200
+ String.prototype.format = function () {
201
+ var values = arguments;
202
+ return this.replace(/\{(\d+)\}/g, function (match, index) {
203
+ if (values.length > index) {
204
+ return values[index];
205
+ } else {
206
+ return "";
207
+ }
208
+ });
209
+ };
210
+
211
+ function dateToString(date) {
212
+ const year = date.getFullYear();
213
+ let month = date.getMonth() + 1;
214
+ let day = date.getDate();
215
+ let hour = date.getHours();
216
+ let minute = date.getMinutes();
217
+ let second = date.getSeconds();
218
+ month = month > 9 ? month : ('0' + month);
219
+ day = day > 9 ? day : ('0' + day);
220
+ hour = hour > 9 ? hour : ('0' + hour);
221
+ minute = minute > 9 ? minute : ('0' + minute);
222
+ second = second > 9 ? second : ('0' + second);
223
+ return year + "-" + month + "-" + day + " " + hour + ":" + minute + ":" + second;
224
+ }
225
+
226
+
227
+ //昨天的时间
228
+ var day1 = new Date();
229
+ day1.setDate(day1.getDate() - 2);
230
+
231
+ //明天的时间
232
+ var day2 = new Date();
233
+ day2.setDate(day2.getDate() + 1);
234
+
235
+ $("#start_time").val(dateToString(day1));
236
+ $("#end_time").val(dateToString(day2));
237
+ useAsync = false;
238
+
239
+
240
+ //searchCols();
241
+ useAsync = true;
242
+
243
+ function queryResult(col_name, page, manualOperate) {
244
+ if (currentColName === undefined) {
245
+ return;
246
+ }
247
+
248
+ $('#echartsArea').css('display', 'none');
249
+ // currentColName = col_name;
250
+ if (manualOperate === true) {
251
+ document.getElementById('table').style.display = 'block';
252
+ updateTopText();
253
+ updateQueryText();
254
+ }
255
+
256
+ if (runStatus === 0) {
257
+ return;
258
+ }
259
+
260
+
261
+ $.ajax({
262
+ url: "{{ url_for('query_result_view')}}", data: {
263
+ col_name: col_name, start_time: $("#start_time").val(),
264
+ end_time: $("#end_time").val(), is_success: $("#sucess_status").val(), function_params: $("#params").val(), page: page
265
+ }, async: useAsync, success: function (result, status) {
266
+ // console.info(result);
267
+
268
+ var html = ' <thead>\n' +
269
+ ' <tr>\n' +
270
+ ' <th>执行机器-进程-脚本</th>\n' +
271
+
272
+ ' <th>函数名称</th>\n' +
273
+ ' <th>函数入参</th>\n' +
274
+ ' <th>函数结果</th>\n' +
275
+ ' <th>消息发布时间</th>\n' +
276
+ ' <th>开始执行时间</th>\n' +
277
+ ' <th>消耗时间(秒)</th>\n' +
278
+ ' <th>执行次数(重试)</th>\n' +
279
+ ' <th>运行状态</th>\n' +
280
+ ' <th>是否成功</th>\n' +
281
+ ' <th>错误原因</th>\n' +
282
+
283
+
284
+ ' <th>线程(协程)数</th>\n' +
285
+ ' </tr>\n' +
286
+ ' </thead>' +
287
+ '<tbody>';
288
+ for (var item of result) {
289
+ // console.info(item);
290
+ var displayLevel = "success";
291
+ if (item.run_times > 1) {
292
+ displayLevel = "warning";
293
+ }
294
+
295
+ if (item.success === false) {
296
+ displayLevel = "danger";
297
+ }
298
+ var tr = ' <tr class="{0}">\n' +
299
+
300
+ ' <td>{1}</td>\n' +
301
+ ' <td>{2}</td>\n' +
302
+ ' <td>{3}</td>\n' +
303
+ ' <td>{4}</td>\n' +
304
+ ' <td>{5}</td>\n' +
305
+ ' <td>{6}</td>\n' +
306
+ ' <td>{7}</td>\n' +
307
+ ' <td>{8}</td>\n' +
308
+ ' <td>{9}</td>\n' +
309
+ ' <td>{10}</td>\n' +
310
+ ' <td>{11}</td>\n' +
311
+ ' <td>{12}</td>\n' +
312
+
313
+ ' </tr>';
314
+ var successText = item.success === true ? "成功" : "失败";
315
+ <!-- console.info(item.run_status);-->
316
+ var run_status_text = item.run_status;
317
+ if (item.run_status === "running") {
318
+ successText = "未完成";
319
+ displayLevel = "info";
320
+ if (Date.now() / 1000 - item.time_start > 600) {
321
+ run_status_text = "running?";
322
+ }
323
+ }
324
+
325
+ var time_start_obj = new Date(item.time_start * 1000);
326
+ var time_start_str = dateToString(time_start_obj);
327
+
328
+ tr = tr.format(displayLevel, item.host_process + ' - ' + item.script_name, item.function, item.params_str, item.result, item.publish_time_str,
329
+ time_start_str, item.time_cost, item.run_times, run_status_text, successText, item.exception, item.total_thread);
330
+ html += tr;
331
+ }
332
+ html += '</tbody>';
333
+ $("#table").html(html);
334
+
335
+ // document.getElementById('echartsArea').style.display = 'none';
336
+
337
+
338
+ }
339
+ });
340
+ // if (manualOperate === true) {
341
+ // updateQueryText()
342
+ // }
343
+ }
344
+
345
+ function updateQueryText() {
346
+ if (currentColName === undefined) {
347
+ return;
348
+ }
349
+
350
+ $.ajax({
351
+ url: "{{ url_for('speed_stats')}}", data: {
352
+ col_name: currentColName, start_time: $("#start_time").val(),
353
+ end_time: $("#end_time").val()
354
+ }, async: useAsync, success: function (result, status) {
355
+ var msg = ' {0} 队列,所选查询时间范围内运行成功了{1}次,失败了{2}次'.format(currentColName, result.success_num, result.fail_num);
356
+ console.info(msg);
357
+ $('#resultInfoTex').html(msg);
358
+ }
359
+ })
360
+ }
361
+
362
+ // queryResult(currentColName, 0, true);
363
+
364
+
365
+ function updateTopText() {
366
+ if (currentColName === undefined) {
367
+ return;
368
+ }
369
+ var t1 = new Date(new Date().getTime() - 60000);
370
+ var t2 = new Date();
371
+ $.ajax({
372
+ url: "{{ url_for('speed_stats')}}", data: {
373
+ col_name: currentColName, start_time: dateToString(t1), end_time: dateToString(t2)
374
+ }, async: useAsync, success: function (result, status) {
375
+ var msg = ' {0} 队列,最近一分钟内运行成功了{1}次,失败了{2}次'.format(currentColName, result.success_num, result.fail_num);
376
+ console.info(msg);
377
+ $('#Last1minInfoTex').text(msg);
378
+ }
379
+ })
380
+ }
381
+
382
+ updateTopText();
383
+ updateQueryText();
384
+ setInterval(updateQueryText, 30000);
385
+ setInterval(updateTopText, 30000);
386
+
387
+ function autoFreshResult() {
388
+ if (currentColName === undefined) {
389
+ return;
390
+ }
391
+ queryResult(currentColName, 0, false);
392
+ }
393
+
394
+ // setInterval(autoFreshResult, 30000);
395
+
396
+ iid = setInterval(autoFreshResult, 5000);
397
+
398
+
399
+ function startRun() {
400
+ $("#autoFresh").text("自动刷新中");
401
+ $("#autoFresh").removeClass("btn-danger");
402
+ $("#autoFresh").addClass("btn-success");
403
+ iid = setInterval(autoFreshResult, 5000);
404
+ runStatus = 1;
405
+ }
406
+
407
+ function stopRun() {
408
+ $("#autoFresh").text("暂停刷新了");
409
+ $("#autoFresh").removeClass("btn-success");
410
+ $("#autoFresh").addClass("btn-danger");
411
+ clearInterval(iid);
412
+ runStatus = 0;
413
+ }
414
+
415
+ function startOrStop() {
416
+ if (runStatus === 1) {
417
+ stopRun();
418
+ } else {
419
+ startRun();
420
+ }
421
+ }
422
+
423
+
424
+
425
+
426
+
427
+
428
+
429
+
430
+ </script>
431
+ </body>
432
+
433
+ </html>