From 6503fb4a049314e7872f5e8df333a36922a5566e Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Tue, 20 Feb 2024 09:33:39 +0000 Subject: [PATCH] Simple performance logging --- plugins/tiddlywiki/multiwikiserver/modules/init.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/tiddlywiki/multiwikiserver/modules/init.js b/plugins/tiddlywiki/multiwikiserver/modules/init.js index 810cb1638..10ca22040 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/init.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/init.js @@ -19,7 +19,7 @@ exports.before = ["story"]; exports.synchronous = true; exports.startup = function() { -console.log(`Initialising MWSS`) +console.log(`Initialising MWS`) var path = require("path"); // Install the sqlite3 global namespace $tw.sqlite3 = { @@ -51,6 +51,8 @@ console.log(`Initialised sqlTiddlerStore`) store: store, uploadManager: uploadManager }; + // Performance timing + console.time("mws-initial-load"); // Create docs bag and recipe $tw.mws.store.createBag("docs","TiddlyWiki Documentation from https://tiddlywiki.com/"); $tw.mws.store.createRecipe("docs",["docs"],"TiddlyWiki Documentation from https://tiddlywiki.com/"); @@ -70,6 +72,7 @@ console.log(`Initialised sqlTiddlerStore`) $tw.mws.store.saveBagTiddler({title: "$:/SiteTitle",text: "Bag Alpha"},"bag-alpha"); $tw.mws.store.saveBagTiddler({title: "$:/SiteTitle",text: "Bag Beta"},"bag-beta"); $tw.mws.store.saveBagTiddler({title: "$:/SiteTitle",text: "Bag Gamma"},"bag-gamma"); + console.timeEnd("mws-initial-load"); }; })();