浏览代码

chore: Add processId field for metrics of threads/db-pool-stat/health (#6797)

Co-authored-by: 老潮 <zhangyongsheng@3vjia.com>
Co-authored-by: takatost <takatost@users.noreply.github.com>
Co-authored-by: takatost <takatost@gmail.com>
tags/0.6.16
Ever 1年前
父节点
当前提交
545d3c5a93
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3
    0
      api/app.py

+ 3
- 0
api/app.py 查看文件

@@ -261,6 +261,7 @@ def after_request(response):
@app.route('/health')
def health():
return Response(json.dumps({
'pid': os.getpid(),
'status': 'ok',
'version': app.config['CURRENT_VERSION']
}), status=200, content_type="application/json")
@@ -284,6 +285,7 @@ def threads():
})

return {
'pid': os.getpid(),
'thread_num': num_threads,
'threads': thread_list
}
@@ -293,6 +295,7 @@ def threads():
def pool_stat():
engine = db.engine
return {
'pid': os.getpid(),
'pool_size': engine.pool.size(),
'checked_in_connections': engine.pool.checkedin(),
'checked_out_connections': engine.pool.checkedout(),

正在加载...
取消
保存