From 5c816ec8084d624d28defe10b0b08ec89ee27ef7 Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Tue, 4 Mar 2014 10:30:17 +0100 Subject: [PATCH] added clusterId in statistics --- js/common/modules/org/arangodb/statistics.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/js/common/modules/org/arangodb/statistics.js b/js/common/modules/org/arangodb/statistics.js index 743240d6ab..dd368c1d11 100644 --- a/js/common/modules/org/arangodb/statistics.js +++ b/js/common/modules/org/arangodb/statistics.js @@ -29,11 +29,26 @@ //////////////////////////////////////////////////////////////////////////////// var internal = require("internal"); +var cluster = require("org/arangodb/cluster"); // ----------------------------------------------------------------------------- // --SECTION-- module "org/arangodb/statistics" // ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- +// --SECTION-- private variables +// ----------------------------------------------------------------------------- + +//////////////////////////////////////////////////////////////////////////////// +/// @brief cluster id or undefined for standalone +//////////////////////////////////////////////////////////////////////////////// + +var clusterId; + +if (cluster.isCluster()) { + clusterId = ArangoServerState.id(); +} + // ----------------------------------------------------------------------------- // --SECTION-- public functions // ----------------------------------------------------------------------------- @@ -54,6 +69,10 @@ exports.historian = function (param) { result.http = internal.httpStatistics(); result.server = internal.serverStatistics(); + if (clusterId !== undefined) { + result.clusterId = clusterId; + } + internal.db._statistics.save(result); } catch (err) {