Archery icon indicating copy to clipboard operation
Archery copied to clipboard

添加慢SQL的的优化管理功能

Open Grain-Yu opened this issue 1 year ago • 10 comments

这个功能来自之前的一个想法:https://github.com/hhyo/Archery/discussions/2382 演示demo

另外,关于“编辑详情”页面的“状态”: image 我的设想是, open:开始认领这个慢SQL resolved:已有解决方案 pending:难以优化,暂挂 closed:这个SQL的优化方案已经在业务层面实施完毕

Grain-Yu avatar Mar 24 '24 02:03 Grain-Yu

这个test怎么一直失败呢,我先去掉了

Grain-Yu avatar Mar 24 '24 04:03 Grain-Yu

你写错了, requests.post(json={}) 才能以 json 方式请求

LeoQuote avatar Mar 24 '24 04:03 LeoQuote

本地可以跑的 https://github.com/hhyo/Archery/wiki/development#%E5%8D%95%E5%85%83%E6%B5%8B%E8%AF%95 看一下这里的, 简单配置一下就行

LeoQuote avatar Mar 24 '24 04:03 LeoQuote

Codecov Report

Attention: Patch coverage is 48.83721% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 76.74%. Comparing base (5f556a5) to head (962c2da).

Files Patch % Lines
sql/slowlog.py 22.22% 21 Missing :warning:
sql/views.py 66.66% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2549      +/-   ##
==========================================
- Coverage   76.82%   76.74%   -0.08%     
==========================================
  Files         117      117              
  Lines       16073    16115      +42     
==========================================
+ Hits        12348    12368      +20     
- Misses       3725     3747      +22     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 24 '24 04:03 codecov[bot]

@LeoQuote 大佬方便的话麻烦加一下单元测试。另外,我看black给我改写的不能用,有些逻辑变了

Grain-Yu avatar Mar 24 '24 09:03 Grain-Yu

能否考虑使用 rest_framework 实现? 我看你这个主要逻辑还是有点restful 风格的,black 必须能过哈,他给你修的不行你就自己修

LeoQuote avatar Mar 24 '24 10:03 LeoQuote

能否考虑使用 rest_framework 实现? 我看你这个主要逻辑还是有点restful 风格的,black 必须能过哈,他给你修的不行你就自己修

那估计要研究很久了,还是初学者哈哈

Grain-Yu avatar Mar 24 '24 11:03 Grain-Yu

ImportError while loading conftest '/home/runner/work/Archery/Archery/conftest.py'. conftest.py:4: in from pytest_mock import MockFixture E ModuleNotFoundError: No module named 'pytest_mock' Error: Process completed with exit code 4.

Grain-Yu avatar Mar 24 '24 11:03 Grain-Yu

更新了wiki, 得装一批开发用的依赖

LeoQuote avatar Mar 24 '24 14:03 LeoQuote

我觉得这个功能不错,期待中

czxin788 avatar Apr 03 '24 01:04 czxin788