Compare commits

...
3 Commits
Author SHA1 Message Date
fyears b5d56843fd bump to 0.5.20
Release A New Version / build (20.x) (push) Failing after 52s
2024-09-01 18:28:46 +08:00
fyears b63b6791aa re-enable profiler 2024-09-01 18:28:08 +08:00
Matvey Romanov 2a3d1265b3 Update en.json (#794) 2024-09-01 17:34:46 +08:00
15 changed files with 77 additions and 14 deletions
+3 -1
View File
@@ -201,7 +201,9 @@ See [PRO](./docs/pro/README.md) for more details.
## How To Debug ## How To Debug
See [here](./docs/how_to_debug/README.md) for more details. If you see any errors, please check the doc [here](./docs/how_to_debug/README.md) for more details.
Moreover, sometimes the program runs but slowly, you want to check the performance by [enabling the profiler](./docs/check_performance/README).
## Bonus: Import And Export Not-Oauth2 Plugin Settings By QR Code ## Bonus: Import And Export Not-Oauth2 Plugin Settings By QR Code
+4 -2
View File
@@ -199,9 +199,11 @@ PRO(付费)功能“智能冲突”为用户提供了另一个选项:合
详见[PRO](./docs/pro/README.md)了解更多详情。 详见[PRO](./docs/pro/README.md)了解更多详情。
## 如何调试 ## 如何调试debug
详见[这里](./docs/how_to_debug/README.md)了解更多详情 如发生错误,查看[这里文档](./docs/how_to_debug/README.md)了解调试方式
如果没有发生错误,但是运行起来很慢,你需要[开启“性能收集”](./docs/check_performance/README)来看看有没有哪一步特别慢。
## 额外功能:通过 QR 码导入和导出非 OAuth2 插件设置 ## 额外功能:通过 QR 码导入和导出非 OAuth2 插件设置
+13
View File
@@ -0,0 +1,13 @@
# Check performance
1. Go to settings, scroll to the very end, and enable the "Enable Profiler" option.
2. Also enable "Enable Profiler Printing".
3. Check Console Output (directly or via `vConsole` plugin). More details are [here](../how_to_debug/README.md).
4. Sync!
5. You can also "Export Profiler Results" afterwards. A new file `_debug_remotely_save/profiler_results_exported_on_xxxx.md` will be generated.
In the console or exported files, you can see the time cost of each steps.
![profiler settings](./profiler_settings.png)
![profiler exported](./profiler_exported.png)
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5a71d0746a75c93aa4cb5be3f7964bfdf74722a10505f5a1965790738eaebdc4
size 265289
@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4ffd1557c2f714c56bfacd8166b85749d6bfa15c2f9c7363942b443d51288083
size 81259
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "remotely-save", "id": "remotely-save",
"name": "Remotely Save", "name": "Remotely Save",
"version": "0.5.19", "version": "0.5.20",
"minAppVersion": "0.13.21", "minAppVersion": "0.13.21",
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.", "description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
"author": "fyears", "author": "fyears",
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"id": "remotely-save", "id": "remotely-save",
"name": "Remotely Save", "name": "Remotely Save",
"version": "0.5.19", "version": "0.5.20",
"minAppVersion": "0.13.21", "minAppVersion": "0.13.21",
"description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.", "description": "Yet another unofficial plugin allowing users to synchronize notes between local device and the cloud service.",
"author": "fyears", "author": "fyears",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "remotely-save", "name": "remotely-save",
"version": "0.5.19", "version": "0.5.20",
"description": "This is yet another sync plugin for Obsidian app.", "description": "This is yet another sync plugin for Obsidian app.",
"scripts": { "scripts": {
"dev2": "node esbuild.config.mjs --watch", "dev2": "node esbuild.config.mjs --watch",
+1
View File
@@ -140,6 +140,7 @@ export type CipherMethodType = "rclone-base64" | "openssl-base64" | "unknown";
export type QRExportType = "basic_and_advanced" | SUPPORTED_SERVICES_TYPE; export type QRExportType = "basic_and_advanced" | SUPPORTED_SERVICES_TYPE;
export interface ProfilerConfig { export interface ProfilerConfig {
enable?: boolean;
enablePrinting?: boolean; enablePrinting?: boolean;
recordSize?: boolean; recordSize?: boolean;
} }
+3 -1
View File
@@ -340,7 +340,7 @@
"settings_obfuscatesettingfile": "Obfuscate The Setting File Or Not", "settings_obfuscatesettingfile": "Obfuscate The Setting File Or Not",
"settings_obfuscatesettingfile_desc": "The setting file (data.json) has some sensitive information. It's strongly recommended to obfuscate it to avoid unexpected read and modification. If you are sure to view and edit it manually, you can disable the obfuscation.", "settings_obfuscatesettingfile_desc": "The setting file (data.json) has some sensitive information. It's strongly recommended to obfuscate it to avoid unexpected read and modification. If you are sure to view and edit it manually, you can disable the obfuscation.",
"settings_viewconsolelog": "View Console Log", "settings_viewconsolelog": "View Console Log",
"settings_viewconsolelog_desc": "On desktop, please press \"ctrl+shift+i\" or \"cmd+shift+i\" to view the log. On mobile, please install the third-party plugin <a href='https://obsidian.md/plugins?search=Logstravaganza'>Logstravaganza</a> to export the console log to a note.", "settings_viewconsolelog_desc": "On desktop, please press \"ctrl+shift+i\" or \"cmd+option+i\" to view the log. On mobile, please install the third-party plugin <a href='https://obsidian.md/plugins?search=Logstravaganza'>Logstravaganza</a> to export the console log to a note.",
"settings_syncplans": "Export Sync Plans", "settings_syncplans": "Export Sync Plans",
"settings_syncplans_desc": "Sync plans are created every time after you trigger sync and before the actual sync. Useful to know what would actually happen in those sync. Click the button to export sync plans.", "settings_syncplans_desc": "Sync plans are created every time after you trigger sync and before the actual sync. Useful to know what would actually happen in those sync. Click the button to export sync plans.",
"settings_syncplans_button_1_only_change": "Export latest 1 (change part)", "settings_syncplans_button_1_only_change": "Export latest 1 (change part)",
@@ -361,6 +361,8 @@
"settings_profiler_results_desc": "The plugin records the time cost of each steps. Here you can export them to know which step is slow.", "settings_profiler_results_desc": "The plugin records the time cost of each steps. Here you can export them to know which step is slow.",
"settings_profiler_results_notice": "Profiler results exported.", "settings_profiler_results_notice": "Profiler results exported.",
"settings_profiler_results_button_all": "Export All", "settings_profiler_results_button_all": "Export All",
"settings_profiler_enableprofiler": "Enable Profiler",
"settings_profiler_enableprofiler_desc": "Collect performance data or not?",
"settings_profiler_enabledebugprint": "Enable Profiler Printing", "settings_profiler_enabledebugprint": "Enable Profiler Printing",
"settings_profiler_enabledebugprint_desc": "Print profiler result in each insertion to console or not?", "settings_profiler_enabledebugprint_desc": "Print profiler result in each insertion to console or not?",
"settings_profiler_recordsize": "Enable Profiler Recording Size", "settings_profiler_recordsize": "Enable Profiler Recording Size",
+6
View File
@@ -360,6 +360,12 @@
"settings_profiler_results_desc": "插件记录了每次同步每一步的耗时。这里可以导出记录得知哪一步最慢。", "settings_profiler_results_desc": "插件记录了每次同步每一步的耗时。这里可以导出记录得知哪一步最慢。",
"settings_profiler_results_notice": "性能数据已导出", "settings_profiler_results_notice": "性能数据已导出",
"settings_profiler_results_button_all": "导出所有", "settings_profiler_results_button_all": "导出所有",
"settings_profiler_enableprofiler": "性能收集",
"settings_profiler_enableprofiler_desc": "是否开启性能收集功能?",
"settings_profiler_enabledebugprint": "性能收集输出",
"settings_profiler_enabledebugprint_desc": "是否直接输出性能收集结果到终端里?",
"settings_profiler_recordsize": "性能收集统计对象大小",
"settings_profiler_recordsize_desc": "是否收集对象的大小?",
"settings_outputbasepathvaultid": "输出资料库对应的位置和随机分配的 ID", "settings_outputbasepathvaultid": "输出资料库对应的位置和随机分配的 ID",
"settings_outputbasepathvaultid_desc": "用于调试。", "settings_outputbasepathvaultid_desc": "用于调试。",
"settings_outputbasepathvaultid_button": "输出", "settings_outputbasepathvaultid_button": "输出",
+6
View File
@@ -359,6 +359,12 @@
"settings_profiler_results_desc": "外掛記錄了每次同步每一步的耗時。這裡可以匯出記錄得知哪一步最慢。", "settings_profiler_results_desc": "外掛記錄了每次同步每一步的耗時。這裡可以匯出記錄得知哪一步最慢。",
"settings_profiler_results_notice": "效能資料已匯出", "settings_profiler_results_notice": "效能資料已匯出",
"settings_profiler_results_button_all": "匯出所有", "settings_profiler_results_button_all": "匯出所有",
"settings_profiler_enableprofiler": "效能收集",
"settings_profiler_enableprofiler_desc": "是否開啟效能收集功能?",
"settings_profiler_enabledebugprint": "效能收集輸出",
"settings_profiler_enabledebugprint_desc": "是否直接輸出效能收集結果到終端裡?",
"settings_profiler_recordsize": "效能收集統計物件大小",
"settings_profiler_recordsize_desc": "是否收集物件的大小?",
"settings_outputbasepathvaultid": "輸出資料庫對應的位置和隨機分配的 ID", "settings_outputbasepathvaultid": "輸出資料庫對應的位置和隨機分配的 ID",
"settings_outputbasepathvaultid_desc": "用於除錯。", "settings_outputbasepathvaultid_desc": "用於除錯。",
"settings_outputbasepathvaultid_button": "輸出", "settings_outputbasepathvaultid_button": "輸出",
+12 -7
View File
@@ -108,7 +108,7 @@ import {
upsertPluginVersionByVault, upsertPluginVersionByVault,
} from "./localdb"; } from "./localdb";
import { changeMobileStatusBar } from "./misc"; import { changeMobileStatusBar } from "./misc";
import { DEFAULT_PROFILER_CONFIG, type Profiler } from "./profiler"; import { DEFAULT_PROFILER_CONFIG, Profiler } from "./profiler";
import { RemotelySaveSettingTab } from "./settings"; import { RemotelySaveSettingTab } from "./settings";
import { SyncAlgoV3Modal } from "./syncAlgoV3Notice"; import { SyncAlgoV3Modal } from "./syncAlgoV3Notice";
@@ -232,12 +232,14 @@ export default class RemotelySavePlugin extends Plugin {
appContainerObserver?: MutationObserver; appContainerObserver?: MutationObserver;
async syncRun(triggerSource: SyncTriggerSourceType = "manual") { async syncRun(triggerSource: SyncTriggerSourceType = "manual") {
// const profiler = new Profiler( let profiler: Profiler | undefined = undefined;
// undefined, if (this.settings.profiler?.enable ?? false) {
// this.settings.profiler?.enablePrinting ?? false, profiler = new Profiler(
// this.settings.profiler?.recordSize ?? false undefined,
// ); this.settings.profiler?.enablePrinting ?? false,
const profiler: Profiler | undefined = undefined; this.settings.profiler?.recordSize ?? false
);
}
const fsLocal = new FakeFsLocal( const fsLocal = new FakeFsLocal(
this.app.vault, this.app.vault,
this.settings.syncConfigDir ?? false, this.settings.syncConfigDir ?? false,
@@ -1471,6 +1473,9 @@ export default class RemotelySavePlugin extends Plugin {
if (this.settings.profiler === undefined) { if (this.settings.profiler === undefined) {
this.settings.profiler = DEFAULT_PROFILER_CONFIG; this.settings.profiler = DEFAULT_PROFILER_CONFIG;
} }
if (this.settings.profiler.enable === undefined) {
this.settings.profiler.enable = false;
}
if (this.settings.profiler.enablePrinting === undefined) { if (this.settings.profiler.enablePrinting === undefined) {
this.settings.profiler.enablePrinting = false; this.settings.profiler.enablePrinting = false;
} }
+1
View File
@@ -10,6 +10,7 @@ interface BreakPoint {
} }
export const DEFAULT_PROFILER_CONFIG: ProfilerConfig = { export const DEFAULT_PROFILER_CONFIG: ProfilerConfig = {
enable: false,
enablePrinting: false, enablePrinting: false,
recordSize: false, recordSize: false,
}; };
+19
View File
@@ -2940,6 +2940,25 @@ export class RemotelySaveSettingTab extends PluginSettingTab {
}); });
}); });
new Setting(debugDiv)
.setName(t("settings_profiler_enableprofiler"))
.setDesc(t("settings_profiler_enableprofiler_desc"))
.addDropdown((dropdown) => {
dropdown.addOption("enable", t("enable"));
dropdown.addOption("disable", t("disable"));
dropdown
.setValue(
this.plugin.settings.profiler?.enable ? "enable" : "disable"
)
.onChange(async (val: string) => {
if (this.plugin.settings.profiler === undefined) {
this.plugin.settings.profiler = DEFAULT_PROFILER_CONFIG;
}
this.plugin.settings.profiler.enable = val === "enable";
await this.plugin.saveSettings();
});
});
new Setting(debugDiv) new Setting(debugDiv)
.setName(t("settings_profiler_enabledebugprint")) .setName(t("settings_profiler_enabledebugprint"))
.setDesc(t("settings_profiler_enabledebugprint_desc")) .setDesc(t("settings_profiler_enabledebugprint_desc"))