mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'sharding' of github.com:triAGENS/ArangoDB into 2.0
This commit is contained in:
commit
a8e0e1a9e4
|
|
@ -102,6 +102,7 @@ add_executable(
|
|||
RestHandler/RestDocumentHandler.cpp
|
||||
RestHandler/RestEdgeHandler.cpp
|
||||
RestHandler/RestImportHandler.cpp
|
||||
RestHandler/RestPleaseUpgradeHandler.cpp
|
||||
RestHandler/RestReplicationHandler.cpp
|
||||
RestHandler/RestUploadHandler.cpp
|
||||
RestHandler/RestVocbaseBaseHandler.cpp
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ bin_arangod_SOURCES = \
|
|||
arangod/RestHandler/RestDocumentHandler.cpp \
|
||||
arangod/RestHandler/RestEdgeHandler.cpp \
|
||||
arangod/RestHandler/RestImportHandler.cpp \
|
||||
arangod/RestHandler/RestPleaseUpgradeHandler.cpp \
|
||||
arangod/RestHandler/RestReplicationHandler.cpp \
|
||||
arangod/RestHandler/RestUploadHandler.cpp \
|
||||
arangod/RestHandler/RestVocbaseBaseHandler.cpp \
|
||||
|
|
@ -109,7 +110,7 @@ bin_arangod_SOURCES = \
|
|||
arangod/VocBase/voc-shaper.c \
|
||||
arangod/VocBase/vocbase.c \
|
||||
arangod/VocBase/vocbase-defaults.c
|
||||
|
||||
|
||||
if ENABLE_CLUSTER
|
||||
|
||||
bin_arangod_SOURCES += \
|
||||
|
|
|
|||
|
|
@ -0,0 +1,94 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief please upgrade handler
|
||||
///
|
||||
/// @file
|
||||
///
|
||||
/// DISCLAIMER
|
||||
///
|
||||
/// Copyright 2014 triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
/// you may not use this file except in compliance with the License.
|
||||
/// You may obtain a copy of the License at
|
||||
///
|
||||
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
///
|
||||
/// Unless required by applicable law or agreed to in writing, software
|
||||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
/// See the License for the specific language governing permissions and
|
||||
/// limitations under the License.
|
||||
///
|
||||
/// Copyright holder is triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// @author Dr. Frank Celler
|
||||
/// @author Copyright 2014, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RestPleaseUpgradeHandler.h"
|
||||
|
||||
using namespace triagens::basics;
|
||||
using namespace triagens::rest;
|
||||
using namespace triagens::arango;
|
||||
using namespace std;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief constructor
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
RestPleaseUpgradeHandler::RestPleaseUpgradeHandler (HttpRequest* request)
|
||||
: HttpHandler(request) {
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- Handler methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// {@inheritDoc}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool RestPleaseUpgradeHandler::isDirect () {
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// {@inheritDoc}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
HttpHandler::status_t RestPleaseUpgradeHandler::execute () {
|
||||
_response = createResponse(HttpResponse::OK);
|
||||
_response->setContentType("text/plain; charset=utf-8");
|
||||
|
||||
TRI_AppendStringStringBuffer(_response->body().stringBuffer(), "Database: ");
|
||||
TRI_AppendStringStringBuffer(_response->body().stringBuffer(), _request->databaseName().c_str());
|
||||
TRI_AppendStringStringBuffer(_response->body().stringBuffer(), "\r\n\r\n");
|
||||
TRI_AppendStringStringBuffer(_response->body().stringBuffer(), "It appears that your database must be upgrade. ");
|
||||
TRI_AppendStringStringBuffer(_response->body().stringBuffer(), "Normally this can be done using\r\n\r\n");
|
||||
TRI_AppendStringStringBuffer(_response->body().stringBuffer(), " /etc/init.d/arangodb stop\r\n");
|
||||
TRI_AppendStringStringBuffer(_response->body().stringBuffer(), " /etc/init.d/arangodb upgrade\r\n");
|
||||
TRI_AppendStringStringBuffer(_response->body().stringBuffer(), " /etc/init.d/arangodb start\r\n\r\n");
|
||||
TRI_AppendStringStringBuffer(_response->body().stringBuffer(), "Please check the log file for details.\r\n");
|
||||
|
||||
return status_t(HANDLER_DONE);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// {@inheritDoc}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void RestPleaseUpgradeHandler::handleError (basics::TriagensError const&) {
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||
// End:
|
||||
|
|
@ -0,0 +1,94 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief please upgrade handler
|
||||
///
|
||||
/// @file
|
||||
///
|
||||
/// DISCLAIMER
|
||||
///
|
||||
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
/// you may not use this file except in compliance with the License.
|
||||
/// You may obtain a copy of the License at
|
||||
///
|
||||
/// http://www.apache.org/licenses/LICENSE-2.0
|
||||
///
|
||||
/// Unless required by applicable law or agreed to in writing, software
|
||||
/// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
/// See the License for the specific language governing permissions and
|
||||
/// limitations under the License.
|
||||
///
|
||||
/// Copyright holder is triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// @author Dr. Frank Celler
|
||||
/// @author Copyright 2010-2014, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TRIAGENS_REST_HANDLER_REST_PLEASE_UPGRADE_HANDLER_H
|
||||
#define TRIAGENS_REST_HANDLER_REST_PLEASE_UPGRADE_HANDLER_H 1
|
||||
|
||||
#include "HttpServer/HttpHandler.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- class RestDocumentHandler
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
namespace triagens {
|
||||
namespace arango {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief document request handler
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class RestPleaseUpgradeHandler : public rest::HttpHandler {
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
public:
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief constructor
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
RestPleaseUpgradeHandler (rest::HttpRequest*);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- Handler methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
public:
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// {@inheritDoc}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool isDirect ();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// {@inheritDoc}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
status_t execute ();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// {@inheritDoc}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void handleError (basics::TriagensError const&);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||
// End:
|
||||
|
|
@ -52,22 +52,17 @@ using namespace triagens::arango;
|
|||
// --SECTION-- public constants
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoDB
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief batch path
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const string RestVocbaseBaseHandler::BATCH_PATH = "/_api/batch";
|
||||
const string RestVocbaseBaseHandler::BATCH_PATH = "/_api/batch";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief document path
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const string RestVocbaseBaseHandler::DOCUMENT_PATH = "/_api/document";
|
||||
const string RestVocbaseBaseHandler::DOCUMENT_PATH = "/_api/document";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief documents import path
|
||||
|
|
@ -79,39 +74,30 @@ const string RestVocbaseBaseHandler::DOCUMENT_IMPORT_PATH = "/_api/import";
|
|||
/// @brief document path
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const string RestVocbaseBaseHandler::EDGE_PATH = "/_api/edge";
|
||||
const string RestVocbaseBaseHandler::EDGE_PATH = "/_api/edge";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief replication path
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const string RestVocbaseBaseHandler::REPLICATION_PATH = "/_api/replication";
|
||||
const string RestVocbaseBaseHandler::REPLICATION_PATH = "/_api/replication";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief upload path
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const string RestVocbaseBaseHandler::UPLOAD_PATH = "/_api/upload";
|
||||
const string RestVocbaseBaseHandler::UPLOAD_PATH = "/_api/upload";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief name of the queue
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const string RestVocbaseBaseHandler::QUEUE_NAME = "STANDARD";
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
const string RestVocbaseBaseHandler::QUEUE_NAME = "STANDARD";
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoDB
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief constructor
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -130,19 +116,10 @@ RestVocbaseBaseHandler::RestVocbaseBaseHandler (HttpRequest* request)
|
|||
RestVocbaseBaseHandler::~RestVocbaseBaseHandler () {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- protected methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoDB
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief check if a collection needs to be created on the fly
|
||||
///
|
||||
|
|
@ -611,10 +588,6 @@ TRI_json_t* RestVocbaseBaseHandler::parseJsonBody () {
|
|||
return json;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- HANDLER
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
@ -624,11 +597,10 @@ TRI_json_t* RestVocbaseBaseHandler::parseJsonBody () {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup ArangoDB
|
||||
/// @{
|
||||
/// {@inheritDoc}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::string const& RestVocbaseBaseHandler::queue () const {
|
||||
|
||||
string const& RestVocbaseBaseHandler::queue () const {
|
||||
return QUEUE_NAME;
|
||||
}
|
||||
|
||||
|
|
@ -690,10 +662,6 @@ int RestVocbaseBaseHandler::parseDocumentId (string const& handle,
|
|||
return TRI_ERROR_NO_ERROR;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@
|
|||
#include "RestHandler/RestDocumentHandler.h"
|
||||
#include "RestHandler/RestEdgeHandler.h"
|
||||
#include "RestHandler/RestImportHandler.h"
|
||||
#include "RestHandler/RestPleaseUpgradeHandler.h"
|
||||
#include "RestHandler/RestReplicationHandler.h"
|
||||
#include "RestHandler/RestUploadHandler.h"
|
||||
#include "RestServer/ConsoleThread.h"
|
||||
|
|
@ -117,6 +118,10 @@ static void DefineApiHandlers (HttpHandlerFactory* factory,
|
|||
// add "/version" handler
|
||||
admin->addBasicHandlers(factory, "/_api", (void*) jobManager);
|
||||
|
||||
// add a upgrade warning
|
||||
factory->addPrefixHandler("/_msg/please-upgrade",
|
||||
RestHandlerCreator<RestPleaseUpgradeHandler>::createNoData);
|
||||
|
||||
// add "/batch" handler
|
||||
factory->addPrefixHandler(RestVocbaseBaseHandler::BATCH_PATH,
|
||||
RestHandlerCreator<RestBatchHandler>::createNoData);
|
||||
|
|
@ -249,6 +254,12 @@ static bool SetRequestContext (triagens::rest::HttpRequest* request,
|
|||
return false;
|
||||
}
|
||||
|
||||
// database needs upgrade
|
||||
if (vocbase->_state == (sig_atomic_t) TRI_VOCBASE_STATE_FAILED_VERSION) {
|
||||
request->setRequestPath("/_msg/please-upgrade");
|
||||
return false;
|
||||
}
|
||||
|
||||
VocbaseContext* ctx = new triagens::arango::VocbaseContext(request, server, vocbase);
|
||||
|
||||
if (ctx == 0) {
|
||||
|
|
|
|||
|
|
@ -9541,10 +9541,6 @@ static v8::Handle<v8::Value> JS_CreateDatabase (v8::Arguments const& argv) {
|
|||
// version check ok
|
||||
TRI_V8InitialiseFoxx(database, v8::Context::GetCurrent());
|
||||
}
|
||||
else {
|
||||
// version check failed
|
||||
// TODO: report an error
|
||||
}
|
||||
|
||||
// populate the authentication cache. otherwise no one can access the new database
|
||||
TRI_ReloadAuthInfo(database);
|
||||
|
|
@ -10395,10 +10391,15 @@ bool TRI_V8RunVersionCheck (void* vocbase,
|
|||
v8g->_vocbase = vocbase;
|
||||
|
||||
v8::Handle<v8::Value> result = startupLoader->executeGlobalScript(context, "server/version-check.js");
|
||||
bool ok = TRI_ObjectToBoolean(result);
|
||||
|
||||
if (! ok) {
|
||||
((TRI_vocbase_t*) vocbase)->_state = (sig_atomic_t) TRI_VOCBASE_STATE_FAILED_VERSION;
|
||||
}
|
||||
|
||||
v8g->_vocbase = orig;
|
||||
|
||||
return TRI_ObjectToBoolean(result);
|
||||
return ok;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -1410,14 +1410,13 @@ TRI_vocbase_t* TRI_OpenVocBase (TRI_server_t* server,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
TRI_ReloadAuthInfo(vocbase);
|
||||
|
||||
// .............................................................................
|
||||
// vocbase is now active
|
||||
// .............................................................................
|
||||
|
||||
vocbase->_state = 1;
|
||||
vocbase->_state = (sig_atomic_t) TRI_VOCBASE_STATE_NORMAL;
|
||||
|
||||
// .............................................................................
|
||||
// start helper threads
|
||||
|
|
@ -1516,7 +1515,7 @@ void TRI_DestroyVocBase (TRI_vocbase_t* vocbase) {
|
|||
TRI_DestroyVectorPointer(&collections);
|
||||
|
||||
// this will signal the synchroniser and the compactor threads to do one last iteration
|
||||
vocbase->_state = 2;
|
||||
vocbase->_state = (sig_atomic_t) TRI_VOCBASE_STATE_SHUTDOWN_COMPACTOR;
|
||||
|
||||
|
||||
// wait until synchroniser and compactor are finished
|
||||
|
|
@ -1537,7 +1536,7 @@ void TRI_DestroyVocBase (TRI_vocbase_t* vocbase) {
|
|||
}
|
||||
|
||||
// this will signal the cleanup thread to do one last iteration
|
||||
vocbase->_state = 3;
|
||||
vocbase->_state = (sig_atomic_t) TRI_VOCBASE_STATE_SHUTDOWN_CLEANUP;
|
||||
|
||||
TRI_LockCondition(&vocbase->_cleanupCondition);
|
||||
TRI_SignalCondition(&vocbase->_cleanupCondition);
|
||||
|
|
|
|||
|
|
@ -60,11 +60,6 @@ struct TRI_vocbase_defaults_s;
|
|||
// --SECTION-- public macros
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief read locks the collections structure
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -184,19 +179,10 @@ struct TRI_vocbase_defaults_s;
|
|||
TRI_BroadcastCondition(&(a)->_syncWaitersCondition); \
|
||||
TRI_UnlockCondition(&(a)->_syncWaitersCondition)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public constants
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief name of the _from attribute
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -302,19 +288,23 @@ struct TRI_vocbase_defaults_s;
|
|||
|
||||
#define TRI_QRY_NO_SKIP ((TRI_voc_ssize_t) 0)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public types
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
/// @brief database state
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
typedef enum {
|
||||
TRI_VOCBASE_STATE_INACTIVE = 0,
|
||||
TRI_VOCBASE_STATE_NORMAL = 1,
|
||||
TRI_VOCBASE_STATE_SHUTDOWN_COMPACTOR = 2,
|
||||
TRI_VOCBASE_STATE_SHUTDOWN_CLEANUP = 3,
|
||||
TRI_VOCBASE_STATE_FAILED_VERSION = 4
|
||||
}
|
||||
TRI_vocbase_state_e;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief database type
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -367,6 +357,8 @@ typedef struct TRI_vocbase_s {
|
|||
// 1 = normal operation/running
|
||||
// 2 = shutdown in progress/waiting for compactor/synchroniser thread to finish
|
||||
// 3 = shutdown in progress/waiting for cleanup thread to finish
|
||||
// 4 = version check failed
|
||||
|
||||
sig_atomic_t _state;
|
||||
|
||||
TRI_thread_t _synchroniser;
|
||||
|
|
@ -437,19 +429,10 @@ typedef struct TRI_vocbase_col_s {
|
|||
}
|
||||
TRI_vocbase_col_t;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief free the memory associated with a collection
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -681,10 +664,6 @@ bool TRI_IsSystemVocBase (TRI_vocbase_t*);
|
|||
bool TRI_IsAllowedNameVocBase (bool,
|
||||
char const*);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ severity = human
|
|||
username = root
|
||||
password =
|
||||
|
||||
disable-dispatcher-kickstarter = false
|
||||
disable-dispatcher-frontend = false
|
||||
disable-dispatcher-kickstarter = true
|
||||
disable-dispatcher-frontend = true
|
||||
data-path = ./cluster/data
|
||||
log-path = ./cluster/log
|
||||
agent-path = ./bin/etcd-arango
|
||||
|
|
|
|||
|
|
@ -532,6 +532,15 @@ actions.defineHttp({
|
|||
units: "bytes"
|
||||
},
|
||||
|
||||
{
|
||||
group: "system",
|
||||
identifier: "residentSizePercent",
|
||||
name: "Resident Set Size",
|
||||
description: "The percentage of physical memory used as resident set size",
|
||||
type: "current",
|
||||
units: "percent"
|
||||
},
|
||||
|
||||
{
|
||||
group: "system",
|
||||
identifier: "virtualSize",
|
||||
|
|
@ -736,6 +745,15 @@ actions.defineHttp({
|
|||
description: "Number of seconds elapsed since server start.",
|
||||
type: "current",
|
||||
units: "seconds"
|
||||
},
|
||||
|
||||
{
|
||||
group: "server",
|
||||
identifier: "physicalMemory",
|
||||
name: "Physical Memory",
|
||||
description: "Physical memory in bytes.",
|
||||
type: "current",
|
||||
units: "bytes"
|
||||
}
|
||||
|
||||
]
|
||||
|
|
|
|||
|
|
@ -237,13 +237,13 @@
|
|||
var resList = [],
|
||||
list = servers.getList(),
|
||||
diffList = diff.DBServers(),
|
||||
noBeat = beats.noBeat(),
|
||||
didBeat = beats.didBeat(),
|
||||
serving = beats.getServing();
|
||||
|
||||
_.each(list, function(v, k) {
|
||||
v.name = k;
|
||||
resList.push(v);
|
||||
if (_.contains(noBeat, k)) {
|
||||
if (!_.contains(didBeat, k)) {
|
||||
v.status = "critical";
|
||||
return;
|
||||
}
|
||||
|
|
@ -264,12 +264,12 @@
|
|||
var resList = [],
|
||||
list = coords.getList(),
|
||||
diffList = diff.Coordinators(),
|
||||
noBeat = beats.noBeat();
|
||||
didBeat = beats.didBeat();
|
||||
|
||||
_.each(list, function(v, k) {
|
||||
v.name = k;
|
||||
resList.push(v);
|
||||
if (_.contains(noBeat, k)) {
|
||||
if (!_.contains(didBeat, k)) {
|
||||
v.status = "critical";
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
<script src="sharedLibs.js"></script>
|
||||
<script src="libs.js"></script>
|
||||
<script src="cluster.js"></script>
|
||||
<script src="planner.js"></script>
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,17 @@
|
|||
}
|
||||
});
|
||||
return result;
|
||||
},
|
||||
|
||||
isSymmetricSetup: function() {
|
||||
var config = this.get("config");
|
||||
var count = _.size(config.dispatchers);
|
||||
return count === config.numberOfCoordinators
|
||||
&& count === config.numberOfDBservers;
|
||||
},
|
||||
|
||||
isTestSetup: function() {
|
||||
return _.size(this.get("config").dispatchers) === 1;
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,12 +7,13 @@
|
|||
window.ClusterRouter = Backbone.Router.extend({
|
||||
|
||||
routes: {
|
||||
"" : "initialRoute",
|
||||
"planTest" : "planTest",
|
||||
"planSymmetrical" : "planSymmetric",
|
||||
"planAsymmetrical" : "planAsymmetric",
|
||||
"shards" : "showShards",
|
||||
"showCluster" : "showCluster",
|
||||
"dashboard/:server" : "dashboard",
|
||||
"dashboard" : "dashboard",
|
||||
"handleClusterDown" : "handleClusterDown"
|
||||
},
|
||||
|
||||
|
|
@ -27,6 +28,10 @@
|
|||
+ last;
|
||||
},
|
||||
|
||||
initialRoute: function() {
|
||||
this.initial();
|
||||
},
|
||||
|
||||
updateAllUrls: function() {
|
||||
_.each(this.toUpdate, function(u) {
|
||||
u.updateUrl();
|
||||
|
|
@ -39,13 +44,21 @@
|
|||
},
|
||||
|
||||
initialize: function () {
|
||||
var self = this;
|
||||
this.initial = this.planScenario;
|
||||
this.bind('all', function(trigger, args) {
|
||||
var routeData = trigger.split(":");
|
||||
if (trigger === "route") {
|
||||
if (this.currentRoute === "dashboard") {
|
||||
this.dashboardView.stopUpdating();
|
||||
console.log(args);
|
||||
if (args !== "showCluster") {
|
||||
if (self.showClusterView) {
|
||||
self.showClusterView.stopUpdating();
|
||||
self.shutdownView.unrender();
|
||||
}
|
||||
if (self.dashboardView) {
|
||||
self.dashboardView.stopUpdating();
|
||||
}
|
||||
}
|
||||
this.currentRoute = args;
|
||||
}
|
||||
});
|
||||
this.toUpdate = [];
|
||||
|
|
@ -61,6 +74,12 @@
|
|||
if (!this.showClusterView) {
|
||||
this.showClusterView = new window.ShowClusterView();
|
||||
}
|
||||
if (!this.shutdownView) {
|
||||
this.shutdownView = new window.ShutdownButtonView({
|
||||
overview: this.showClusterView
|
||||
});
|
||||
}
|
||||
this.shutdownView.render();
|
||||
this.showClusterView.render();
|
||||
},
|
||||
|
||||
|
|
@ -116,7 +135,11 @@
|
|||
this.clusterDownView.render();
|
||||
},
|
||||
|
||||
dashboard: function(server) {
|
||||
dashboard: function() {
|
||||
var server = this.serverToShow;
|
||||
if (!server) {
|
||||
this.navigate("", {trigger: true});
|
||||
}
|
||||
var statisticsDescription = new window.StatisticsDescription();
|
||||
statisticsDescription.fetch({
|
||||
async:false
|
||||
|
|
@ -125,8 +148,8 @@
|
|||
if (this.dashboardView) {
|
||||
this.dashboardView.stopUpdating();
|
||||
}
|
||||
console.log(server);
|
||||
this.dashboardView = null;
|
||||
// this.dashboardView = new window.ServerDashboardView({
|
||||
this.dashboardView = new window.dashboardView({
|
||||
collection: statisticsCollection,
|
||||
description: statisticsDescription,
|
||||
|
|
|
|||
|
|
@ -12,24 +12,22 @@
|
|||
window.location.replace(url);
|
||||
}
|
||||
});
|
||||
|
||||
window.location.hash = "";
|
||||
$(document).ready(function() {
|
||||
window.App = new window.ClusterRouter();
|
||||
|
||||
Backbone.history.start();
|
||||
|
||||
window.App.navigate("", {trigger: true});
|
||||
|
||||
if(window.App.clusterPlan.get("plan")) {
|
||||
if(window.App.clusterPlan.isAlive()) {
|
||||
window.App.showCluster();
|
||||
window.App.initial = window.App.showCluster;
|
||||
} else {
|
||||
window.App.handleClusterDown();
|
||||
window.App.initial = window.App.handleClusterDown;
|
||||
}
|
||||
} else {
|
||||
window.App.planScenario();
|
||||
window.App.initial = window.App.planScenario;
|
||||
}
|
||||
|
||||
window.App.initialRoute();
|
||||
window.App.handleResize();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
<script id="modalDashboardDummy.ejs" type="text/template">
|
||||
<div id="dbServerModal" class="modal hide fade dashboardModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false"></div>
|
||||
</script>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<div class="controls">
|
||||
<input type="text" placeholder="Server" class="input-xlarge host" value="<%=host?host:''%>"></input>
|
||||
<span class="searchEqualsLabel">:</span>
|
||||
<input type="text" maxlength="5" class="input-small port" placeholder="port" value="<%=port?port:''%>"></input>
|
||||
<input type="text" maxlength="5" class="input-mini port" placeholder="port" value="<%=port?port:''%>"></input>
|
||||
<% if (isFirst) {%>
|
||||
<button class="graphViewer-icon-button gv-icon-small add"></button>
|
||||
<% } else { %>
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@
|
|||
<% if(type === "testPlan") {
|
||||
_.each(byAddress, function(s, a) {
|
||||
_.each(s.coords, function(c) {
|
||||
console.log(c);
|
||||
var url = c.get("protocol")
|
||||
+ "://"
|
||||
+ c.get("address");
|
||||
%>
|
||||
<li class="tile">
|
||||
<div class="coordinator <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>">
|
||||
<span class="clusterInfoIcon">
|
||||
<img src="img/icon_compass-24.png" />
|
||||
</span>
|
||||
</div>
|
||||
<a class="coordinator single <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>" href="<%=url%>" target="_blank">
|
||||
<span class="fa fa-compass icon"></span>
|
||||
</a>
|
||||
<h5 class="collectionName"><%=c.get("name")%></h5>
|
||||
</li>
|
||||
<%
|
||||
|
|
@ -45,11 +45,9 @@
|
|||
_.each(s.dbs, function(c) {
|
||||
%>
|
||||
<li class="tile">
|
||||
<div class="dbserver <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>">
|
||||
<span class="clusterInfoIcon">
|
||||
<img src="img/icon_database-24.png" />
|
||||
</span>
|
||||
</div>
|
||||
<a class="dbserver single <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>">
|
||||
<img src="img/databaseIcon.svg" class="icon svgToReplace"/>
|
||||
</a>
|
||||
<h5 class="collectionName"><%=c.get("name")%> (Shards: <span id="<%=c.get("name")%>Shards" class="shardCounter"/>)</h5>
|
||||
</li>
|
||||
<%
|
||||
|
|
@ -57,26 +55,28 @@
|
|||
});
|
||||
} else {
|
||||
_.each(byAddress, function(s, a) {
|
||||
var type = "single";
|
||||
if (s.coords && s.dbs) {
|
||||
type = "double";
|
||||
}
|
||||
%>
|
||||
<li class="tile">
|
||||
<% _.each(s.coords, function(c) { %>
|
||||
<div class="coordinator <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>">
|
||||
<span class="clusterInfoIcon">
|
||||
<img src="img/icon_compass-24.png" />
|
||||
</span>
|
||||
<h6 class="serverName"><%=c.get("name")%></h6>
|
||||
</div>
|
||||
<% _.each(s.coords, function(c) {
|
||||
var url = c.get("protocol")
|
||||
+ "://"
|
||||
+ c.get("address");
|
||||
%>
|
||||
<a class="coordinator <%=type%> <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>" href="<%=url%>" target="_blank" title="<%=c.get('name')%>">
|
||||
<span class="fa fa-compass icon"></span>
|
||||
</a>
|
||||
<% });
|
||||
var dbName = "";
|
||||
_.each(s.dbs, function(c) {
|
||||
dbName = c.get("name");
|
||||
%>
|
||||
<div class="dbserver <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>">
|
||||
<span class="clusterInfoIcon">
|
||||
<img src="img/icon_database-24.png" />
|
||||
</span>
|
||||
<h6 class="serverName"><%=c.get("name")%></h6>
|
||||
</div>
|
||||
<a class="dbserver <%=type%> <%=statusClass(c.get('status'))%>" id="<%=c.get('address')%>" title="<%=c.get('name')%>">
|
||||
<img src="img/databaseIcon.svg" class="icon svgToReplace"/>
|
||||
</a>
|
||||
<% }); %>
|
||||
<h5 class="collectionName"><%=a%> <%=dbName!==""?"(Shards: <span id=\"" + dbName + "Shards\"/>)":""%></h5>
|
||||
</li>
|
||||
|
|
@ -84,16 +84,20 @@
|
|||
});
|
||||
}
|
||||
%>
|
||||
<li><button id="clusterShutdown" class="button-danger pull-right">Shutdown Cluster</button></li>
|
||||
</ul>
|
||||
|
||||
<div class="headerBar">
|
||||
<a class="arangoHeader">Cluster Statistics</a>
|
||||
</div>
|
||||
<div class="resizecontainer">
|
||||
<div id="clusterGraphs" class="dashboardChart">
|
||||
<div>Virtual Memory Size</div>
|
||||
</div>
|
||||
<div id="lineGraph" class="dashboardChart"></div>
|
||||
<div class="dashboardChart">
|
||||
<div id="clusterGraphs" class="innerDashboardChart">
|
||||
<div>Virtual Memory Size</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="dashboardChart">
|
||||
<div id="lineGraph" class="innerDashboardChart">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
<script id="shutdownButtonView.ejs" type="text/template">
|
||||
<button id="clusterShutdown" class="button-danger shutdown">Shutdown Cluster</button>
|
||||
</script>
|
||||
|
|
@ -15,6 +15,7 @@
|
|||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button class="button-success" id="startSymmetricPlan">Launch Cluster</button>
|
||||
<button class="button-close" id="cancel">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
<div class="controls">
|
||||
<input type="text" id="host" placeholder="Server" class="input-xlarge" value="<%=hostname%>"></input>
|
||||
<span class="searchEqualsLabel">:</span>
|
||||
<input type="text" maxlength="5" class="input-small" id="port" placeholder="port" value="<%=port%>" ></input>
|
||||
<input type="text" maxlength="5" class="input-mini" id="port" placeholder="port" value="<%=port%>" ></input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button class="button-success" id="startTestPlan">Launch Cluster</button>
|
||||
<button class="button-close" id="cancel">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -37,18 +37,21 @@
|
|||
});
|
||||
},
|
||||
editPlan: function() {
|
||||
var config = window.App.clusterPlan.get("config");
|
||||
if (_.size(config.dispatchers) === 1) {
|
||||
var plan = window.App.clusterPlan;
|
||||
if (plan.isTestSetup()) {
|
||||
window.App.navigate("planTest", {trigger : true});
|
||||
return;
|
||||
}
|
||||
//TODO
|
||||
// window.App.navigate("planSymmetrical", {trigger : true});
|
||||
if (plan.isSymmetricSetup()) {
|
||||
window.App.navigate("planSymmetrical", {trigger : true});
|
||||
return;
|
||||
}
|
||||
window.App.navigate("planAsymmetrical", {trigger : true});
|
||||
},
|
||||
|
||||
deletePlan: function() {
|
||||
window.App.clusterPlan.destroy();
|
||||
window.App.clusterPlan = new window.ClusterPlan();
|
||||
window.App.planScenario();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global require, exports, Backbone, EJS, $, flush, window, arangoHelper, nv, d3, localStorage*/
|
||||
/*global document, Dygraph, _,templateEngine */
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
window.ServerDashboardView = window.dashboardView.extend({
|
||||
el: "#dbServerModal",
|
||||
|
||||
events: {
|
||||
|
||||
},
|
||||
|
||||
render: function() {
|
||||
window.dashboardView.prototype.render.bind(this)();
|
||||
$(this.el).modal("show");
|
||||
}
|
||||
});
|
||||
|
||||
}());
|
||||
|
|
@ -13,7 +13,12 @@
|
|||
events: {
|
||||
"click #startSymmetricPlan": "startPlan",
|
||||
"click .add": "addEntry",
|
||||
"click .delete": "removeEntry"
|
||||
"click .delete": "removeEntry",
|
||||
"click #cancel": "cancel"
|
||||
},
|
||||
|
||||
cancel: function() {
|
||||
window.App.navigate("", {trigger: true});
|
||||
},
|
||||
|
||||
startPlan: function() {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,12 @@
|
|||
modal: templateEngine.createTemplate("waitModal.ejs"),
|
||||
|
||||
events: {
|
||||
"click #startTestPlan": "startPlan"
|
||||
"click #startTestPlan": "startPlan",
|
||||
"click #cancel": "cancel"
|
||||
},
|
||||
|
||||
cancel: function() {
|
||||
window.App.navigate("", {trigger: true});
|
||||
},
|
||||
|
||||
startPlan: function() {
|
||||
|
|
|
|||
|
|
@ -10,17 +10,31 @@
|
|||
|
||||
template: templateEngine.createTemplate("showCluster.ejs"),
|
||||
modal: templateEngine.createTemplate("waitModal.ejs"),
|
||||
modalDummy: templateEngine.createTemplate("modalDashboardDummy.ejs"),
|
||||
|
||||
events: {
|
||||
"change #selectDB" : "updateCollections",
|
||||
"change #selectCol" : "updateShards",
|
||||
"click .coordinator" : "dashboard",
|
||||
"click .dbserver" : "dashboard",
|
||||
"click #clusterShutdown" : "clusterShutdown",
|
||||
"mouseover #lineGraph" : "setShowAll",
|
||||
"mouseout #lineGraph" : "resetShowAll"
|
||||
},
|
||||
|
||||
replaceSVGs: function() {
|
||||
$(".svgToReplace").each(function() {
|
||||
var img = $(this);
|
||||
var id = img.attr("id");
|
||||
var src = img.attr("src");
|
||||
$.get(src, function(d) {
|
||||
var svg = $(d).find("svg");
|
||||
svg.attr("id", id)
|
||||
.attr("class", "icon")
|
||||
.removeAttr("xmlns:a");
|
||||
img.replaceWith(svg);
|
||||
}, "xml");
|
||||
});
|
||||
},
|
||||
|
||||
updateServerTime: function() {
|
||||
this.serverTime = new Date().getTime();
|
||||
},
|
||||
|
|
@ -102,7 +116,6 @@
|
|||
},
|
||||
|
||||
updateDBDetailList: function() {
|
||||
console.log("Updated");
|
||||
var dbName = $("#selectDB").find(":selected").attr("id");
|
||||
var colName = $("#selectCol").find(":selected").attr("id");
|
||||
|
||||
|
|
@ -155,6 +168,7 @@
|
|||
type: this.type
|
||||
}));
|
||||
$(this.el).append(this.modal.render({}));
|
||||
this.replaceSVGs();
|
||||
this.loadHistory();
|
||||
this.getServerStatistics();
|
||||
this.data = this.generatePieData();
|
||||
|
|
@ -168,7 +182,7 @@
|
|||
var pieData = [];
|
||||
var self = this;
|
||||
this.data.forEach(function(m) {
|
||||
pieData.push({key: m.get("name"), value :m.get("system").virtualSize,
|
||||
pieData.push({key: m.get("name"), value :m.get("system").residentSize,
|
||||
time: self.serverTime});
|
||||
});
|
||||
return pieData;
|
||||
|
|
@ -202,10 +216,22 @@
|
|||
loadHistory : function() {
|
||||
this.hist = [];
|
||||
var self = this;
|
||||
var coord = this.coordinators.findWhere({
|
||||
status: "ok"
|
||||
});
|
||||
var endpoint = coord.get("protocol")
|
||||
+ "://"
|
||||
+ coord.get("address");
|
||||
this.dbservers.forEach(function (dbserver) {
|
||||
if (dbserver.get("status") !== "ok") {return;}
|
||||
if (self.knownServers.indexOf(dbserver.id) === -1) {self.knownServers.push(dbserver.id);}
|
||||
self.documentStore.getStatisticsHistory({server: dbserver.get("address"), figures : ["client.totalTime"]});
|
||||
var server = {
|
||||
raw: dbserver.get("address"),
|
||||
isDBServer: true,
|
||||
target: encodeURIComponent(dbserver.get("name")),
|
||||
endpoint: endpoint
|
||||
};
|
||||
self.documentStore.getStatisticsHistory({server: server, figures : ["client.totalTime"]});
|
||||
self.history = self.documentStore.history;
|
||||
self.history.forEach(function(e) {
|
||||
var h = {};
|
||||
|
|
@ -218,7 +244,13 @@
|
|||
this.coordinators.forEach(function (coordinator) {
|
||||
if (coordinator.get("status") !== "ok") {return;}
|
||||
if (self.knownServers.indexOf(coordinator.id) === -1) {self.knownServers.push(coordinator.id);}
|
||||
self.documentStore.getStatisticsHistory({server: coordinator.get("address"), figures : ["client.totalTime"]});
|
||||
var server = {
|
||||
raw: coordinator.get("address"),
|
||||
isDBServer: false,
|
||||
target: encodeURIComponent(coordinator.get("name")),
|
||||
endpoint: coordinator.get("protocol") + "://" + coordinator.get("address")
|
||||
};
|
||||
self.documentStore.getStatisticsHistory({server: server, figures : ["client.totalTime"]});
|
||||
self.history = self.documentStore.history;
|
||||
self.history.forEach(function(e) {
|
||||
var h = {};
|
||||
|
|
@ -257,8 +289,8 @@
|
|||
},
|
||||
|
||||
renderPieChart: function(dataset) {
|
||||
var w = 500;
|
||||
var h = 250;
|
||||
var w = 150;
|
||||
var h = 150;
|
||||
var radius = Math.min(w, h) / 2; //change 2 to 1.4. It's hilarious.
|
||||
var color = d3.scale.category20();
|
||||
|
||||
|
|
@ -439,21 +471,6 @@
|
|||
}, this.interval);
|
||||
},
|
||||
|
||||
clusterShutdown : function() {
|
||||
this.stopUpdating();
|
||||
$('#waitModalLayer').modal('show');
|
||||
$('#waitModalMessage').html('Please be patient while your cluster will shutdown');
|
||||
$.ajax({
|
||||
cache: false,
|
||||
type: "GET",
|
||||
async: false, // sequential calls!
|
||||
url: "cluster/shutdown",
|
||||
success: function(data) {
|
||||
$('#waitModalLayer').modal('hide');
|
||||
window.App.navigate("handleClusterDown", {trigger: true});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
dashboard: function(e) {
|
||||
this.stopUpdating();
|
||||
|
|
@ -461,6 +478,7 @@
|
|||
var serv = {};
|
||||
var cur;
|
||||
var coord;
|
||||
$("#modalPlaceholder").html(this.modalDummy.render({}));
|
||||
serv.raw = tar.attr("id");
|
||||
serv.isDBServer = tar.hasClass("dbserver");
|
||||
if (serv.isDBServer) {
|
||||
|
|
@ -482,7 +500,8 @@
|
|||
+ cur.get("address");
|
||||
}
|
||||
serv.target = encodeURIComponent(cur.get("name"));
|
||||
window.App.dashboard(serv);
|
||||
window.App.serverToShow = serv;
|
||||
window.App.navigate("dashboard", {trigger: true});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
|
||||
/*global Backbone, templateEngine, $, window*/
|
||||
(function () {
|
||||
"use strict";
|
||||
window.ShutdownButtonView = Backbone.View.extend({
|
||||
el: '#navigationBar',
|
||||
|
||||
events: {
|
||||
"click #clusterShutdown" : "clusterShutdown"
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
this.overview = this.options.overview;
|
||||
},
|
||||
|
||||
template: templateEngine.createTemplate("shutdownButtonView.ejs"),
|
||||
|
||||
clusterShutdown : function() {
|
||||
this.overview.stopUpdating();
|
||||
$('#waitModalLayer').modal('show');
|
||||
$('#waitModalMessage').html('Please be patient while your cluster is shutting down');
|
||||
$.ajax({
|
||||
cache: false,
|
||||
type: "GET",
|
||||
async: false, // sequential calls!
|
||||
url: "cluster/shutdown",
|
||||
success: function(data) {
|
||||
$('#waitModalLayer').modal('hide');
|
||||
window.App.navigate("handleClusterDown", {trigger: true});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
render: function () {
|
||||
$(this.el).html(this.template.render({}));
|
||||
return this;
|
||||
},
|
||||
|
||||
unrender: function() {
|
||||
$(this.el).html("");
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ sub {
|
|||
}
|
||||
|
||||
img {
|
||||
width: auto\9;
|
||||
width: auto;
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
vertical-align: middle;
|
||||
|
|
|
|||
|
|
@ -179,9 +179,14 @@
|
|||
top: 3px;
|
||||
}
|
||||
|
||||
.modal-header a {
|
||||
top: 2px !important;
|
||||
}
|
||||
|
||||
.modal-header .close {
|
||||
color: #FFFFFF;
|
||||
opacity: 0.5;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.modal-header .close:hover {
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg enable-background="new 0 0 512 512" x="0px" y="0px" height="512px" id="Layer_1" version="1.1" viewBox="0 0 512 512" width="512px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path id="stat_cpu2" d="M336,359.5c0,4.693-3.806,8.5-8.5,8.5h-143c-4.694,0-8.5-3.807-8.5-8.5v-127c0-4.694,3.806-8.5,8.5-8.5h143 c4.694,0,8.5,3.806,8.5,8.5V359.5z M448,148.672v294.656c0,20.25-16.422,36.672-36.672,36.672H100.672 C80.422,480,64,463.578,64,443.328V148.672C64,128.422,80.422,112,100.672,112h310.656C431.578,112,448,128.422,448,148.672z M93.602,160c0,10.172,8.234,18.406,18.398,18.406s18.398-8.234,18.398-18.406s-8.234-18.406-18.398-18.406 S93.602,149.828,93.602,160z M146.344,443.016l-45.367-45.375c-0.828-0.828-2.086-1.078-3.18-0.625 c-1.086,0.453-1.797,1.517-1.797,2.688v45.391c0,1.609,1.305,2.906,2.914,2.906h45.367c1.18,0,2.25-0.719,2.695-1.797 C147.43,445.109,147.18,443.859,146.344,443.016z M368,208c0-8.844-7.164-16-16-16H160c-8.836,0-16,7.156-16,16v176 c0,8.844,7.164,16,16,16h192c8.836,0,16-7.156,16-16V208z M418.398,432c0-10.172-8.234-18.406-18.398-18.406 s-18.398,8.234-18.398,18.406s8.234,18.406,18.398,18.406S418.398,442.172,418.398,432z M418.398,160 c0-10.172-8.234-18.406-18.398-18.406s-18.398,8.234-18.398,18.406s8.234,18.406,18.398,18.406S418.398,170.172,418.398,160z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- The icon can be used freely in both personal and commercial projects with no attribution required, but always appreciated.
|
||||
You may NOT sub-license, resell, rent, redistribute or otherwise transfer the icon without express written permission from iconmonstr.com -->
|
||||
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
|
||||
<path id="database-icon" d="M422.122,355.606v46.524C422.122,435.196,347.747,462,256,462c-91.747,0-166.122-26.804-166.122-59.869
|
||||
v-46.524c10.283,7.391,23.186,13.907,38.485,19.422C162.918,387.481,208.248,394.34,256,394.34
|
||||
c47.753,0,93.082-6.858,127.638-19.312C398.938,369.514,411.839,362.997,422.122,355.606z M383.638,277.788
|
||||
c-34.556,12.454-79.885,19.312-127.638,19.312c-47.752,0-93.082-6.858-127.638-19.312c-15.299-5.514-28.201-12.03-38.484-19.421
|
||||
v46.104c0,33.065,74.375,59.869,166.122,59.869c91.747,0,166.122-26.804,166.122-59.869v-46.104
|
||||
C411.839,265.758,398.938,272.274,383.638,277.788z M256,50c-91.747,0-166.122,26.805-166.122,59.87
|
||||
c0,33.066,74.375,59.871,166.122,59.871c91.747,0,166.122-26.805,166.122-59.871C422.122,76.805,347.747,50,256,50z
|
||||
M383.638,180.428C349.082,192.881,303.753,199.74,256,199.74c-47.752,0-93.082-6.859-127.638-19.312
|
||||
c-15.299-5.514-28.201-12.031-38.484-19.422v46.225c0,33.065,74.375,59.87,166.122,59.87c91.747,0,166.122-26.805,166.122-59.87
|
||||
v-46.224C411.839,168.397,398.938,174.914,383.638,180.428z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 512 512" height="512px" id="Layer_1" version="1.1" viewBox="0 0 512 512" width="512px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M472,344c0-13.266,10.75-24,24-24v-52.656c0-15.11-12.242-27.344-27.336-27.344H43.336 C28.242,240,16,252.234,16,267.344V320c13.25,0,24,10.734,24,24s-10.75,24-24,24v84.656C16,467.766,28.242,480,43.336,480H80 v-27.672c0-2.391,1.938-4.328,4.328-4.328h7.344c2.391,0,4.328,1.938,4.328,4.328V480h32v-27.672c0-2.391,1.938-4.328,4.328-4.328 h7.344c2.391,0,4.328,1.938,4.328,4.328V480h32v-27.672c0-2.391,1.938-4.328,4.328-4.328h7.344c2.391,0,4.328,1.938,4.328,4.328 V480h32v-27.672c0-2.391,1.938-4.328,4.328-4.328h7.344c2.391,0,4.328,1.938,4.328,4.328V480h32v-27.672 c0-2.391,1.938-4.328,4.328-4.328h7.344c2.391,0,4.328,1.938,4.328,4.328V480h32v-27.672c0-2.391,1.938-4.328,4.328-4.328h7.344 c2.391,0,4.328,1.938,4.328,4.328V480h32v-27.672c0-2.391,1.938-4.328,4.328-4.328h7.344c2.391,0,4.328,1.938,4.328,4.328V480h32 v-27.672c0-2.391,1.938-4.328,4.328-4.328h7.344c2.391,0,4.328,1.938,4.328,4.328V480h36.664C483.758,480,496,467.766,496,452.656 V368C482.75,368,472,357.266,472,344z M160,395.219c0,2.642-2.141,4.781-4.781,4.781h-54.438C98.14,400,96,397.859,96,395.219 v-86.438c0-2.641,2.141-4.781,4.781-4.781h54.438c2.641,0,4.781,2.141,4.781,4.781V395.219z M288,395.219 c0,2.642-2.141,4.781-4.781,4.781h-54.438c-2.641,0-4.781-2.141-4.781-4.781v-86.438c0-2.641,2.141-4.781,4.781-4.781h54.438 c2.641,0,4.781,2.141,4.781,4.781V395.219z M416,395.219c0,2.642-2.141,4.781-4.781,4.781h-54.438 c-2.642,0-4.781-2.141-4.781-4.781v-86.438c0-2.641,2.141-4.781,4.781-4.781h54.438c2.642,0,4.781,2.141,4.781,4.781V395.219z" fill="#4D4D4D"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -0,0 +1 @@
|
|||
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 512 512" height="512px" id="Layer_1" version="1.1" viewBox="0 0 512 512" width="512px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M272,296c0,4.422-3.578,8-8,8s-8-3.578-8-8s3.578-8,8-8S272,291.578,272,296z M264,320 c-4.422,0-8,3.578-8,8s3.578,8,8,8s8-3.578,8-8S268.422,320,264,320z M259.227,266.109c1.228,4.897,8.344,4.633,9.642-0.383 c4.758-18.461,18.547-34.109,38.453-42.711c9.655-4.164,24.414-10.641,34.305-32.797c-64.444,11.453-85.172-15.141-160.078-13.734 c9.188,33.477,27.742,41.609,39.164,46.539C240.734,231.688,254.57,247.484,259.227,266.109z M432,455.984c0,13.25-10.742,24-24,24 H120c-13.258,0-24-10.75-24-24s10.742-24,24-24h8c0-76.742,26.203-120.648,73.75-139.086c14.805-5.758,15.133-19.234-0.086-25.813 C152.797,246,128,204.742,128,128h-8c-13.258,0-24-10.742-24-24s10.742-24,24-24h288c13.258,0,24,10.742,24,24s-10.742,24-24,24h-8 c0,76.742-24.797,118-73.664,139.086c-15.219,6.578-14.891,20.055-0.086,25.813C373.797,311.336,400,355.242,400,431.984h8 C421.258,431.984,432,442.734,432,455.984z M156.797,431.984h15.477c22.531-45.898,68.094-86.353,91.727-77.883 c27.595,9.891,64.836,33.477,89.898,77.883h17.305c0-81.353-31.603-103.017-55.391-112.242 c-17.931-6.977-29.259-21.836-29.57-38.789c-0.32-17.078,10.664-32.523,28.688-40.313c27.82-12.008,56.273-34.781,56.273-112.641 H156.797c0,77.859,28.453,100.633,56.297,112.648c18,7.781,28.984,23.227,28.664,40.305c-0.313,16.952-11.641,31.813-29.594,38.797 C188.398,328.969,156.797,350.633,156.797,431.984z" fill="#4D4D4D"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
|
|
@ -1,24 +1,21 @@
|
|||
<script id="dashboardView.ejs" type="text/template">
|
||||
|
||||
<ul class="thumbnails2">
|
||||
<div id="dashboardHeader" class="headerBar">
|
||||
<a class="arangoHeader"><%=header%></a>
|
||||
</div>
|
||||
</ul>
|
||||
|
||||
<div class="headerBar">
|
||||
<a class="arangoHeader"><%= header %></a>
|
||||
<% if (backButton) { %>
|
||||
<button id="backToCluster" class="button-header pull-right">Back to Cluster</button>
|
||||
<% } %>
|
||||
</div>
|
||||
<div class="contentDiv">
|
||||
<div id="dashboardHeader" class="headerBar">
|
||||
<!--
|
||||
<div id="dashboardHeader" class="headerBar">
|
||||
<a class="arangoHeader">Distribution Charts</a>
|
||||
</div>
|
||||
<div id="distributionChartDiv"></div>
|
||||
<div id="dashboardHeader" class="headerBar">
|
||||
<a class="arangoHeader">Request Statistics</a>
|
||||
</div>
|
||||
-->
|
||||
<div class="lineChartDiv" id="requestStatistics"></div>
|
||||
<div id="dashboardHeader" class="headerBar">
|
||||
<div class="headerBar">
|
||||
<a class="arangoHeader">System Resources</a>
|
||||
</div>
|
||||
<div class="lineChartDiv" id="systemResources"></div>
|
||||
</div>
|
||||
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
<script id="statisticBarView.ejs" type="text/template">
|
||||
<div class="navlogo">
|
||||
<div class="navlogo statisticbar">
|
||||
<a href="#dashboard" style="padding-left: 15px;">
|
||||
<img id="stat_cpu"
|
||||
src="img/statusBar-cpu-16.png"
|
||||
style="background-color: #ef8787;margin-top: 9px;"
|
||||
<img class="svg stat_cpu"
|
||||
src="img/cpu.svg"
|
||||
/>
|
||||
<img id="stat_ram"
|
||||
src="img/statusBar-ram-16.png"
|
||||
<img class="svg stat_ram"
|
||||
src="img/ram.svg"
|
||||
style="background-color: #FAFF92; margin-top: 9px; margin-left: 4px; margin-right: 2px;"
|
||||
/>
|
||||
<img id="stat_req"
|
||||
src="img/statusBar-req-16.png"
|
||||
<img class="svg stat_req"
|
||||
src="img/requests.svg"
|
||||
style="background-color: #8aa051; margin-top: 9px;"
|
||||
/>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
y = y / 100000;
|
||||
return y.toPrecision(3) + "MB";
|
||||
}
|
||||
if (y > 100) {
|
||||
if (y > 1000) {
|
||||
y = y / 1000;
|
||||
return y.toPrecision(3) + "KB";
|
||||
}
|
||||
|
|
@ -66,14 +66,14 @@
|
|||
detailEl: '#modalPlaceholder',
|
||||
|
||||
events: {
|
||||
"dblclick .innerDashboardChart" : "showDetail",
|
||||
"mousedown .dygraph-rangesel-zoomhandle" : "stopUpdating",
|
||||
"mouseup .dygraph-rangesel-zoomhandle" : "startUpdating",
|
||||
"mouseleave .dygraph-rangesel-zoomhandle" : "startUpdating",
|
||||
"click #backToCluster" : "returnToClusterView"
|
||||
"click .innerDashboardChart" : "showDetail",
|
||||
"mousedown .dygraph-rangesel-zoomhandle" : "stopUpdating",
|
||||
"mouseup .dygraph-rangesel-zoomhandle" : "startUpdating",
|
||||
"mouseleave .dygraph-rangesel-zoomhandle" : "startUpdating",
|
||||
"click #backToCluster" : "returnToClusterView"
|
||||
},
|
||||
|
||||
hideGraphs : ["totalTime", "uptime", "minorPageFaults", "residentSize", "requestsTotal"],
|
||||
|
||||
hideGraphs : ["totalTime", "uptime", "residentSize", "physicalMemory", "minorPageFaults", "requestsTotal"],
|
||||
|
||||
chartTypeExceptions : {
|
||||
accumulated : {
|
||||
|
|
@ -110,6 +110,7 @@
|
|||
system_systemUserTime: ["systemTime","userTime"],
|
||||
client_totalRequestTime: ["requestTime","queueTime"]
|
||||
},
|
||||
|
||||
colors : ["#617e2b", "#296e9c", "#81ccd8", "#7ca530", "#f6fbac", "#3c3c3c",
|
||||
"#aa90bd", "#e1811d", "#c7d4b2", "#d0b2d4"],
|
||||
|
||||
|
|
@ -203,6 +204,20 @@
|
|||
residentSize : {
|
||||
div : "#systemResources"
|
||||
},
|
||||
residentSizePercent : {
|
||||
div : "#systemResources",
|
||||
axes : {
|
||||
y: {
|
||||
labelsKMG2: false,
|
||||
axisLabelFormatter: function(y) {
|
||||
return y.toPrecision(2) + "%";
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
physicalMemory : {
|
||||
div : "#systemResources"
|
||||
},
|
||||
virtualSize : {
|
||||
div : "#systemResources"
|
||||
},
|
||||
|
|
@ -373,38 +388,40 @@
|
|||
},
|
||||
|
||||
getChartStructure: function (figure) {
|
||||
var options = {
|
||||
labelsDivStyles: { 'backgroundColor': '#e1e3e5','textAlign': 'right' },
|
||||
labelsSeparateLines: true,
|
||||
digitsAfterDecimal: 3,
|
||||
drawGapPoints: true,
|
||||
fillGraph : true,
|
||||
showLabelsOnHighlight : false,
|
||||
strokeWidth: 2,
|
||||
interactionModel : {},
|
||||
axisLabelFont: "Open Sans",
|
||||
dateWindow : [new Date().getTime() - 20 * 60 * 1000,new Date().getTime()],
|
||||
colors: [this.colors[0]],
|
||||
xAxisLabelWidth : "60",
|
||||
rollPeriod: this.defaultRollPeriod,
|
||||
showRangeSelector: false,
|
||||
rightGap: 15,
|
||||
rangeSelectorHeight: 30,
|
||||
rangeSelectorPlotStrokeColor: '#617e2b',
|
||||
rangeSelectorPlotFillColor: '#414a4c',
|
||||
pixelsPerLabel : 60,
|
||||
labelsKMG2: true,
|
||||
axes : {
|
||||
x: {
|
||||
valueFormatter: function(d) {
|
||||
return xAxisFormat(d);
|
||||
var options = {
|
||||
// labelsDivStyles: { 'backgroundColor': '#e1e3e5','textAlign': 'right', 'border' },
|
||||
// labelsSeparateLines: false,
|
||||
digitsAfterDecimal: 2,
|
||||
drawGapPoints: true,
|
||||
fillGraph : true,
|
||||
showLabelsOnHighlight : false,
|
||||
strokeWidth: 2,
|
||||
strokeBorderWidth: 1,
|
||||
highlightCircleSize: 0,
|
||||
strokeBorderColor: '#ffffff',
|
||||
interactionModel : {},
|
||||
dateWindow : [new Date().getTime() - 20 * 60 * 1000,new Date().getTime()],
|
||||
colors: [this.colors[0]],
|
||||
xAxisLabelWidth : "60",
|
||||
rollPeriod: this.defaultRollPeriod,
|
||||
rightGap: 10,
|
||||
showRangeSelector: false,
|
||||
rangeSelectorHeight: 40,
|
||||
rangeSelectorPlotStrokeColor: '#365300',
|
||||
rangeSelectorPlotFillColor: '#414a4c',
|
||||
pixelsPerLabel : 60,
|
||||
labelsKMG2: true,
|
||||
axes : {
|
||||
x: {
|
||||
valueFormatter: function(d) {
|
||||
return xAxisFormat(d);
|
||||
}
|
||||
},
|
||||
y: {
|
||||
ticker: Dygraph.numericLinearTicks
|
||||
}
|
||||
}
|
||||
},
|
||||
y: {
|
||||
ticker: Dygraph.numericLinearTicks
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
if (figure.name) {
|
||||
options.title = figure.name;
|
||||
}
|
||||
|
|
@ -587,20 +604,22 @@
|
|||
var t = new Date().getTime();
|
||||
var borderLeft, borderRight;
|
||||
if (!createDiv) {
|
||||
displayOptions.height = $('#lineChartDetail').height() - 34 -29;
|
||||
displayOptions.width = $('#lineChartDetail').width() -60;
|
||||
chart.options.showRangeSelector = true;
|
||||
chart.options.interactionModel = null;
|
||||
chart.options.showLabelsOnHighlight = true;
|
||||
if (chart.graph.dateWindow_) {
|
||||
borderLeft = chart.graph.dateWindow_[0];
|
||||
borderRight = t - chart.graph.dateWindow_[1] - self.interval * 5 > 0 ?
|
||||
chart.graph.dateWindow_[1] : t;
|
||||
file = self.spliceSeries(chart.data, borderLeft, borderRight, false);
|
||||
}
|
||||
displayOptions.height = $('#lineChartDetail').height() - 34 -29;
|
||||
displayOptions.width = $('#lineChartDetail').width() -10;
|
||||
chart.options.showRangeSelector = true;
|
||||
chart.options.title = "";
|
||||
chart.options.interactionModel = null;
|
||||
chart.options.showLabelsOnHighlight = true;
|
||||
chart.options.highlightCircleSize = 3;
|
||||
if (chart.graph.dateWindow_) {
|
||||
borderLeft = chart.graph.dateWindow_[0];
|
||||
borderRight = t - chart.graph.dateWindow_[1] - self.interval * 5 > 0 ?
|
||||
chart.graph.dateWindow_[1] : t;
|
||||
file = self.spliceSeries(chart.data, borderLeft, borderRight, false);
|
||||
}
|
||||
} else {
|
||||
borderLeft = chart.options.dateWindow[0] + (t - chart.options.dateWindow[1]);
|
||||
borderRight = t;
|
||||
borderLeft = chart.options.dateWindow[0] + (t - chart.options.dateWindow[1]);
|
||||
borderRight = t;
|
||||
}
|
||||
if (!chart.graphCreated) {
|
||||
if (createDiv) {
|
||||
|
|
@ -704,24 +723,20 @@
|
|||
}));
|
||||
},
|
||||
|
||||
displayBackButtonForClusterView : function () {
|
||||
if (this.options.server) {
|
||||
$("#dashboardHeader").append(
|
||||
"<button id=\"backToCluster\" class=\"pull-right\" style=\"margin: 5px;\">" +
|
||||
"<b>Back to cluster</b>" +
|
||||
"</button>"
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var self = this;
|
||||
var header = "Dashboard";
|
||||
var header = "Request Statistics";
|
||||
var addBackbutton = false;
|
||||
if (this.options.server) {
|
||||
header += " (" + this.options.server.raw + ")";
|
||||
header += " for Server ";
|
||||
header += this.options.server.raw + " (";
|
||||
header += decodeURIComponent(this.options.server.target) + ")";
|
||||
addBackbutton = true;
|
||||
}
|
||||
$(this.el).html(this.template.render({header : header}));
|
||||
this.displayBackButtonForClusterView();
|
||||
$(this.el).html(this.template.render({
|
||||
header : header,
|
||||
backButton: addBackbutton
|
||||
}));
|
||||
this.renderDistributionPlaceholder();
|
||||
this.prepareSeries();
|
||||
this.calculateSeries();
|
||||
|
|
@ -812,7 +827,7 @@
|
|||
},
|
||||
|
||||
returnToClusterView : function() {
|
||||
window.App.showCluster();
|
||||
window.history.back();
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
|
|
|||
|
|
@ -16,6 +16,35 @@
|
|||
$(this.el).html(this.template.render({
|
||||
isSystem: window.currentDB.get("isSystem")
|
||||
}));
|
||||
|
||||
$('img.svg').each(function(){
|
||||
var $img = $(this);
|
||||
var imgID = $img.attr('id');
|
||||
var imgClass = $img.attr('class');
|
||||
var imgURL = $img.attr('src');
|
||||
|
||||
$.get(imgURL, function(data) {
|
||||
// Get the SVG tag, ignore the rest
|
||||
var $svg = $(data).find('svg');
|
||||
|
||||
// Add replaced image's ID to the new SVG
|
||||
if(typeof imgID !== 'undefined') {
|
||||
$svg = $svg.attr('id', imgID);
|
||||
}
|
||||
// Add replaced image's classes to the new SVG
|
||||
if(typeof imgClass !== 'undefined') {
|
||||
$svg = $svg.attr('class', imgClass+' replaced-svg');
|
||||
}
|
||||
|
||||
// Remove any invalid XML tags as per http://validator.w3.org
|
||||
$svg = $svg.removeAttr('xmlns:a');
|
||||
|
||||
// Replace image with new SVG
|
||||
$img.replaceWith($svg);
|
||||
|
||||
}, 'xml');
|
||||
|
||||
});
|
||||
return this;
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -45,6 +45,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
%svg-negative {
|
||||
fill: $c_negative;
|
||||
&:hover {
|
||||
fill: $c_negative_hover;
|
||||
}
|
||||
}
|
||||
|
||||
%positive {
|
||||
background-color: $c_positive;
|
||||
&:hover {
|
||||
|
|
@ -59,6 +66,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
%svg-positive {
|
||||
fill: $c_positive;
|
||||
&:hover {
|
||||
fill: $c_positive_hover;
|
||||
}
|
||||
}
|
||||
|
||||
%warning {
|
||||
background-color: $c_warning;
|
||||
&:hover {
|
||||
|
|
@ -73,6 +87,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
%svg-warning {
|
||||
fill: $c_warning;
|
||||
&:hover {
|
||||
fill: $c_warning_hover;
|
||||
}
|
||||
}
|
||||
|
||||
%neutral {
|
||||
background-color: $c_neutral;
|
||||
&:hover {
|
||||
|
|
@ -87,6 +108,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
%svg-neutral {
|
||||
fill: $c_neutral;
|
||||
&:hover {
|
||||
fill: $c_neutral_hover;
|
||||
}
|
||||
}
|
||||
|
||||
%primary {
|
||||
background-color: $c_primary;
|
||||
&:hover {
|
||||
|
|
@ -101,6 +129,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
%header {
|
||||
background-color: $c_header_btn_bg;
|
||||
color: $c_header_btn_fg;
|
||||
border: 1px solid $c_header_btn_border;
|
||||
&:hover {
|
||||
background-color: $c_white;
|
||||
color: $c_black;
|
||||
}
|
||||
}
|
||||
|
||||
%notification {
|
||||
background-color: $c_notification;
|
||||
&:hover {
|
||||
|
|
@ -130,6 +168,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
%svg-inactive {
|
||||
fill: $c_inactive;
|
||||
&:hover {
|
||||
fill: $c_inactive_hover;
|
||||
}
|
||||
}
|
||||
|
||||
%dropdown-menu {
|
||||
@extend %pull-left;
|
||||
position: absolute;
|
||||
|
|
@ -156,12 +201,12 @@
|
|||
|
||||
li.dropdown-header {
|
||||
font: {
|
||||
weight: 400;
|
||||
size: 13px;
|
||||
weight: 600;
|
||||
size: 15px;
|
||||
}
|
||||
color: $c_dark_grey;
|
||||
padding: 0px 20px;
|
||||
text-transform: uppercase;
|
||||
font-variant: small-caps;
|
||||
}
|
||||
|
||||
li.divider {
|
||||
|
|
|
|||
|
|
@ -1,19 +1,29 @@
|
|||
// Bootstrap Buttons
|
||||
%btn {
|
||||
%bare-btn {
|
||||
@include border-radius(4px);
|
||||
@include box-shadow(0);
|
||||
font-weight: 300 !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
%btn {
|
||||
@extend %bare-btn;
|
||||
border: none;
|
||||
color: $c_white;
|
||||
margin-left: 10px;
|
||||
padding: 5px 16px;
|
||||
font-weight: 300 !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
.button-neutral {
|
||||
@extend %btn;
|
||||
@extend %neutral;
|
||||
}
|
||||
|
||||
.button-header {
|
||||
@extend %bare-btn;
|
||||
@extend %header;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
@extend %btn;
|
||||
@extend %primary;
|
||||
|
|
@ -76,8 +86,14 @@ ul.headerButtonList {
|
|||
}
|
||||
}
|
||||
|
||||
button.shutdown {
|
||||
margin-top: 6px;
|
||||
padding: 3px 14px;
|
||||
}
|
||||
|
||||
a.headerButton {
|
||||
@extend %clickable;
|
||||
@extend %header;
|
||||
float: left;
|
||||
margin-top: 2px;
|
||||
margin-left: 5px;
|
||||
|
|
@ -85,17 +101,9 @@ a.headerButton {
|
|||
position: relative;
|
||||
@include border-radius(3px);
|
||||
@include box-shadow(none);
|
||||
background-color: $c_header_btn_bg;
|
||||
color: $c_header_btn_fg;
|
||||
height: 17px;
|
||||
width: 9px;
|
||||
padding: 4px 9px 2px 9px;
|
||||
border: 1px solid $c_header_btn_border;
|
||||
|
||||
&:hover {
|
||||
background-color: $c_white;
|
||||
color: $c_black;
|
||||
}
|
||||
|
||||
.icon_arangodb_filter {
|
||||
top: 3px !important;
|
||||
|
|
@ -357,4 +365,4 @@ button.btn-server {
|
|||
}
|
||||
}
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
%clusterStateIcon {
|
||||
width: 90px;
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
|
|
@ -15,30 +15,42 @@
|
|||
}
|
||||
|
||||
&.success {
|
||||
@extend %positive
|
||||
@extend %icon-positive;
|
||||
@extend %svg-positive;
|
||||
}
|
||||
|
||||
&.danger {
|
||||
@extend %negative
|
||||
@extend %icon-negative;
|
||||
@extend %svg-negative;
|
||||
}
|
||||
|
||||
&.warning {
|
||||
@extend %warning
|
||||
@extend %icon-warning;
|
||||
@extend %svg-warning;
|
||||
}
|
||||
|
||||
&.inactive {
|
||||
@extend %inactive
|
||||
@extend %icon-inactive;
|
||||
@extend %svg-inactive;
|
||||
}
|
||||
}
|
||||
|
||||
div.coordinator {
|
||||
a.coordinator {
|
||||
@extend %clusterStateIcon;
|
||||
left: 15px;
|
||||
|
||||
|
||||
&.single {
|
||||
left: 90px;
|
||||
}
|
||||
&.double {
|
||||
left: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
div.dbserver {
|
||||
a.dbserver {
|
||||
@extend %clusterStateIcon;
|
||||
right: 15px;
|
||||
&.single {
|
||||
right: 90px;
|
||||
}
|
||||
&.double {
|
||||
right: 60px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ $c_bar_bg: #686766;
|
|||
|
||||
$c_grey: #E5E5E5;
|
||||
$c_dark_grey: #999999;
|
||||
$c_darker_grey: #666666;
|
||||
|
||||
$c_transp: transparent;
|
||||
$c_low_transp: rgba(0, 0, 0, 0.7);
|
||||
|
|
@ -51,4 +52,4 @@ $c_navBarSpacerShadow : #C8C8C8;
|
|||
|
||||
$c_btn_inverse : #736B68;
|
||||
|
||||
$c_notification_red : #FF0000;
|
||||
$c_notification_red: #CC0000;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,13 @@
|
|||
.contentDiv {
|
||||
//background-color: white;
|
||||
.dashboardModal {
|
||||
$width: 90%;
|
||||
@extend %pull-left;
|
||||
min-width: 780px;
|
||||
width: $width;
|
||||
margin-left: -$width/2;
|
||||
overflow: auto;
|
||||
height: 80%;
|
||||
top: 10%;
|
||||
@include border-radius(8px !important); //.modal has it
|
||||
padding: 10px;
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,11 +12,10 @@
|
|||
|
||||
.innerDashboardChart {
|
||||
position: absolute;
|
||||
top : 10px;
|
||||
left : 10px;
|
||||
right : 10px;
|
||||
bottom : 10px;
|
||||
|
||||
top : 5px;
|
||||
left : 5px;
|
||||
right : 5px;
|
||||
bottom : 5px;
|
||||
}
|
||||
|
||||
#distributionChartDiv {
|
||||
|
|
@ -30,9 +29,46 @@
|
|||
background-color: $c_white;
|
||||
position: relative;
|
||||
width: 31%;
|
||||
height: 270px;
|
||||
border: 1px solid $c_black;
|
||||
height: 210px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
float: left;
|
||||
margin : 1%;
|
||||
// padding : 10px;
|
||||
margin: 1.05%;
|
||||
// padding: 0px;
|
||||
}
|
||||
|
||||
.dygraph-label.dygraph-title {
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
text-align: left;
|
||||
// font-variant: small-caps;
|
||||
color: $c_black;
|
||||
}
|
||||
|
||||
.dygraph-axis-label.dygraph-axis-label-x {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
color: $c_darker_grey;
|
||||
}
|
||||
|
||||
.dygraph-axis-label.dygraph-axis-label-y {
|
||||
// width: 35px;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
color: $c_darker_grey;
|
||||
}
|
||||
|
||||
.dygraph-legend {
|
||||
background-color: #fafafa !important;
|
||||
text-align: right !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: 400 !important;
|
||||
font-family: 'Open Sans', sans-serif !important;
|
||||
color: $c_darker_grey !important;
|
||||
}
|
||||
|
||||
#dashboardDetailedLineChart {
|
||||
padding-top: 10px
|
||||
;}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
.navlogo .stat_cpu {
|
||||
margin-top: 1px;
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.navlogo .stat_ram {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.navlogo .stat_req {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
.navlogo .stat_cpu path {
|
||||
fill: #770000;
|
||||
}
|
||||
|
||||
.navlogo .stat_ram path {
|
||||
fill: #007700;
|
||||
}
|
||||
|
||||
.navlogo .stat_req path {
|
||||
fill: #aaaa00;
|
||||
}
|
||||
|
||||
.statisticbar {
|
||||
display: none;
|
||||
}
|
||||
|
|
@ -29,6 +29,16 @@ li.tile {
|
|||
margin-top: -5px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
&.icon {
|
||||
font-size: 50px;
|
||||
}
|
||||
}
|
||||
svg {
|
||||
@extend %clickable;
|
||||
&.icon {
|
||||
height: 50px;
|
||||
width: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ ul.tileList:after, div.resizecontainer:after, .machineClass:after, .scenarioSing
|
|||
height: 0px;
|
||||
visibility: hidden; }
|
||||
|
||||
.addButton, .deleteButton, a.headerButton, div.toolbox > div.gv_action_button, li.tile div.iconSet span, li.bigtile div.iconSet span, .contentDiv .icon, div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox + label.css-label, .scenarioImage {
|
||||
.addButton, .deleteButton, a.headerButton, div.toolbox > div.gv_action_button, li.tile a svg, li.bigtile a svg, li.tile div.iconSet span, li.bigtile div.iconSet span, .contentDiv .icon, div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox + label.css-label, .scenarioImage {
|
||||
cursor: pointer; }
|
||||
|
||||
nav.navbar, footer.footer {
|
||||
|
|
@ -29,31 +29,51 @@ nav.navbar, footer.footer {
|
|||
color: white;
|
||||
z-index: 1000; }
|
||||
|
||||
.button-danger, div.danger.coordinator, div.danger.dbserver {
|
||||
.button-danger {
|
||||
background-color: #da4f49; }
|
||||
.button-danger:hover, div.danger.coordinator:hover, div.danger.dbserver:hover {
|
||||
.button-danger:hover {
|
||||
background-color: #be342e; }
|
||||
|
||||
.deleteButton {
|
||||
.deleteButton, a.danger.coordinator, a.danger.dbserver {
|
||||
color: #da4f49; }
|
||||
.deleteButton:hover {
|
||||
.deleteButton:hover, a.danger.coordinator:hover, a.danger.dbserver:hover {
|
||||
color: #be342e; }
|
||||
|
||||
.button-success, div.success.coordinator, div.success.dbserver {
|
||||
a.danger.coordinator, a.danger.dbserver {
|
||||
fill: #da4f49; }
|
||||
a.danger.coordinator:hover, a.danger.dbserver:hover {
|
||||
fill: #be342e; }
|
||||
|
||||
.button-success {
|
||||
background-color: #8aa051; }
|
||||
.button-success:hover, div.success.coordinator:hover, div.success.dbserver:hover {
|
||||
.button-success:hover {
|
||||
background-color: #788f3d; }
|
||||
|
||||
.addButton {
|
||||
.addButton, a.success.coordinator, a.success.dbserver {
|
||||
color: #8aa051; }
|
||||
.addButton:hover {
|
||||
.addButton:hover, a.success.coordinator:hover, a.success.dbserver:hover {
|
||||
color: #788f3d; }
|
||||
|
||||
.button-warning, div.warning.coordinator, div.warning.dbserver {
|
||||
a.success.coordinator, a.success.dbserver {
|
||||
fill: #8aa051; }
|
||||
a.success.coordinator:hover, a.success.dbserver:hover {
|
||||
fill: #788f3d; }
|
||||
|
||||
.button-warning {
|
||||
background-color: #faa732; }
|
||||
.button-warning:hover, div.warning.coordinator:hover, div.warning.dbserver:hover {
|
||||
.button-warning:hover {
|
||||
background-color: #f89406; }
|
||||
|
||||
a.warning.coordinator, a.warning.dbserver {
|
||||
color: #faa732; }
|
||||
a.warning.coordinator:hover, a.warning.dbserver:hover {
|
||||
color: #f89406; }
|
||||
|
||||
a.warning.coordinator, a.warning.dbserver {
|
||||
fill: #faa732; }
|
||||
a.warning.coordinator:hover, a.warning.dbserver:hover {
|
||||
fill: #f89406; }
|
||||
|
||||
.button-neutral {
|
||||
background-color: #8f8d8c; }
|
||||
.button-neutral:hover {
|
||||
|
|
@ -64,16 +84,34 @@ nav.navbar, footer.footer {
|
|||
.button-primary:hover {
|
||||
background-color: #3a322e; }
|
||||
|
||||
.button-header, a.headerButton {
|
||||
background-color: #dddddd;
|
||||
color: #555555;
|
||||
border: 1px solid #222222; }
|
||||
.button-header:hover, a.headerButton:hover {
|
||||
background-color: white;
|
||||
color: black; }
|
||||
|
||||
.button-notification {
|
||||
background-color: #faa020; }
|
||||
.button-notification:hover {
|
||||
background-color: #f87c0f; }
|
||||
|
||||
.button-inactive, div.inactive.coordinator, div.inactive.dbserver {
|
||||
.button-inactive {
|
||||
background-color: lightgrey; }
|
||||
.button-inactive:hover, div.inactive.coordinator:hover, div.inactive.dbserver:hover {
|
||||
.button-inactive:hover {
|
||||
background-color: grey; }
|
||||
|
||||
a.inactive.coordinator, a.inactive.dbserver {
|
||||
color: lightgrey; }
|
||||
a.inactive.coordinator:hover, a.inactive.dbserver:hover {
|
||||
color: grey; }
|
||||
|
||||
a.inactive.coordinator, a.inactive.dbserver {
|
||||
fill: lightgrey; }
|
||||
a.inactive.coordinator:hover, a.inactive.dbserver:hover {
|
||||
fill: grey; }
|
||||
|
||||
ul.link-dropdown-menu, ul.user-dropdown-menu, ul.gv-dropdown-menu {
|
||||
position: absolute;
|
||||
top: 80%;
|
||||
|
|
@ -81,25 +119,25 @@ ul.link-dropdown-menu, ul.user-dropdown-menu, ul.gv-dropdown-menu {
|
|||
z-index: 1000;
|
||||
display: none;
|
||||
padding: 5px 0px;
|
||||
margin: 2px 0px 0px;
|
||||
margin: 5px 0px 0px;
|
||||
list-style: none;
|
||||
background-color: white;
|
||||
border-style: solid;
|
||||
border-color: rgba(0, 0, 0, 0.2);
|
||||
border-width: 1px;
|
||||
-moz-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px; }
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px; }
|
||||
ul.link-dropdown-menu li, ul.user-dropdown-menu li, ul.gv-dropdown-menu li {
|
||||
line-height: 20px;
|
||||
white-space: nowrap;
|
||||
width: 100%; }
|
||||
ul.link-dropdown-menu li.dropdown-header, ul.user-dropdown-menu li.dropdown-header, ul.gv-dropdown-menu li.dropdown-header {
|
||||
font-weight: bold;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
color: #999999;
|
||||
padding: 0px 20px;
|
||||
text-transform: uppercase; }
|
||||
font-variant: small-caps; }
|
||||
ul.link-dropdown-menu li.divider, ul.user-dropdown-menu li.divider, ul.gv-dropdown-menu li.divider {
|
||||
background-color: #e5e5e5;
|
||||
height: 1px;
|
||||
|
|
@ -227,19 +265,24 @@ footer.footer {
|
|||
padding-bottom: 10px;
|
||||
margin-bottom: 0; }
|
||||
|
||||
.button-neutral, .button-primary, .button-notification, .button-success, .button-danger, .button-warning, .button-inactive {
|
||||
.button-neutral, .button-primary, .button-notification, .button-success, .button-danger, .button-warning, .button-inactive, .button-header {
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0;
|
||||
-moz-box-shadow: 0;
|
||||
box-shadow: 0;
|
||||
font-weight: 300 !important;
|
||||
font-size: 14px; }
|
||||
|
||||
.button-neutral, .button-primary, .button-notification, .button-success, .button-danger, .button-warning, .button-inactive {
|
||||
border: none;
|
||||
color: white;
|
||||
margin-left: 10px;
|
||||
padding: 5px 16px;
|
||||
font-weight: 300 !important;
|
||||
font-size: 14px; }
|
||||
padding: 5px 16px; }
|
||||
|
||||
.button-header {
|
||||
margin-top: 5px; }
|
||||
|
||||
.button-notification {
|
||||
margin-right: 5px; }
|
||||
|
|
@ -266,6 +309,10 @@ ul.headerButtonList {
|
|||
display: inline;
|
||||
margin-right: 2px; }
|
||||
|
||||
button.shutdown, .clusterDownBtn button.shutdown.green {
|
||||
margin-top: 6px;
|
||||
padding: 3px 14px; }
|
||||
|
||||
a.headerButton {
|
||||
float: left;
|
||||
margin-top: 2px;
|
||||
|
|
@ -278,15 +325,9 @@ a.headerButton {
|
|||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background-color: #dddddd;
|
||||
color: #555555;
|
||||
height: 17px;
|
||||
width: 9px;
|
||||
padding: 4px 9px 2px 9px;
|
||||
border: 1px solid #222222; }
|
||||
a.headerButton:hover {
|
||||
background-color: white;
|
||||
color: black; }
|
||||
padding: 4px 9px 2px 9px; }
|
||||
a.headerButton .icon_arangodb_filter {
|
||||
top: 3px !important; }
|
||||
a.headerButton .icon_arangodb_import {
|
||||
|
|
@ -327,7 +368,7 @@ h6.gv_icon_icon {
|
|||
h6.gv_button_title {
|
||||
bottom: 1px; }
|
||||
|
||||
button.graphViewer-icon-button {
|
||||
button.graphViewer-icon-button, .clusterDownBtn button.graphViewer-icon-button.green {
|
||||
border: medium none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
|
|
@ -336,24 +377,24 @@ button.graphViewer-icon-button {
|
|||
padding: 0px;
|
||||
background-color: transparent; }
|
||||
|
||||
button.graphViewer-icon-button > img {
|
||||
button.graphViewer-icon-button > img, .clusterDownBtn button.graphViewer-icon-button.green > img {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding-bottom: 10px; }
|
||||
|
||||
button.gv_dropdown_entry {
|
||||
button.gv_dropdown_entry, .clusterDownBtn button.gv_dropdown_entry.green {
|
||||
width: 160px;
|
||||
height: 30px;
|
||||
margin: 4px 4px 4px 30px; }
|
||||
|
||||
button.gv_context_button {
|
||||
button.gv_context_button, .clusterDownBtn button.gv_context_button.green {
|
||||
width: 65px; }
|
||||
|
||||
.btn-icon {
|
||||
padding: 4px 4px;
|
||||
background-color: #383434; }
|
||||
|
||||
button.gv-icon-small {
|
||||
button.gv-icon-small, .clusterDownBtn button.gv-icon-small.green {
|
||||
background-size: 16px 16px;
|
||||
width: 16px;
|
||||
height: 16px; }
|
||||
|
|
@ -364,7 +405,7 @@ button.gv-icon-small.delete {
|
|||
button.gv-icon-small.add {
|
||||
background-image: url("../img/plus_icon.png"); }
|
||||
|
||||
button.gv-icon-btn {
|
||||
button.gv-icon-btn, .clusterDownBtn button.gv-icon-btn.green {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
background-size: 36px 36px;
|
||||
|
|
@ -378,7 +419,7 @@ button.gv-icon-btn.active {
|
|||
button.btn-zoom:hover {
|
||||
background: inherit; }
|
||||
|
||||
button.btn-zoom {
|
||||
button.btn-zoom, .clusterDownBtn button.btn-zoom.green {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
padding: 0px;
|
||||
|
|
@ -386,23 +427,23 @@ button.btn-zoom {
|
|||
position: absolute;
|
||||
background: none; }
|
||||
|
||||
button.btn-zoom-top {
|
||||
button.btn-zoom-top, .clusterDownBtn button.btn-zoom-top.green {
|
||||
left: 13px;
|
||||
top: 0px; }
|
||||
|
||||
button.btn-zoom-left {
|
||||
button.btn-zoom-left, .clusterDownBtn button.btn-zoom-left.green {
|
||||
left: 0px;
|
||||
top: 12px; }
|
||||
|
||||
button.btn-zoom-bottom {
|
||||
button.btn-zoom-bottom, .clusterDownBtn button.btn-zoom-bottom.green {
|
||||
left: 13px;
|
||||
top: 24px; }
|
||||
|
||||
button.btn-zoom-right {
|
||||
button.btn-zoom-right, .clusterDownBtn button.btn-zoom-right.green {
|
||||
right: 0px;
|
||||
top: 12px; }
|
||||
|
||||
button.gv-zoom-btn {
|
||||
button.gv-zoom-btn, .clusterDownBtn button.gv-zoom-btn.green {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background-size: 14px 14px;
|
||||
|
|
@ -440,7 +481,7 @@ ul.arangoPagination a {
|
|||
.modal-body th.actionCell > button {
|
||||
margin-top: -12px; }
|
||||
|
||||
button {
|
||||
button, .clusterDownBtn button.green {
|
||||
font-family: 'Open Sans', sans-serif !important; }
|
||||
|
||||
.btn-old-padding {
|
||||
|
|
@ -451,12 +492,42 @@ button {
|
|||
background-color: #736b68; }
|
||||
|
||||
/* Cluster View */
|
||||
button.btn-overview, button.btn-server {
|
||||
button.btn-overview, .clusterDownBtn button.btn-overview.green, button.btn-server, .clusterDownBtn button.btn-server.green {
|
||||
margin: 5px; }
|
||||
|
||||
button.btn-server {
|
||||
button.btn-server, .clusterDownBtn button.btn-server.green {
|
||||
width: 120px; }
|
||||
|
||||
.clusterDownBtn {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
text-align: center; }
|
||||
.clusterDownBtn button, .clusterDownBtn button.green {
|
||||
background-color: #f1f1f1;
|
||||
color: #333333;
|
||||
padding: 12px 18px;
|
||||
margin: 0px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.1875);
|
||||
border-radius: 3px;
|
||||
text-decoration: none !important;
|
||||
font-size: 20px;
|
||||
font-weight: 300;
|
||||
width: 250px;
|
||||
text-align: center;
|
||||
cursor: auto; }
|
||||
.clusterDownBtn button:hover {
|
||||
color: #4a6c30;
|
||||
background-color: #e8e8e8;
|
||||
-webkit-transition-delay: 0s;
|
||||
-webkit-transition-duration: 0.2s;
|
||||
-webkit-transition-property: all;
|
||||
-webkit-transition-timing-function: ease-in; }
|
||||
.clusterDownBtn button.green {
|
||||
color: white;
|
||||
background-color: #617e2b; }
|
||||
.clusterDownBtn button.green:hover {
|
||||
background-color: #8ba142; }
|
||||
|
||||
ul.tileList {
|
||||
margin-left: -6px;
|
||||
margin-right: -6px; }
|
||||
|
|
@ -480,6 +551,11 @@ li.tile, li.bigtile {
|
|||
font-size: 22px;
|
||||
margin-top: -5px;
|
||||
margin-right: 10px; }
|
||||
li.tile a span.icon, li.bigtile a span.icon {
|
||||
font-size: 50px; }
|
||||
li.tile a svg.icon, li.bigtile a svg.icon {
|
||||
height: 50px;
|
||||
width: 50px; }
|
||||
li.tile h5, li.bigtile h5 {
|
||||
font-size: 12px;
|
||||
white-space: nowrap !important;
|
||||
|
|
@ -805,13 +881,13 @@ svg.clusterChart {
|
|||
.lineGraph .many .dygraph-legend > span.highlight {
|
||||
display: inline; }
|
||||
|
||||
div.coordinator, div.dbserver {
|
||||
width: 90px;
|
||||
a.coordinator, a.dbserver {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
color: black; }
|
||||
div.coordinator h6.serverName, div.dbserver h6.serverName {
|
||||
a.coordinator h6.serverName, a.dbserver h6.serverName {
|
||||
margin: 0px;
|
||||
font-size: 11px;
|
||||
position: absolute;
|
||||
|
|
@ -819,11 +895,15 @@ div.coordinator, div.dbserver {
|
|||
left: 0px;
|
||||
right: 0px; }
|
||||
|
||||
div.coordinator {
|
||||
left: 15px; }
|
||||
a.coordinator.single {
|
||||
left: 90px; }
|
||||
a.coordinator.double {
|
||||
left: 60px; }
|
||||
|
||||
div.dbserver {
|
||||
right: 15px; }
|
||||
a.dbserver.single {
|
||||
right: 90px; }
|
||||
a.dbserver.double {
|
||||
right: 60px; }
|
||||
|
||||
.machineClass {
|
||||
padding: 10px;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ body, input, textarea, .page-title span, .pingback a.url {
|
|||
font-family: 'Open Sans', sans-serif !important;
|
||||
font-weight: 400; }
|
||||
|
||||
ul.link-dropdown-menu, ul.user-dropdown-menu, ul.gv-dropdown-menu, div.navlogo, ul.navlist li, div.footer-left, li.tile, li.bigtile, li.tile a span.add-Icon, li.bigtile a span.add-Icon {
|
||||
ul.link-dropdown-menu, ul.user-dropdown-menu, ul.gv-dropdown-menu, div.navlogo, ul.navlist li, div.footer-left, li.tile, li.bigtile, li.tile a span.add-Icon, li.bigtile a span.add-Icon, .dashboardModal {
|
||||
float: left; }
|
||||
|
||||
div.navmenu, div.footer-right, li.tile div.iconSet span, li.bigtile div.iconSet span {
|
||||
|
|
@ -17,7 +17,7 @@ ul.tileList:after, div.resizecontainer:after, #distributionChartDiv:after, .line
|
|||
height: 0px;
|
||||
visibility: hidden; }
|
||||
|
||||
.addButton, .deleteButton, a.headerButton, div.toolbox > div.gv_action_button, li.tile div.iconSet span, li.bigtile div.iconSet span, .contentDiv .icon, div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox + label.css-label, .contentTables tr.contentRowInactive a {
|
||||
.addButton, .deleteButton, a.headerButton, div.toolbox > div.gv_action_button, li.tile a svg, li.bigtile a svg, li.tile div.iconSet span, li.bigtile div.iconSet span, .contentDiv .icon, div.headerDropdown.headerDropdown input[type=checkbox].css-checkbox + label.css-label, .contentTables tr.contentRowInactive a {
|
||||
cursor: pointer; }
|
||||
|
||||
nav.navbar, footer.footer {
|
||||
|
|
@ -64,6 +64,14 @@ nav.navbar, footer.footer {
|
|||
.button-primary:hover {
|
||||
background-color: #3a322e; }
|
||||
|
||||
.button-header, a.headerButton {
|
||||
background-color: #dddddd;
|
||||
color: #555555;
|
||||
border: 1px solid #222222; }
|
||||
.button-header:hover, a.headerButton:hover {
|
||||
background-color: white;
|
||||
color: black; }
|
||||
|
||||
.button-notification {
|
||||
background-color: #faa020; }
|
||||
.button-notification:hover {
|
||||
|
|
@ -95,11 +103,11 @@ ul.link-dropdown-menu, ul.user-dropdown-menu, ul.gv-dropdown-menu {
|
|||
white-space: nowrap;
|
||||
width: 100%; }
|
||||
ul.link-dropdown-menu li.dropdown-header, ul.user-dropdown-menu li.dropdown-header, ul.gv-dropdown-menu li.dropdown-header {
|
||||
font-weight: 400;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
color: #999999;
|
||||
padding: 0px 20px;
|
||||
text-transform: uppercase; }
|
||||
font-variant: small-caps; }
|
||||
ul.link-dropdown-menu li.divider, ul.user-dropdown-menu li.divider, ul.gv-dropdown-menu li.divider {
|
||||
background-color: #e5e5e5;
|
||||
height: 1px;
|
||||
|
|
@ -227,19 +235,24 @@ footer.footer {
|
|||
padding-bottom: 10px;
|
||||
margin-bottom: 0; }
|
||||
|
||||
.button-neutral, .button-primary, .button-notification, .button-success, .button-danger, .button-warning, .button-inactive {
|
||||
.button-neutral, .button-primary, .button-notification, .button-success, .button-danger, .button-warning, .button-inactive, .button-header {
|
||||
-moz-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: 0;
|
||||
-moz-box-shadow: 0;
|
||||
box-shadow: 0;
|
||||
font-weight: 300 !important;
|
||||
font-size: 14px; }
|
||||
|
||||
.button-neutral, .button-primary, .button-notification, .button-success, .button-danger, .button-warning, .button-inactive {
|
||||
border: none;
|
||||
color: white;
|
||||
margin-left: 10px;
|
||||
padding: 5px 16px;
|
||||
font-weight: 300 !important;
|
||||
font-size: 14px; }
|
||||
padding: 5px 16px; }
|
||||
|
||||
.button-header {
|
||||
margin-top: 5px; }
|
||||
|
||||
.button-notification {
|
||||
margin-right: 5px; }
|
||||
|
|
@ -266,6 +279,10 @@ ul.headerButtonList {
|
|||
display: inline;
|
||||
margin-right: 2px; }
|
||||
|
||||
button.shutdown, .clusterDownBtn button.shutdown.green {
|
||||
margin-top: 6px;
|
||||
padding: 3px 14px; }
|
||||
|
||||
a.headerButton {
|
||||
float: left;
|
||||
margin-top: 2px;
|
||||
|
|
@ -278,15 +295,9 @@ a.headerButton {
|
|||
-webkit-box-shadow: none;
|
||||
-moz-box-shadow: none;
|
||||
box-shadow: none;
|
||||
background-color: #dddddd;
|
||||
color: #555555;
|
||||
height: 17px;
|
||||
width: 9px;
|
||||
padding: 4px 9px 2px 9px;
|
||||
border: 1px solid #222222; }
|
||||
a.headerButton:hover {
|
||||
background-color: white;
|
||||
color: black; }
|
||||
padding: 4px 9px 2px 9px; }
|
||||
a.headerButton .icon_arangodb_filter {
|
||||
top: 3px !important; }
|
||||
a.headerButton .icon_arangodb_import {
|
||||
|
|
@ -510,6 +521,11 @@ li.tile, li.bigtile {
|
|||
font-size: 22px;
|
||||
margin-top: -5px;
|
||||
margin-right: 10px; }
|
||||
li.tile a span.icon, li.bigtile a span.icon {
|
||||
font-size: 50px; }
|
||||
li.tile a svg.icon, li.bigtile a svg.icon {
|
||||
height: 50px;
|
||||
width: 50px; }
|
||||
li.tile h5, li.bigtile h5 {
|
||||
font-size: 12px;
|
||||
white-space: nowrap !important;
|
||||
|
|
@ -820,6 +836,31 @@ select.filterSelect {
|
|||
margin-top: 1px;
|
||||
margin-left: 10px !important; }
|
||||
|
||||
.navlogo .stat_cpu {
|
||||
margin-top: 1px;
|
||||
width: 26px;
|
||||
height: 26px; }
|
||||
|
||||
.navlogo .stat_ram {
|
||||
width: 26px;
|
||||
height: 26px; }
|
||||
|
||||
.navlogo .stat_req {
|
||||
width: 22px;
|
||||
height: 22px; }
|
||||
|
||||
.navlogo .stat_cpu path {
|
||||
fill: #770000; }
|
||||
|
||||
.navlogo .stat_ram path {
|
||||
fill: #007700; }
|
||||
|
||||
.navlogo .stat_req path {
|
||||
fill: #aaaa00; }
|
||||
|
||||
.statisticbar {
|
||||
display: none; }
|
||||
|
||||
.fixedDropdown {
|
||||
margin: 37px 0 0 0 !important;
|
||||
border-radius: 0 !important;
|
||||
|
|
@ -886,7 +927,8 @@ select.filterSelect {
|
|||
margin-top: 2px;
|
||||
background-color: #333232;
|
||||
border-radius: 3px;
|
||||
border: 2px solid #8AA051; }
|
||||
border: 2px solid #8AA051;
|
||||
text-align: center; }
|
||||
|
||||
.notificationItemContent {
|
||||
font-weight: 300; }
|
||||
|
|
@ -895,12 +937,12 @@ select.filterSelect {
|
|||
cursor: pointer; }
|
||||
|
||||
.fullNotification {
|
||||
border: 2px solid red !important;
|
||||
background-color: red !important; }
|
||||
border: 2px solid #cc0000 !important;
|
||||
background-color: #cc0000 !important; }
|
||||
|
||||
#stat_hd #stat_hd_counter {
|
||||
color: white;
|
||||
margin-left: 8px;
|
||||
margin-left: 0px;
|
||||
line-height: 24px; }
|
||||
|
||||
.contentButtons {
|
||||
|
|
@ -969,6 +1011,19 @@ select.filterSelect {
|
|||
float: left;
|
||||
margin-right: 3px; }
|
||||
|
||||
.dashboardModal {
|
||||
min-width: 780px;
|
||||
width: 90%;
|
||||
margin-left: -45%;
|
||||
overflow: auto;
|
||||
height: 80%;
|
||||
top: 10%;
|
||||
-moz-border-radius: 8px !important;
|
||||
-webkit-border-radius: 8px !important;
|
||||
border-radius: 8px !important;
|
||||
padding: 10px;
|
||||
padding-top: 0px; }
|
||||
|
||||
#dashboardHttpGroup {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
|
@ -981,19 +1036,49 @@ select.filterSelect {
|
|||
|
||||
.innerDashboardChart {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
right: 10px;
|
||||
bottom: 10px; }
|
||||
top: 5px;
|
||||
left: 5px;
|
||||
right: 5px;
|
||||
bottom: 5px; }
|
||||
|
||||
.dashboardChart {
|
||||
background-color: white;
|
||||
position: relative;
|
||||
width: 31%;
|
||||
height: 270px;
|
||||
border: 1px solid black;
|
||||
height: 210px;
|
||||
border: 1px solid rgba(0, 0, 0, 0.2);
|
||||
float: left;
|
||||
margin: 1%; }
|
||||
margin: 1.05%; }
|
||||
|
||||
.dygraph-label.dygraph-title {
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
text-align: left;
|
||||
color: black; }
|
||||
|
||||
.dygraph-axis-label.dygraph-axis-label-x {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
color: #666666; }
|
||||
|
||||
.dygraph-axis-label.dygraph-axis-label-y {
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
font-family: 'Open Sans', sans-serif;
|
||||
color: #666666; }
|
||||
|
||||
.dygraph-legend {
|
||||
background-color: #fafafa !important;
|
||||
text-align: right !important;
|
||||
font-size: 12px !important;
|
||||
font-weight: 400 !important;
|
||||
font-family: 'Open Sans', sans-serif !important;
|
||||
color: #666666 !important; }
|
||||
|
||||
#dashboardDetailedLineChart {
|
||||
padding-top: 10px; }
|
||||
|
||||
.dashboardDistribution {
|
||||
width: 270px;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
//shared
|
||||
@import "shared";
|
||||
// Navbar
|
||||
@import "statMenu";
|
||||
@import "statisticBar";
|
||||
// Notifications
|
||||
@import "notification";
|
||||
//contentTables
|
||||
|
|
|
|||
|
|
@ -96,7 +96,6 @@
|
|||
"frontend/js/lib/nv.d3.js",
|
||||
"frontend/js/lib/strftime-min.js",
|
||||
"frontend/js/lib/dygraph-combined.js",
|
||||
"frontend/js/lib/nv.d3.js",
|
||||
"frontend/js/lib/d3.fisheye.js",
|
||||
"frontend/js/lib/ColVis.js",
|
||||
"frontend/js/lib/bootstrap-pagination.js",
|
||||
|
|
|
|||
|
|
@ -701,6 +701,7 @@ exports.Communication = function() {
|
|||
return res.sort();
|
||||
};
|
||||
this.noBeat = function() {
|
||||
// Do not use, will only work in highly synced clocks
|
||||
var lastAccepted = new Date((new Date()).getTime() - (2 * interval));
|
||||
var res = [];
|
||||
var list = this.list();
|
||||
|
|
@ -711,6 +712,9 @@ exports.Communication = function() {
|
|||
});
|
||||
return res.sort();
|
||||
};
|
||||
this.didBeat = function() {
|
||||
return _.keys(this.list());
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
(function(args) {
|
||||
delete UPGRADE_ARGS;
|
||||
|
||||
var internal = require("internal");
|
||||
var fs = require("fs");
|
||||
var console = require("console");
|
||||
|
|
@ -708,7 +710,6 @@
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
var lastVersion = null;
|
||||
var currentServerVersion = internal.db._version().match(/^(\d+\.\d+).*$/);
|
||||
|
||||
|
|
@ -777,9 +778,17 @@
|
|||
logger.error("Database directory version (" + lastVersion
|
||||
+ ") is lower than server version (" + currentVersion + ").");
|
||||
|
||||
logger.error("It seems like you have upgraded the ArangoDB binary. If this is"
|
||||
+" what you wanted to do, please restart with the --upgrade option"
|
||||
+" to upgrade the data in the database directory.");
|
||||
logger.error("----------------------------------------------------------------------");
|
||||
logger.error("It seems like you have upgraded the ArangoDB binary.");
|
||||
logger.error("If this is what you wanted to do, please restart with the");
|
||||
logger.error(" --upgrade");
|
||||
logger.error("option to upgrade the data in the database directory.");
|
||||
|
||||
logger.error("Normally you can use the control script to upgrade your database")
|
||||
logger.error(" /etc/init.d/arangodb stop")
|
||||
logger.error(" /etc/init.d/arangodb upgrade")
|
||||
logger.error(" /etc/init.d/arangodb start")
|
||||
logger.error("----------------------------------------------------------------------");
|
||||
|
||||
// do not start unless started with --upgrade
|
||||
return false;
|
||||
|
|
@ -789,8 +798,6 @@
|
|||
return true;
|
||||
}(UPGRADE_ARGS));
|
||||
|
||||
delete UPGRADE_ARGS;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -162,6 +162,10 @@ HttpHandler::status_t RestVersionHandler::execute () {
|
|||
return status_t(HANDLER_DONE);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||
|
|
|
|||
|
|
@ -85,12 +85,12 @@ namespace triagens {
|
|||
// --SECTION-- private variables
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
private:
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief name of the queue
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private:
|
||||
|
||||
static const std::string QUEUE_NAME;
|
||||
|
||||
};
|
||||
|
|
@ -99,6 +99,10 @@ namespace triagens {
|
|||
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Local Variables:
|
||||
// mode: outline-minor
|
||||
// outline-regexp: "/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}"
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@
|
|||
|
||||
#define TRI_HAVE_POSIX 1
|
||||
|
||||
#define TRI_HAVE_MACOS_MEM_STATS 1
|
||||
#define TRI_HAVE_LINUX_SOCKETS 1
|
||||
#define TRI_HAVE_MACH 1
|
||||
#define TRI_HAVE_MACOS_SPIN 1
|
||||
|
|
@ -419,6 +420,7 @@
|
|||
|
||||
#define TRI_HAVE_POSIX 1
|
||||
|
||||
#define TRI_HAVE_SC_PHYS_PAGES 1
|
||||
#define TRI_HAVE_LINUX_PROC 1
|
||||
#define TRI_HAVE_LINUX_SOCKETS 1
|
||||
#define TRI_HAVE_POSIX_SPIN 1
|
||||
|
|
@ -545,6 +547,8 @@
|
|||
#define TRI_HAVE_STRTOI64 1
|
||||
#define TRI_HAVE_STRTOUI64 1
|
||||
|
||||
#define TRI_HAVE_WIN32_GLOBAL_MEMORY_STATUS 1
|
||||
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
#define snprintf _snprintf
|
||||
|
|
|
|||
|
|
@ -685,6 +685,14 @@ void HttpRequest::setUser (string const& user) {
|
|||
_user = user;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief sets the path of the request
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HttpRequest::setRequestPath (char const* path) {
|
||||
_requestPath = path;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- private methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
@ -898,7 +906,9 @@ void HttpRequest::parseHeader (char* ptr, size_t length) {
|
|||
if (pathEnd - pathBegin >= 5) {
|
||||
char* q = pathBegin;
|
||||
|
||||
// check if the prefix is "_db"
|
||||
if (q[0] == '/' && q[1] == '_' && q[2] == 'd' && q[3] == 'b' && q[4] == '/') {
|
||||
|
||||
// request contains database name
|
||||
q += 5;
|
||||
pathBegin = q;
|
||||
|
|
@ -1097,14 +1107,6 @@ void HttpRequest::setFullUrl (char const* begin, char const* end) {
|
|||
_fullUrl = string(begin, end - begin);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief sets the path of the request
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void HttpRequest::setRequestPath (char const* path) {
|
||||
_requestPath = path;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief sets the header values
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -236,6 +236,15 @@ namespace triagens {
|
|||
|
||||
void setUser (std::string const&);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief sets the path of the request
|
||||
///
|
||||
/// @note The @FA{path} must exists as long as the instance is alive and it
|
||||
/// must be garbage collected by the caller.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void setRequestPath (char const* path);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public prefix/suffix methods
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
@ -522,15 +531,6 @@ namespace triagens {
|
|||
|
||||
void setFullUrl (char const* begin, char const* end);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief sets the path of the request
|
||||
///
|
||||
/// @note The @FA{path} must exists as long as the instance is alive and it
|
||||
/// must be garbage collected by the caller.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void setRequestPath (char const* path);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief sets a key/value pair
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
///
|
||||
/// DISCLAIMER
|
||||
///
|
||||
/// Copyright 2004-2013 triAGENS GmbH, Cologne, Germany
|
||||
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
/// you may not use this file except in compliance with the License.
|
||||
|
|
@ -22,13 +22,18 @@
|
|||
/// Copyright holder is triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// @author Dr. Frank Celler
|
||||
/// @author Copyright 2012-2013, triAGENS GmbH, Cologne, Germany
|
||||
/// @author Copyright 2012-2014, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "statistics.h"
|
||||
|
||||
#include "BasicsC/locks.h"
|
||||
|
||||
#ifdef TRI_HAVE_MACOS_MEM_STATS
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
using namespace triagens::basics;
|
||||
using namespace std;
|
||||
|
||||
|
|
@ -50,11 +55,6 @@ using namespace std;
|
|||
// --SECTION-- private request statistics variables
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief lock for lists
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -67,19 +67,10 @@ static STATISTICS_TYPE RequestListLock;
|
|||
|
||||
static TRI_statistics_list_t RequestFreeList;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public request statistics functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief gets a new statistics block
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -106,28 +97,29 @@ TRI_request_statistics_t* TRI_AcquireRequestStatistics () {
|
|||
void TRI_ReleaseRequestStatistics (TRI_request_statistics_t* statistics) {
|
||||
STATISTICS_LOCK(&RequestListLock);
|
||||
|
||||
TotalRequests.incCounter();
|
||||
TRI_TotalRequestsStatistics.incCounter();
|
||||
|
||||
if (statistics->_async) {
|
||||
AsyncRequests.incCounter();
|
||||
TRI_AsyncRequestsStatistics.incCounter();
|
||||
}
|
||||
|
||||
MethodRequests[(int) statistics->_requestType].incCounter();
|
||||
TRI_MethodRequestsStatistics[(int) statistics->_requestType].incCounter();
|
||||
|
||||
// check the request was completely received and transmitted
|
||||
if (statistics->_readStart != 0.0 && statistics->_writeEnd != 0.0) {
|
||||
double totalTime = statistics->_writeEnd - statistics->_readStart;
|
||||
TotalTimeDistribution->addFigure(totalTime);
|
||||
TRI_TotalTimeDistributionStatistics->addFigure(totalTime);
|
||||
|
||||
double requestTime = statistics->_requestEnd - statistics->_requestStart;
|
||||
RequestTimeDistribution->addFigure(requestTime);
|
||||
TRI_RequestTimeDistributionStatistics->addFigure(requestTime);
|
||||
|
||||
if (statistics->_queueStart != 0.0 && statistics->_queueEnd != 0.0) {
|
||||
double queueTime = statistics->_queueEnd - statistics->_queueStart;
|
||||
QueueTimeDistribution->addFigure(queueTime);
|
||||
TRI_QueueTimeDistributionStatistics->addFigure(queueTime);
|
||||
}
|
||||
|
||||
BytesSentDistribution->addFigure(statistics->_sentBytes);
|
||||
BytesReceivedDistribution->addFigure(statistics->_receivedBytes);
|
||||
TRI_BytesSentDistributionStatistics->addFigure(statistics->_sentBytes);
|
||||
TRI_BytesReceivedDistributionStatistics->addFigure(statistics->_receivedBytes);
|
||||
}
|
||||
|
||||
// clear statistics and put back an the free list
|
||||
|
|
@ -159,28 +151,19 @@ void TRI_FillRequestStatistics (StatisticsDistribution& totalTime,
|
|||
StatisticsDistribution& bytesReceived) {
|
||||
STATISTICS_LOCK(&RequestListLock);
|
||||
|
||||
totalTime = *TotalTimeDistribution;
|
||||
requestTime = *RequestTimeDistribution;
|
||||
queueTime = *QueueTimeDistribution;
|
||||
bytesSent = *BytesSentDistribution;
|
||||
bytesReceived = *BytesReceivedDistribution;
|
||||
totalTime = *TRI_TotalTimeDistributionStatistics;
|
||||
requestTime = *TRI_RequestTimeDistributionStatistics;
|
||||
queueTime = *TRI_QueueTimeDistributionStatistics;
|
||||
bytesSent = *TRI_BytesSentDistributionStatistics;
|
||||
bytesReceived = *TRI_BytesReceivedDistributionStatistics;
|
||||
|
||||
STATISTICS_UNLOCK(&RequestListLock);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- private connection statistics variables
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief lock for lists
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -193,19 +176,10 @@ static STATISTICS_TYPE ConnectionListLock;
|
|||
|
||||
static TRI_statistics_list_t ConnectionFreeList;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public connection statistics functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief gets a new statistics block
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -235,13 +209,13 @@ void TRI_ReleaseConnectionStatistics (TRI_connection_statistics_t* statistics) {
|
|||
if (statistics->_http) {
|
||||
if (statistics->_connStart != 0) {
|
||||
if (statistics->_connEnd == 0) {
|
||||
HttpConnections.incCounter();
|
||||
TRI_HttpConnectionsStatistics.incCounter();
|
||||
}
|
||||
else {
|
||||
HttpConnections.decCounter();
|
||||
TRI_HttpConnectionsStatistics.decCounter();
|
||||
|
||||
double totalTime = statistics->_connEnd - statistics->_connStart;
|
||||
ConnectionTimeDistribution->addFigure(totalTime);
|
||||
TRI_ConnectionTimeDistributionStatistics->addFigure(totalTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -274,28 +248,19 @@ void TRI_FillConnectionStatistics (StatisticsCounter& httpConnections,
|
|||
StatisticsDistribution& connectionTime) {
|
||||
STATISTICS_LOCK(&ConnectionListLock);
|
||||
|
||||
httpConnections = HttpConnections;
|
||||
totalRequests = TotalRequests;
|
||||
methodRequests = MethodRequests;
|
||||
asyncRequests = AsyncRequests;
|
||||
connectionTime = *ConnectionTimeDistribution;
|
||||
httpConnections = TRI_HttpConnectionsStatistics;
|
||||
totalRequests = TRI_TotalRequestsStatistics;
|
||||
methodRequests = TRI_MethodRequestsStatistics;
|
||||
asyncRequests = TRI_AsyncRequestsStatistics;
|
||||
connectionTime = *TRI_ConnectionTimeDistributionStatistics;
|
||||
|
||||
STATISTICS_UNLOCK(&ConnectionListLock);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public server statistics functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief gets the global server statistics
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -303,25 +268,16 @@ void TRI_FillConnectionStatistics (StatisticsCounter& httpConnections,
|
|||
TRI_server_statistics_t TRI_GetServerStatistics () {
|
||||
TRI_server_statistics_t server;
|
||||
|
||||
server._startTime = ServerStatistics._startTime;
|
||||
server._startTime = TRI_ServerStatistics._startTime;
|
||||
server._uptime = TRI_microtime() - server._startTime;
|
||||
|
||||
return server;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- private functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief fills a linked list
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -347,7 +303,7 @@ static void FillStatisticsList (TRI_statistics_list_t* list, size_t element, siz
|
|||
/// @brief destroys a linked list
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_DestroyStatisticsList (TRI_statistics_list_t* list) {
|
||||
static void DestroyStatisticsList (TRI_statistics_list_t* list) {
|
||||
TRI_statistics_entry_t* entry = list->_first;
|
||||
while (entry != NULL) {
|
||||
TRI_statistics_entry_t* next = entry->_next;
|
||||
|
|
@ -359,18 +315,60 @@ void TRI_DestroyStatisticsList (TRI_statistics_list_t* list) {
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
/// @brief gets the physical memory
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef TRI_HAVE_MACOS_MEM_STATS
|
||||
|
||||
static uint64_t GetPhysicalMemory () {
|
||||
int mib[2];
|
||||
int64_t physicalMemory;
|
||||
size_t length;
|
||||
|
||||
// Get the Physical memory size
|
||||
mib[0] = CTL_HW;
|
||||
mib[1] = HW_MEMSIZE;
|
||||
length = sizeof(int64_t);
|
||||
sysctl(mib, 2, &physicalMemory, &length, NULL, 0);
|
||||
|
||||
return (uint64_t) physicalMemory;
|
||||
}
|
||||
|
||||
#else
|
||||
#ifdef TRI_HAVE_SC_PHYS_PAGES
|
||||
|
||||
static uint64_t GetPhysicalMemory () {
|
||||
long pages = sysconf(_SC_PHYS_PAGES);
|
||||
long page_size = sysconf(_SC_PAGE_SIZE);
|
||||
|
||||
return (uint64_t)(pages * page_size);
|
||||
}
|
||||
|
||||
#else
|
||||
#ifdef TRI_HAVE_WIN32_GLOBAL_MEMORY_STATUS
|
||||
|
||||
static uint64_t GetPhysicalMemory () {
|
||||
MEMORYSTATUSEX status;
|
||||
status.dwLength = sizeof(status);
|
||||
GlobalMemoryStatusEx(&status);
|
||||
|
||||
return (uint64_t) status.ullTotalPhys;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static uint64_t TRI_GetPhysicalMemory () {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public variable
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief statistics enabled flags
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -381,105 +379,102 @@ bool TRI_ENABLE_STATISTICS = true;
|
|||
/// @brief number of http connections
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsCounter HttpConnections;
|
||||
StatisticsCounter TRI_HttpConnectionsStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief total number of requests
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsCounter TotalRequests;
|
||||
StatisticsCounter TRI_TotalRequestsStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief number of requests by HTTP method
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::vector<StatisticsCounter> MethodRequests;
|
||||
std::vector<StatisticsCounter> TRI_MethodRequestsStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief number of async requests
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsCounter AsyncRequests;
|
||||
StatisticsCounter TRI_AsyncRequestsStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief connection time distribution vector
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsVector ConnectionTimeDistributionVector;
|
||||
StatisticsVector TRI_ConnectionTimeDistributionVectorStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief total time distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsDistribution* ConnectionTimeDistribution;
|
||||
StatisticsDistribution* TRI_ConnectionTimeDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief request time distribution vector
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsVector RequestTimeDistributionVector;
|
||||
StatisticsVector TRI_RequestTimeDistributionVectorStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief total time distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsDistribution* TotalTimeDistribution;
|
||||
StatisticsDistribution* TRI_TotalTimeDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief request time distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsDistribution* RequestTimeDistribution;
|
||||
StatisticsDistribution* TRI_RequestTimeDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief queue time distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsDistribution* QueueTimeDistribution;
|
||||
StatisticsDistribution* TRI_QueueTimeDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief bytes sent distribution vector
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsVector BytesSentDistributionVector;
|
||||
StatisticsVector TRI_BytesSentDistributionVectorStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief bytes sent distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsDistribution* BytesSentDistribution;
|
||||
StatisticsDistribution* TRI_BytesSentDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief bytes received distribution vector
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsVector BytesReceivedDistributionVector;
|
||||
StatisticsVector TRI_BytesReceivedDistributionVectorStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief bytes received distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
StatisticsDistribution* BytesReceivedDistribution;
|
||||
StatisticsDistribution* TRI_BytesReceivedDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief global server statistics
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_server_statistics_t ServerStatistics;
|
||||
TRI_server_statistics_t TRI_ServerStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
/// @brief physical memeory
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
uint64_t TRI_PhysicalMemory;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief gets the current wallclock time
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -497,17 +492,22 @@ double TRI_StatisticsTime () {
|
|||
#else
|
||||
|
||||
double TRI_StatisticsTime () {
|
||||
return TRI_microtime();
|
||||
return TRI_microtime();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- module initialisation
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief module init function
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_InitialiseStatistics () {
|
||||
ServerStatistics._startTime = TRI_microtime();
|
||||
TRI_ServerStatistics._startTime = TRI_microtime();
|
||||
TRI_PhysicalMemory = GetPhysicalMemory();
|
||||
|
||||
#if TRI_ENABLE_FIGURES
|
||||
|
||||
|
|
@ -517,30 +517,30 @@ void TRI_InitialiseStatistics () {
|
|||
// sets up the statistics
|
||||
// .............................................................................
|
||||
|
||||
ConnectionTimeDistributionVector << (0.1) << (1.0) << (60.0);
|
||||
TRI_ConnectionTimeDistributionVectorStatistics << (0.1) << (1.0) << (60.0);
|
||||
|
||||
BytesSentDistributionVector << (250) << (1000) << (2 * 1000) << (5 * 1000) << (10 * 1000);
|
||||
BytesReceivedDistributionVector << (250) << (1000) << (2 * 1000) << (5 * 1000) << (10 * 1000);
|
||||
TRI_BytesSentDistributionVectorStatistics << (250) << (1000) << (2 * 1000) << (5 * 1000) << (10 * 1000);
|
||||
TRI_BytesReceivedDistributionVectorStatistics << (250) << (1000) << (2 * 1000) << (5 * 1000) << (10 * 1000);
|
||||
|
||||
#ifdef TRI_ENABLE_HIRES_FIGURES
|
||||
RequestTimeDistributionVector << (0.0001) << (0.05) << (0.1) << (0.2) << (0.5) << (1.0);
|
||||
TRI_RequestTimeDistributionVectorStatistics << (0.0001) << (0.05) << (0.1) << (0.2) << (0.5) << (1.0);
|
||||
#else
|
||||
RequestTimeDistributionVector << (0.01) << (0.05) << (0.1) << (0.2) << (0.5) << (1.0);
|
||||
TRI_RequestTimeDistributionVectorStatistics << (0.01) << (0.05) << (0.1) << (0.2) << (0.5) << (1.0);
|
||||
#endif
|
||||
|
||||
ConnectionTimeDistribution = new StatisticsDistribution(ConnectionTimeDistributionVector);
|
||||
TotalTimeDistribution = new StatisticsDistribution(RequestTimeDistributionVector);
|
||||
RequestTimeDistribution = new StatisticsDistribution(RequestTimeDistributionVector);
|
||||
QueueTimeDistribution = new StatisticsDistribution(RequestTimeDistributionVector);
|
||||
BytesSentDistribution = new StatisticsDistribution(BytesSentDistributionVector);
|
||||
BytesReceivedDistribution = new StatisticsDistribution(BytesReceivedDistributionVector);
|
||||
TRI_ConnectionTimeDistributionStatistics = new StatisticsDistribution(TRI_ConnectionTimeDistributionVectorStatistics);
|
||||
TRI_TotalTimeDistributionStatistics = new StatisticsDistribution(TRI_RequestTimeDistributionVectorStatistics);
|
||||
TRI_RequestTimeDistributionStatistics = new StatisticsDistribution(TRI_RequestTimeDistributionVectorStatistics);
|
||||
TRI_QueueTimeDistributionStatistics = new StatisticsDistribution(TRI_RequestTimeDistributionVectorStatistics);
|
||||
TRI_BytesSentDistributionStatistics = new StatisticsDistribution(TRI_BytesSentDistributionVectorStatistics);
|
||||
TRI_BytesReceivedDistributionStatistics = new StatisticsDistribution(TRI_BytesReceivedDistributionVectorStatistics);
|
||||
|
||||
// initialise counters for all HTTP request types
|
||||
MethodRequests.clear();
|
||||
TRI_MethodRequestsStatistics.clear();
|
||||
|
||||
for (int i = 0; i < ((int) triagens::rest::HttpRequest::HTTP_REQUEST_ILLEGAL) + 1; ++i) {
|
||||
StatisticsCounter c;
|
||||
MethodRequests.push_back(c);
|
||||
TRI_MethodRequestsStatistics.push_back(c);
|
||||
}
|
||||
|
||||
// .............................................................................
|
||||
|
|
@ -571,22 +571,18 @@ void TRI_InitialiseStatistics () {
|
|||
|
||||
void TRI_ShutdownStatistics (void) {
|
||||
#if TRI_ENABLE_FIGURES
|
||||
delete ConnectionTimeDistribution;
|
||||
delete TotalTimeDistribution;
|
||||
delete RequestTimeDistribution;
|
||||
delete QueueTimeDistribution;
|
||||
delete BytesSentDistribution;
|
||||
delete BytesReceivedDistribution;
|
||||
delete TRI_ConnectionTimeDistributionStatistics;
|
||||
delete TRI_TotalTimeDistributionStatistics;
|
||||
delete TRI_RequestTimeDistributionStatistics;
|
||||
delete TRI_QueueTimeDistributionStatistics;
|
||||
delete TRI_BytesSentDistributionStatistics;
|
||||
delete TRI_BytesReceivedDistributionStatistics;
|
||||
|
||||
TRI_DestroyStatisticsList(&RequestFreeList);
|
||||
TRI_DestroyStatisticsList(&ConnectionFreeList);
|
||||
DestroyStatisticsList(&RequestFreeList);
|
||||
DestroyStatisticsList(&ConnectionFreeList);
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- END-OF-FILE
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
///
|
||||
/// DISCLAIMER
|
||||
///
|
||||
/// Copyright 2004-2013 triAGENS GmbH, Cologne, Germany
|
||||
/// Copyright 2004-2014 triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
/// you may not use this file except in compliance with the License.
|
||||
|
|
@ -22,7 +22,7 @@
|
|||
/// Copyright holder is triAGENS GmbH, Cologne, Germany
|
||||
///
|
||||
/// @author Dr. Frank Celler
|
||||
/// @author Copyright 2012-2013, triAGENS GmbH, Cologne, Germany
|
||||
/// @author Copyright 2012-2014, triAGENS GmbH, Cologne, Germany
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef TRIAGENS_STATISTICS_STATISTICS_H
|
||||
|
|
@ -33,19 +33,10 @@
|
|||
#include "Rest/HttpRequest.h"
|
||||
#include "Statistics/figures.h"
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- forward declarations
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public types
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief statistics list entry
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -117,19 +108,10 @@ typedef struct TRI_server_statistics_s {
|
|||
}
|
||||
TRI_server_statistics_t;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public request statistics functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief gets a new statistics block
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -152,19 +134,10 @@ void TRI_FillRequestStatistics (triagens::basics::StatisticsDistribution& totalT
|
|||
triagens::basics::StatisticsDistribution& bytesSent,
|
||||
triagens::basics::StatisticsDistribution& bytesReceived);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public connection statistics functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief gets a new statistics block
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -187,38 +160,20 @@ void TRI_FillConnectionStatistics (triagens::basics::StatisticsCounter& httpConn
|
|||
triagens::basics::StatisticsCounter& asyncRequests,
|
||||
triagens::basics::StatisticsDistribution& connectionTime);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public server statistics functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief gets the server statistics
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_server_statistics_t TRI_GetServerStatistics ();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public variables
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief statistics enabled flags
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -229,111 +184,112 @@ extern bool TRI_ENABLE_STATISTICS;
|
|||
/// @brief number of http connections
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsCounter HttpConnections;
|
||||
extern triagens::basics::StatisticsCounter TRI_HttpConnectionsStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief total number of requests
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsCounter TotalRequests;
|
||||
extern triagens::basics::StatisticsCounter TRI_TotalRequestsStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief number of requests by HTTP method
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern std::vector<triagens::basics::StatisticsCounter> MethodRequests;
|
||||
extern std::vector<triagens::basics::StatisticsCounter> TRI_MethodRequestsStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief number of async requests
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsCounter AsyncRequests;
|
||||
extern triagens::basics::StatisticsCounter TRI_AsyncRequestsStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief connection time distribution vector
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsVector ConnectionTimeDistributionVector;
|
||||
extern triagens::basics::StatisticsVector TRI_ConnectionTimeDistributionVectorStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief total time distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsDistribution* ConnectionTimeDistribution;
|
||||
extern triagens::basics::StatisticsDistribution* TRI_ConnectionTimeDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief request time distribution vector
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsVector RequestTimeDistributionVector;
|
||||
extern triagens::basics::StatisticsVector TRI_RequestTimeDistributionVectorStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief total time distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsDistribution* TotalTimeDistribution;
|
||||
extern triagens::basics::StatisticsDistribution* TRI_TotalTimeDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief request time distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsDistribution* RequestTimeDistribution;
|
||||
extern triagens::basics::StatisticsDistribution* TRI_RequestTimeDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief queue time distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsDistribution* QueueTimeDistribution;
|
||||
extern triagens::basics::StatisticsDistribution* TRI_QueueTimeDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief bytes sent distribution vector
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsVector BytesSentDistributionVector;
|
||||
extern triagens::basics::StatisticsVector TRI_BytesSentDistributionVectorStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief bytes sent distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsDistribution* BytesSentDistribution;
|
||||
extern triagens::basics::StatisticsDistribution* TRI_BytesSentDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief bytes received distribution vector
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsVector BytesReceivedDistributionVector;
|
||||
extern triagens::basics::StatisticsVector TRI_BytesReceivedDistributionVectorStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief bytes received distribution
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern triagens::basics::StatisticsDistribution* BytesReceivedDistribution;
|
||||
extern triagens::basics::StatisticsDistribution* TRI_BytesReceivedDistributionStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief global server statistics
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern TRI_server_statistics_t ServerStatistics;
|
||||
extern TRI_server_statistics_t TRI_ServerStatistics;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
/// @brief physical memeory
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
extern uint64_t TRI_PhysicalMemory;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup Statistics
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief gets the current wallclock time
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
double TRI_StatisticsTime (void);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- module initialisation
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief module init function
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -346,10 +302,6 @@ void TRI_InitialiseStatistics (void);
|
|||
|
||||
void TRI_ShutdownStatistics (void);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1704,6 +1704,9 @@ static v8::Handle<v8::Value> JS_Output (v8::Arguments const& argv) {
|
|||
///
|
||||
/// The resident set size is reported in bytes.
|
||||
///
|
||||
/// - residentSizePercent: resident size as percent of the total physical
|
||||
/// memory size.
|
||||
///
|
||||
/// - virtualSize: Virtual memory size in bytes.
|
||||
///
|
||||
/// @verbinclude system1
|
||||
|
|
@ -1715,13 +1718,20 @@ static v8::Handle<v8::Value> JS_ProcessStatistics (v8::Arguments const& argv) {
|
|||
v8::Handle<v8::Object> result = v8::Object::New();
|
||||
|
||||
TRI_process_info_t info = TRI_ProcessInfoSelf();
|
||||
double rss = (double) info._residentSize;
|
||||
double rssp = 0;
|
||||
|
||||
if (TRI_PhysicalMemory != 0) {
|
||||
rssp = 100.0 * rss / TRI_PhysicalMemory;
|
||||
}
|
||||
|
||||
result->Set(v8::String::New("minorPageFaults"), v8::Number::New((double) info._minorPageFaults));
|
||||
result->Set(v8::String::New("majorPageFaults"), v8::Number::New((double) info._majorPageFaults));
|
||||
result->Set(v8::String::New("userTime"), v8::Number::New((double) info._userTime / (double) info._scClkTck));
|
||||
result->Set(v8::String::New("systemTime"), v8::Number::New((double) info._systemTime / (double) info._scClkTck));
|
||||
result->Set(v8::String::New("numberOfThreads"), v8::Number::New((double) info._numberThreads));
|
||||
result->Set(v8::String::New("residentSize"), v8::Number::New((double) info._residentSize));
|
||||
result->Set(v8::String::New("residentSize"), v8::Number::New(rss));
|
||||
result->Set(v8::String::New("residentSizePercent"), v8::Number::New(rssp));
|
||||
result->Set(v8::String::New("virtualSize"), v8::Number::New((double) info._virtualSize));
|
||||
|
||||
return scope.Close(result);
|
||||
|
|
@ -2034,6 +2044,7 @@ static v8::Handle<v8::Value> JS_ServerStatistics (v8::Arguments const& argv) {
|
|||
v8::Handle<v8::Object> result = v8::Object::New();
|
||||
|
||||
result->Set(v8::String::New("uptime"), v8::Number::New((double) info._uptime));
|
||||
result->Set(v8::String::New("physicalMemory"), v8::Number::New((double) TRI_PhysicalMemory));
|
||||
|
||||
return scope.Close(result);
|
||||
}
|
||||
|
|
@ -3350,10 +3361,10 @@ void TRI_InitV8Utils (v8::Handle<v8::Context> context,
|
|||
TRI_AddGlobalVariableVocbase(context, "VALGRIND", RUNNING_ON_VALGRIND > 0 ? v8::True() : v8::False());
|
||||
TRI_AddGlobalVariableVocbase(context, "VERSION", v8::String::New(TRI_VERSION));
|
||||
|
||||
TRI_AddGlobalVariableVocbase(context, "CONNECTION_TIME_DISTRIBUTION", DistributionList(ConnectionTimeDistributionVector));
|
||||
TRI_AddGlobalVariableVocbase(context, "REQUEST_TIME_DISTRIBUTION", DistributionList(RequestTimeDistributionVector));
|
||||
TRI_AddGlobalVariableVocbase(context, "BYTES_SENT_DISTRIBUTION", DistributionList(BytesSentDistributionVector));
|
||||
TRI_AddGlobalVariableVocbase(context, "BYTES_RECEIVED_DISTRIBUTION", DistributionList(BytesReceivedDistributionVector));
|
||||
TRI_AddGlobalVariableVocbase(context, "CONNECTION_TIME_DISTRIBUTION", DistributionList(TRI_ConnectionTimeDistributionVectorStatistics));
|
||||
TRI_AddGlobalVariableVocbase(context, "REQUEST_TIME_DISTRIBUTION", DistributionList(TRI_RequestTimeDistributionVectorStatistics));
|
||||
TRI_AddGlobalVariableVocbase(context, "BYTES_SENT_DISTRIBUTION", DistributionList(TRI_BytesSentDistributionVectorStatistics));
|
||||
TRI_AddGlobalVariableVocbase(context, "BYTES_RECEIVED_DISTRIBUTION", DistributionList(TRI_BytesReceivedDistributionVectorStatistics));
|
||||
|
||||
TRI_AddGlobalVariableVocbase(context, "SYS_PLATFORM", v8::String::New(TRI_PLATFORM));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue