-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
支持mongodb进程状态查看 #1563
支持mongodb进程状态查看 #1563
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1563 +/- ##
==========================================
- Coverage 76.81% 76.46% -0.36%
==========================================
Files 92 91 -1
Lines 14325 14398 +73
==========================================
+ Hits 11004 11009 +5
- Misses 3321 3389 +68
Continue to review full report at Codecov.
|
kill_sql = kill_sql + row[0] | ||
result['data'] = kill_sql | ||
result = {'status': 1, 'msg': '暂时不支持%s类型数据库通过进程id构建请求' % instance.db_type , 'data': []} | ||
return HttpResponse(json.dumps(result), content_type='application/json') | ||
# 返回查询结果 | ||
return HttpResponse(json.dumps(result, cls=ExtendJSONEncoder, bigint_as_string=True), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面已经移除了simplejson,这个序列化包含bigint_as_string,是否会报错?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
>>> from common.utils.extend_json_encoder import ExtendJSONEncoder, ExtendJSONEncoderBytes
>>> import json
>>> result={"a":11111111111111111111111111111111111111111111111111111111111}
>>> json.dumps(result, cls=ExtendJSONEncoder, bigint_as_string=True)
'{"a": "11111111111111111111111111111111111111111111111111111111111"}'
使用ExtendJSONEncoder
这个类就没有问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议把相关方法放到到对应的engine中,后续其他engine扩充可能会更方便
参考: #1402
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mysql的要不也给统一挪到engine
这样改动有点多,再单独开一个pr搞吧? |
看起来ci没过,case需要mock一下 |
会话管理
->进程状态
可以查看mongodb的连接信息。因为依赖库pymongo版本的原因,只支持mongodb3.6及以上版本。