mirror of https://gitee.com/bigwinds/arangodb
added clusterId in statistics
This commit is contained in:
parent
1e972d8e4c
commit
5c816ec808
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue