Repository navigation
Expand file tree
/
Copy pathLoc.Profiler.cs
More file actions
105 lines (100 loc) · 8.31 KB
/
Copy pathLoc.Profiler.cs
File metadata and controls
105 lines (100 loc) · 8.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
namespace VelaShell.Plugin.Mongo;
public sealed partial class Loc
{
/// <summary>慢查询与当前操作。</summary>
private static readonly (string Key, string En, string Zh)[] ProfilerTexts =
[
// ── 工具行 ──
("Prof_Profiler", "Profiler", "Profiler"),
("Prof_Level0", "0 · off", "0 · 关闭"),
("Prof_Level1", "1 · slow ops", "1 · 慢操作"),
("Prof_Level2", "2 · all", "2 · 全部"),
("Prof_SlowMs", "slowms", "slowms"),
("Prof_SampleRate", "sampleRate", "sampleRate"),
("Prof_SettingsTip", "slowms and sampleRate apply to the whole mongod instance (every database); only the level is per database. Press Enter to apply.",
"slowms 与 sampleRate 对整个 mongod 实例生效(所有库共用),只有级别是按库的。回车应用。"),
("Prof_Clear", "Clear system.profile", "清空 system.profile"),
("Prof_Level2Warn", "level 2 adds noticeable write overhead — keep it on only briefly", "level 2 会显著增加写入开销,仅建议短时开启"),
("Prof_Level2Title", "Profile every operation?", "记录全部操作?"),
("Prof_Level2Body", "Level 2 writes every operation on {0} into system.profile, fast or slow. On a busy database this noticeably adds write load and quickly cycles the 1 MB capped collection. Turn it back to 1 when you are done.",
"level 2 会把 {0} 上的每一个操作(不论快慢)都写进 system.profile。繁忙的库上这会明显增加写入负载,1 MB 的固定集合也会很快被冲掉。看完记得切回 1。"),
("Prof_Level2Confirm", "Switch to level 2", "切到 level 2"),
("Prof_LevelApplied", "Profiler set to level {0} · {1} ms", "profiler 已设为 level {0} · {1} ms"),
("Prof_ClearTitle", "Clear system.profile", "清空 system.profile"),
("Prof_ClearBody", "This deletes all {1} records in {0}.system.profile; the slow query analysis below starts over. The profiler is switched to 0 for the drop and restored to level {2} right after. This cannot be undone.",
"将删除 {0}.system.profile 里的全部 {1} 条记录,下方的慢查询分析随之清空。删除期间 profiler 会临时设为 0,删完立即恢复为 level {2}。此操作无法撤销。"),
("Prof_ClearConfirm", "Clear", "清空"),
("Prof_Cleared", "Cleared {0}.system.profile", "已清空 {0}.system.profile"),
("Prof_RestoreFailed", "Could not restore profiler level {0}: {1}", "未能恢复 profiler level {0}:{1}"),
// ── 当前操作 ──
("Prof_CurrentOps", "Current operations", "当前操作"),
("Prof_OpsHeader", "$currentOp · {0} active · refreshed every 2 s", "$currentOp · 活跃 {0} · 每 2 s 刷新"),
("Prof_OpsHeaderOwn", "$currentOp (own operations only) · {0} active · refreshed every 2 s", "$currentOp(仅本用户)· 活跃 {0} · 每 2 s 刷新"),
("Prof_OnlyLong", "Running > 1 s only", "仅显示运行 > 1 s"),
("Prof_ColOpId", "opid", "opid"),
("Prof_ColType", "Type", "类型"),
("Prof_ColNs", "Namespace", "命名空间"),
("Prof_ColCommand", "Command", "命令"),
("Prof_ColClient", "Client", "客户端"),
("Prof_ColElapsed", "Running", "已运行"),
("Prof_Kill", "Kill", "终止"),
("Prof_NoOps", "No operations running right now.", "当前没有正在运行的操作。"),
("Prof_KillTitle", "Kill operation", "终止操作"),
("Prof_KillBody", "Run killOp on opid {0} ({1} · {2}, running {3})? The client gets an Interrupted error; whatever a write already wrote is not rolled back.",
"对 opid {0}({1} · {2},已运行 {3})执行 killOp?发起方会收到 Interrupted 错误;写操作已经写下去的部分不会回滚。"),
("Prof_Killed", "Killed opid {0}", "已终止 opid {0}"),
// ── 慢查询表 ──
("Prof_SlowTitle", "Slow queries", "慢查询"),
("Prof_SlowSubtitle", "grouped by query shape · last 24 hours", "按查询形状聚合 · 近 24 小时"),
("Prof_ByShape", "By shape", "按形状"),
("Prof_ByEntry", "Each", "逐条"),
("Prof_ColShape", "Query shape", "查询形状"),
("Prof_ColQuery", "Query", "查询"),
("Prof_ColCount", "Count", "次数"),
("Prof_ColAvg", "Avg", "平均"),
("Prof_ColMax", "Max", "最大"),
("Prof_ColTime", "Time", "时间"),
("Prof_ColMillis", "Took", "耗时"),
("Prof_ColRatio", "Scanned : returned", "扫描 : 返回"),
("Prof_ColPlan", "Plan", "计划"),
("Prof_EmptyOff", "The profiler is off for this database. Switch to «1 · slow ops» to start recording.", "这个库的 profiler 没有开启。切到「1 · 慢操作」开始记录。"),
("Prof_EmptyNone", "No slow operations in the last 24 hours.", "近 24 小时没有慢操作。"),
("Prof_EmptyDenied", "This user cannot read system.profile (needs dbAdmin on this database).", "当前用户无权读取 system.profile(需要该库的 dbAdmin)。"),
// ── 详情 ──
("Prof_NoSelection", "Pick a query shape to see a sample and an index suggestion.", "选择一个查询形状,查看样本与索引建议。"),
("Prof_DetailCount", "{0} runs · {1} of slow-query time", "{0} 次 · 占慢查询总耗时 {1}"),
("Prof_Sample", "Latest sample · {0}", "最近一次样本 · {0}"),
("Prof_DetailClient", "Client", "客户端"),
("Prof_DetailSort", "In-memory sort", "内存排序"),
("Prof_FieldDocs", "docsExamined", "docsExamined"),
("Prof_FieldReturned", "nreturned", "nreturned"),
("Prof_FieldPlan", "planSummary", "planSummary"),
("Prof_SortYes", "yes · {0}", "是 · {0}"),
("Prof_SortDisk", "spilled to disk", "溢写到磁盘"),
("Prof_Advice", "Suggestion", "建议"),
("Prof_EsrEquality", "{0} is matched by equality", "{0} 为等值条件"),
("Prof_EsrSort", "{0} drives the sort", "{0} 用于排序"),
("Prof_EsrSortRange", "{0} serves both the sort and the range", "{0} 同时用于排序与范围"),
("Prof_EsrRange", "{0} is a range", "{0} 为范围条件"),
("Prof_EsrJoin", "; ", ","),
("Prof_EsrTail", ". Following ESR (equality, sort, range), index:", ",按 ESR 建议:"),
("Prof_AdviceFine", "Already uses an index ({0}) and scans about as much as it returns — no new index needed.", "已走索引({0}),扫描量与返回量相当,不需要新索引。"),
("Prof_AdviceNone", "The filter uses $or / $expr / $where / $text, so no single compound index follows from it. Check the plan of each branch.",
"条件里有 $or / $expr / $where / $text,推不出单一的复合索引。用执行计划看看各个分支。"),
("Prof_AdviceNoFilter", "No filter or sort to index on — this shape reads the whole collection by design.", "没有可建索引的条件或排序 —— 这个形状本来就要读整个集合。"),
("Prof_AdviceExists", "Index {0} already covers this suggestion. If the plan still skips it, open the execution plan.", "已有索引 {0} 覆盖这条建议。计划仍没用上它的话,看看执行计划。"),
("Prof_CreateIndex", "Create suggested index", "创建建议索引"),
("Prof_OpenInEditor", "Open in query editor", "在查询编辑器中打开"),
("Prof_Explain", "View execution plan", "查看执行计划"),
("Prof_CreateIndexTitle", "Create index", "创建索引"),
("Prof_CreateIndexBody", "Build this index on {0}? A build scans the whole collection and holds an exclusive lock briefly at the start and the end; on a large collection prefer a quiet period.",
"在 {0} 上构建这个索引?构建会扫描整个集合,开始与结束时短暂持有排他锁;大集合建议挑低峰期。"),
("Prof_FactKeys", "Keys", "索引键"),
("Prof_FactDocs", "Documents", "文档数"),
("Prof_IndexCreated", "Created index {0}", "已创建索引 {0}"),
// ── 状态栏 ──
("Prof_Status", "system.profile · last 24 hours · {0} records · {1}", "system.profile · 近 24 小时 · {0} 条 · {1}"),
("Prof_StatusLevel", "profiler level {0} · {1} ms", "profiler level {0} · {1} ms"),
("Prof_StatusOff", "profiler off", "profiler 未开启")
];
}