1
0
Fork 0

Bug fix 3.3/pre release woes (#4084)

This commit is contained in:
Jan 2018-01-03 16:02:30 +01:00 committed by GitHub
parent 47bbfdc503
commit d80daeb450
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 1 deletions

View File

@ -146,6 +146,7 @@ v3.3.beta1 (2017-11-07)
settable via the `--console.prompt` option in arangosh:
- '%t': current time as timestamp
- '%a': elpased time since ArangoShell start in seconds
- '%p': duration of last command in seconds
- '%d': name of current database
- '%e': current endpoint

View File

@ -83,6 +83,14 @@ void ReplicationFeature::prepare() {
void ReplicationFeature::start() {
_globalReplicationApplier.reset(new GlobalReplicationApplier(GlobalReplicationApplier::loadConfiguration()));
try {
_globalReplicationApplier->loadState();
} catch (...) {
// :snake:
}
LOG_TOPIC(DEBUG, Logger::REPLICATION) << "checking global applier startup. autoStart: " << _globalReplicationApplier->autoStart() << ", hasState: " << _globalReplicationApplier->hasState();
if (_globalReplicationApplier->autoStart() &&
_globalReplicationApplier->hasState() &&

View File

@ -64,7 +64,8 @@ ConsoleFeature::ConsoleFeature(application_features::ApplicationServer* server)
_supportsColors(isatty(STDIN_FILENO) != 0),
_toPager(stdout),
_toAuditFile(nullptr),
_lastDuration(0.0) {
_lastDuration(0.0),
_startTime(TRI_microtime()) {
setOptional(false);
requiresElevatedPrivileges(false);
startsAfter("Logger");
@ -422,6 +423,10 @@ ConsoleFeature::Prompt ConsoleFeature::buildPrompt(ClientFeature* client) {
std::ostringstream tmp;
tmp << std::setprecision(6) << std::fixed << TRI_microtime();
result.append(tmp.str());
} else if (c == 'a') {
std::ostringstream tmp;
tmp << std::setprecision(6) << std::fixed << (TRI_microtime() - _startTime);
result.append(tmp.str());
} else if (c == 'p') {
std::ostringstream tmp;
tmp << std::setprecision(6) << std::fixed << _lastDuration;

View File

@ -109,6 +109,8 @@ class ConsoleFeature final : public application_features::ApplicationFeature {
FILE* _toAuditFile;
// amount of time the last executed shell operation took
double _lastDuration;
// timestamp of startup time
double const _startTime;
};
}