From 5374effc0fc396d76db018a0d54a7de34f3ed8d9 Mon Sep 17 00:00:00 2001 From: Tim Robinson Date: Tue, 4 Oct 2016 00:19:52 +0000 Subject: [PATCH] Adding more vfs metrics, fixing bugs --- plugins/c9.vfs.client/vfs_client.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/c9.vfs.client/vfs_client.js b/plugins/c9.vfs.client/vfs_client.js index dd0c974c..829dfb2c 100644 --- a/plugins/c9.vfs.client/vfs_client.js +++ b/plugins/c9.vfs.client/vfs_client.js @@ -78,6 +78,9 @@ define(function(require, exports, module) { if (loaded) return false; loaded = true; + + emit("loaded"); + smith.debug = DEBUG; connection = connectClient(connectEngine, { @@ -114,7 +117,10 @@ define(function(require, exports, module) { if (!pingUrl) return disconnect(); vfsEndpoint.isServerAlive(pingUrl, function(err, isAlive) { - if (!err && isAlive) return callback(null, true); + if (!err && isAlive) { + emit("preConnectChecked"); + return callback(null, true); + } disconnect(); }); @@ -279,6 +285,8 @@ define(function(require, exports, module) { function onConnect() { var transport = new smith.EngineIoTransport(connection); + emit("onConnect"); + if (consumer) consumer.disconnect();