1
0
Fork 0

added clusterId in statistics

This commit is contained in:
Frank Celler 2014-03-04 10:30:17 +01:00
parent 1e972d8e4c
commit 5c816ec808
1 changed files with 19 additions and 0 deletions

View File

@ -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) {