mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-10-29 15:13:44 +00:00
Update 系统设计基础.md
补充熔断器的三种状态及状态转换图。
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="520" height="270" viewBox="0 0 520 270">
|
||||
<style>
|
||||
text { font-family: "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; fill: #666; font-size: 12px; }
|
||||
.title { font-weight: bold; font-size: 15px; fill: #777; text-anchor: middle; }
|
||||
.state { font-weight: bold; font-size: 14px; text-anchor: middle; }
|
||||
.en { font-size: 10px; fill: #888; text-anchor: middle; }
|
||||
.arrow { stroke: #666; stroke-width: 1.3; fill: none; marker-end: url(#a); }
|
||||
.shadow { fill: #C0C0C0; }
|
||||
</style>
|
||||
<defs>
|
||||
<marker id="a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto">
|
||||
<path d="M1,1 L9,5 L1,9" fill="none" stroke="#666" stroke-width="1.6"/>
|
||||
</marker>
|
||||
</defs>
|
||||
<rect width="100%" height="100%" fill="#FFFFFF"/>
|
||||
<text x="260" y="28" class="title">熔断器状态</text>
|
||||
|
||||
<!-- 关闭:正常调用 -->
|
||||
<rect x="58" y="81" width="110" height="44" rx="6" class="shadow"/>
|
||||
<rect x="55" y="78" width="110" height="44" rx="6" fill="#B0E3E6"/>
|
||||
<text x="110" y="98" class="state">关闭</text>
|
||||
<text x="110" y="114" class="en">Closed,正常调用</text>
|
||||
|
||||
<!-- 打开:直接返回默认结果 -->
|
||||
<rect x="358" y="81" width="110" height="44" rx="6" class="shadow"/>
|
||||
<rect x="355" y="78" width="110" height="44" rx="6" fill="#F3C6C2"/>
|
||||
<text x="410" y="98" class="state">打开</text>
|
||||
<text x="410" y="114" class="en">Open,直接返回</text>
|
||||
|
||||
<!-- 半开:放行少量试探请求 -->
|
||||
<rect x="208" y="193" width="110" height="44" rx="6" class="shadow"/>
|
||||
<rect x="205" y="190" width="110" height="44" rx="6" fill="#B1DDF0"/>
|
||||
<text x="260" y="210" class="state">半开</text>
|
||||
<text x="260" y="226" class="en">Half-Open,少量试探</text>
|
||||
|
||||
<line x1="169" y1="100" x2="351" y2="100" class="arrow"/>
|
||||
<text x="260" y="92" text-anchor="middle">失败率超过阈值</text>
|
||||
|
||||
<line x1="378" y1="125" x2="297" y2="187" class="arrow"/>
|
||||
<text x="318" y="145" text-anchor="end">等待一段时间</text>
|
||||
|
||||
<line x1="310" y1="190" x2="391" y2="128" class="arrow"/>
|
||||
<text x="362" y="176">试探请求失败</text>
|
||||
|
||||
<line x1="218" y1="190" x2="137" y2="128" class="arrow"/>
|
||||
<text x="160" y="176" text-anchor="end">试探请求成功</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.2 KiB |
Reference in New Issue
Block a user