diff --git a/fdbclient/NativeAPI.actor.cpp b/fdbclient/NativeAPI.actor.cpp index 17275451a7..9ac9c6426a 100644 --- a/fdbclient/NativeAPI.actor.cpp +++ b/fdbclient/NativeAPI.actor.cpp @@ -47,6 +47,7 @@ #include "fdbclient/SpecialKeySpace.actor.h" #include "fdbclient/StorageServerInterface.h" #include "fdbclient/SystemData.h" +#include "fdbclient/versions.h" #include "fdbrpc/LoadBalance.h" #include "fdbrpc/Net2FileSystem.h" #include "fdbrpc/simulator.h" @@ -64,9 +65,6 @@ #include "flow/UnitTest.h" #include "flow/serialize.h" -#include "fdbclient/versions.h" -#include "flow/serialize.h" - #ifdef WIN32 #define WIN32_LEAN_AND_MEAN #include @@ -1541,7 +1539,7 @@ ACTOR Future>> transactionalGetServerInt //If isBackward == true, returns the shard containing the key before 'key' (an infinitely long, inexpressible key). Otherwise returns the shard containing key ACTOR Future< pair> > getKeyLocation_internal( Database cx, Key key, TransactionInfo info, bool isBackward = false ) { - state Span span("NA:getKeyLocation"_loc, { info.span->context }); + state Span span("NAPI:getKeyLocation"_loc, { info.span->context }); if (isBackward) { ASSERT( key != allKeys.begin && key <= allKeys.end ); } else { @@ -1594,7 +1592,7 @@ Future>> getKeyLocation(Database const& c } ACTOR Future< vector< pair> > > getKeyRangeLocations_internal( Database cx, KeyRange keys, int limit, bool reverse, TransactionInfo info ) { - state Span span("NA:getKeyRangeLocations"_loc, { info.span->context }); + state Span span("NAPI:getKeyRangeLocations"_loc, { info.span->context }); if( info.debugID.present() ) g_traceBatch.addEvent("TransactionDebug", info.debugID.get().first(), "NativeAPI.getKeyLocations.Before"); @@ -1696,7 +1694,7 @@ Future Transaction::warmRange(Database cx, KeyRange keys) { ACTOR Future> getValue( Future version, Key key, Database cx, TransactionInfo info, Reference trLogInfo, TagSet tags ) { state Version ver = wait( version ); - state Span span("NA:getValue"_loc, { info.span->context }); + state Span span("NAPI:getValue"_loc, { info.span->context }); cx->validateVersion(ver); loop { @@ -1792,7 +1790,7 @@ ACTOR Future getKey( Database cx, KeySelector k, Future version, T wait(success(version)); state Optional getKeyID = Optional(); - state Span span("NA:getKey"_loc, { info.span->context }); + state Span span("NAPI:getKey"_loc, { info.span->context }); if( info.debugID.present() ) { getKeyID = nondeterministicRandom()->randomUniqueID(); @@ -1859,7 +1857,7 @@ ACTOR Future getKey( Database cx, KeySelector k, Future version, T } ACTOR Future waitForCommittedVersion( Database cx, Version version, SpanID spanContext ) { - state Span span("NA:waitForCommittedVersion"_loc, { spanContext }); + state Span span("NAPI:waitForCommittedVersion"_loc, { spanContext }); try { loop { choose { @@ -1883,7 +1881,7 @@ ACTOR Future waitForCommittedVersion( Database cx, Version version, Spa } ACTOR Future getRawVersion( Database cx, SpanID spanContext ) { - state Span span("NA:getRawVersion"_loc, { spanContext }); + state Span span("NAPI:getRawVersion"_loc, { spanContext }); loop { choose { when ( wait( cx->onMasterProxiesChanged() ) ) {} @@ -1903,7 +1901,7 @@ ACTOR Future readVersionBatcher( ACTOR Future watchValue(Future version, Key key, Optional value, Database cx, TransactionInfo info, TagSet tags) { state Version ver = wait( version ); - state Span span(deterministicRandom()->randomUniqueID(), "NA:watchValue"_loc, { info.span->context }); + state Span span(deterministicRandom()->randomUniqueID(), "NAPI:watchValue"_loc, { info.span->context }); cx->validateVersion(ver); ASSERT(ver != latestVersion); @@ -1988,7 +1986,7 @@ ACTOR Future> getExactRange( Database cx, Version ver KeyRange keys, GetRangeLimits limits, bool reverse, TransactionInfo info, TagSet tags ) { state Standalone output; - state Span span("NA:getExactRange"_loc, { info.span->context }); + state Span span("NAPI:getExactRange"_loc, { info.span->context }); //printf("getExactRange( '%s', '%s' )\n", keys.begin.toString().c_str(), keys.end.toString().c_str()); loop { @@ -3158,7 +3156,7 @@ void Transaction::setupWatches() { ACTOR static Future tryCommit( Database cx, Reference trLogInfo, CommitTransactionRequest req, Future readVersion, TransactionInfo info, Version* pCommittedVersion, Transaction* tr, TransactionOptions options) { state TraceInterval interval( "TransactionCommit" ); state double startTime = now(); - state Span span("NA:tryCommit"_loc, { info.span->context }); + state Span span("NAPI:tryCommit"_loc, { info.span->context }); req.spanContext = span->context; if (info.debugID.present()) TraceEvent(interval.begin()).detail( "Parent", info.debugID.get() ); diff --git a/fdbserver/workloads/Cycle.actor.cpp b/fdbserver/workloads/Cycle.actor.cpp index 3219de1cd0..79cb8ac00a 100644 --- a/fdbserver/workloads/Cycle.actor.cpp +++ b/fdbserver/workloads/Cycle.actor.cpp @@ -44,13 +44,13 @@ struct CycleWorkload : TestWorkload { transactions("Transactions"), retries("Retries"), totalLatency("Latency"), tooOldRetries("Retries.too_old"), commitFailedRetries("Retries.commit_failed") { - testDuration = getOption( options, "testDuration"_ref, 10.0 ); - transactionsPerSecond = getOption( options, "transactionsPerSecond"_ref, 5000.0 ) / clientCount; - actorCount = getOption( options, "actorsPerClient"_ref, transactionsPerSecond / 5 ); - nodeCount = getOption(options, "nodeCount"_ref, transactionsPerSecond * clientCount); - keyPrefix = unprintable( getOption(options, "keyPrefix"_ref, LiteralStringRef("")).toString() ); - traceParentProbability = getOption(options, "traceParentProbability "_ref, 0.01); - minExpectedTransactionsPerSecond = transactionsPerSecond * getOption(options, LiteralStringRef("expectedRate"), 0.7); + testDuration = getOption( options, "testDuration"_sr, 10.0 ); + transactionsPerSecond = getOption( options, "transactionsPerSecond"_sr, 5000.0 ) / clientCount; + actorCount = getOption( options, "actorsPerClient"_sr, transactionsPerSecond / 5 ); + nodeCount = getOption(options, "nodeCount"_sr, transactionsPerSecond * clientCount); + keyPrefix = unprintable( getOption(options, "keyPrefix"_sr, LiteralStringRef("")).toString() ); + traceParentProbability = getOption(options, "traceParentProbability "_sr, 0.01); + minExpectedTransactionsPerSecond = transactionsPerSecond * getOption(options, "expectedRate"_sr, 0.7); } virtual std::string description() { return "CycleWorkload"; } diff --git a/flow/Arena.h b/flow/Arena.h index 1a2a619f89..0195373171 100644 --- a/flow/Arena.h +++ b/flow/Arena.h @@ -631,7 +631,7 @@ struct Traceable> : std::conditional::value, std::tru }; #define LiteralStringRef( str ) StringRef( (const uint8_t*)(str), sizeof((str))-1 ) -inline StringRef operator "" _ref(const char* str, size_t size) { +inline StringRef operator "" _sr(const char* str, size_t size) { return StringRef(reinterpret_cast(str), size); }