From 49f0cf5ab08967de47e4899430c1a22553404ec5 Mon Sep 17 00:00:00 2001 From: Markus Pilman Date: Thu, 13 Oct 2022 20:53:48 -0600 Subject: [PATCH] Force name and description of workloads to be the same --- .../fdbserver/workloads/workloads.actor.h | 41 ++++++++++++++----- fdbserver/workloads/ApiCorrectness.actor.cpp | 7 ++-- .../workloads/AsyncFileCorrectness.actor.cpp | 7 ++-- fdbserver/workloads/AsyncFileRead.actor.cpp | 5 +-- fdbserver/workloads/AsyncFileWrite.actor.cpp | 7 ++-- fdbserver/workloads/AtomicOps.actor.cpp | 9 ++-- .../AtomicOpsApiCorrectness.actor.cpp | 7 ++-- fdbserver/workloads/AtomicRestore.actor.cpp | 5 +-- .../workloads/AtomicSwitchover.actor.cpp | 5 +-- .../AutomaticIdempotencyWorkload.actor.cpp | 5 +-- .../workloads/BackgroundSelectors.actor.cpp | 7 ++-- ...kupAndParallelRestoreCorrectness.actor.cpp | 6 +-- .../workloads/BackupCorrectness.actor.cpp | 6 +-- fdbserver/workloads/BackupToBlob.actor.cpp | 6 +-- fdbserver/workloads/BackupToDBAbort.actor.cpp | 5 +-- .../workloads/BackupToDBCorrectness.actor.cpp | 5 +-- .../workloads/BackupToDBUpgrade.actor.cpp | 5 +-- .../BlobGranuleCorrectnessWorkload.actor.cpp | 5 +-- .../BlobGranuleRangesWorkload.actor.cpp | 4 +- .../workloads/BlobGranuleVerifier.actor.cpp | 4 +- fdbserver/workloads/BulkLoad.actor.cpp | 5 +-- fdbserver/workloads/BulkSetup.actor.cpp | 5 +-- fdbserver/workloads/Cache.actor.cpp | 4 +- fdbserver/workloads/ChangeConfig.actor.cpp | 5 +-- .../workloads/ChangeFeedOperations.actor.cpp | 4 +- fdbserver/workloads/ChangeFeeds.actor.cpp | 4 +- .../workloads/ClearSingleRange.actor.cpp | 7 ++-- ...entTransactionProfileCorrectness.actor.cpp | 8 ++-- .../workloads/ClogSingleConnection.actor.cpp | 6 +-- fdbserver/workloads/CommitBugCheck.actor.cpp | 5 +-- fdbserver/workloads/ConfigIncrement.actor.cpp | 5 +-- .../workloads/ConfigureDatabase.actor.cpp | 5 +-- fdbserver/workloads/ConflictRange.actor.cpp | 7 ++-- .../workloads/ConsistencyCheck.actor.cpp | 9 ++-- fdbserver/workloads/CpuProfiler.actor.cpp | 7 ++-- fdbserver/workloads/CreateTenant.actor.cpp | 4 +- fdbserver/workloads/Cycle.actor.cpp | 15 ++----- fdbserver/workloads/DDBalance.actor.cpp | 5 +-- fdbserver/workloads/DDMetrics.actor.cpp | 5 +-- .../workloads/DDMetricsExclude.actor.cpp | 4 +- .../DataDistributionMetrics.actor.cpp | 4 +- .../workloads/DataLossRecovery.actor.cpp | 5 +-- .../DifferentClustersSameRV.actor.cpp | 5 +-- fdbserver/workloads/DiskDurability.actor.cpp | 5 +-- .../workloads/DiskDurabilityTest.actor.cpp | 4 +- .../workloads/DiskFailureInjection.actor.cpp | 10 +---- fdbserver/workloads/DummyWorkload.actor.cpp | 5 +-- .../workloads/EncryptKeyProxyTest.actor.cpp | 5 +-- fdbserver/workloads/EncryptionOps.actor.cpp | 5 +-- .../workloads/ExternalWorkload.actor.cpp | 6 +-- .../workloads/FastTriggeredWatches.actor.cpp | 5 +-- fdbserver/workloads/FileSystem.actor.cpp | 5 +-- fdbserver/workloads/Fuzz.cpp | 4 +- .../workloads/FuzzApiCorrectness.actor.cpp | 5 +-- fdbserver/workloads/GetMappedRange.actor.cpp | 5 +-- fdbserver/workloads/GetRangeStream.actor.cpp | 7 ++-- .../workloads/GlobalTagThrottling.actor.cpp | 4 +- .../workloads/HealthMetricsApi.actor.cpp | 8 ++-- ...ontentionPrefixAllocatorWorkload.actor.cpp | 4 +- .../IDDTxnProcessorApiCorrectness.actor.cpp | 6 +-- fdbserver/workloads/Increment.actor.cpp | 7 ++-- .../workloads/IncrementalBackup.actor.cpp | 7 ++-- fdbserver/workloads/IndexScan.actor.cpp | 9 ++-- fdbserver/workloads/Inventory.actor.cpp | 5 +-- fdbserver/workloads/KVStoreTest.actor.cpp | 8 ++-- fdbserver/workloads/KillRegion.actor.cpp | 9 ++-- fdbserver/workloads/LocalRatekeeper.actor.cpp | 4 +- fdbserver/workloads/LockDatabase.actor.cpp | 6 +-- .../LockDatabaseFrequently.actor.cpp | 6 +-- fdbserver/workloads/LogMetrics.actor.cpp | 5 ++- fdbserver/workloads/LowLatency.actor.cpp | 8 ++-- .../workloads/MachineAttrition.actor.cpp | 4 +- fdbserver/workloads/Mako.actor.cpp | 10 ++--- fdbserver/workloads/MemoryLifetime.actor.cpp | 5 +-- .../MetaclusterManagementWorkload.actor.cpp | 7 ++-- fdbserver/workloads/MetricLogging.actor.cpp | 5 +-- fdbserver/workloads/MiniCycle.actor.cpp | 10 +++-- .../MutationLogReaderCorrectness.actor.cpp | 7 ++-- fdbserver/workloads/ParallelRestore.actor.cpp | 7 ++-- fdbserver/workloads/Performance.actor.cpp | 5 ++- .../workloads/PhysicalShardMove.actor.cpp | 6 +-- fdbserver/workloads/Ping.actor.cpp | 6 +-- .../workloads/PrivateEndpoints.actor.cpp | 10 +++-- fdbserver/workloads/ProtocolVersion.actor.cpp | 6 +-- fdbserver/workloads/PubSubMultiples.actor.cpp | 5 ++- fdbserver/workloads/QueuePush.actor.cpp | 5 ++- fdbserver/workloads/RYWDisable.actor.cpp | 6 +-- fdbserver/workloads/RYWPerformance.actor.cpp | 6 +-- fdbserver/workloads/RandomClogging.actor.cpp | 10 ++--- fdbserver/workloads/RandomMoveKeys.actor.cpp | 5 ++- fdbserver/workloads/RandomSelector.actor.cpp | 6 +-- fdbserver/workloads/ReadAfterWrite.actor.cpp | 5 +-- .../workloads/ReadHotDetection.actor.cpp | 6 +-- fdbserver/workloads/ReadWrite.actor.cpp | 5 +-- .../workloads/RemoveServersSafely.actor.cpp | 5 ++- .../workloads/ReportConflictingKeys.actor.cpp | 5 +-- fdbserver/workloads/RestoreBackup.actor.cpp | 7 ++-- fdbserver/workloads/RestoreFromBlob.actor.cpp | 6 +-- fdbserver/workloads/Rollback.actor.cpp | 5 ++- fdbserver/workloads/RyowCorrectness.actor.cpp | 5 +-- fdbserver/workloads/SaveAndKill.actor.cpp | 4 +- .../workloads/SelectorCorrectness.actor.cpp | 6 +-- fdbserver/workloads/Serializability.actor.cpp | 6 +-- fdbserver/workloads/Sideband.actor.cpp | 5 ++- fdbserver/workloads/SidebandSingle.actor.cpp | 5 ++- fdbserver/workloads/SimpleAtomicAdd.actor.cpp | 6 +-- fdbserver/workloads/SkewedReadWrite.actor.cpp | 6 +-- .../workloads/SlowTaskWorkload.actor.cpp | 5 +-- fdbserver/workloads/SnapTest.actor.cpp | 5 ++- .../SpecialKeySpaceCorrectness.actor.cpp | 4 +- fdbserver/workloads/StatusWorkload.actor.cpp | 5 ++- fdbserver/workloads/StorageQuota.actor.cpp | 4 +- ...orageServerCheckpointRestoreTest.actor.cpp | 5 +-- fdbserver/workloads/Storefront.actor.cpp | 6 +-- .../workloads/StreamingRangeRead.actor.cpp | 4 +- fdbserver/workloads/StreamingRead.actor.cpp | 6 +-- fdbserver/workloads/SubmitBackup.actor.cpp | 8 ++-- .../workloads/SuspendProcesses.actor.cpp | 5 +-- fdbserver/workloads/TagThrottleApi.actor.cpp | 6 +-- fdbserver/workloads/TargetedKill.actor.cpp | 5 ++- .../workloads/TaskBucketCorrectness.actor.cpp | 11 ++--- .../TenantEntryCacheWorkload.actor.cpp | 6 +-- ...antManagementConcurrencyWorkload.actor.cpp | 7 ++-- .../TenantManagementWorkload.actor.cpp | 6 +-- fdbserver/workloads/ThreadSafety.actor.cpp | 6 +-- fdbserver/workloads/Throttling.actor.cpp | 5 +-- fdbserver/workloads/Throughput.actor.cpp | 6 +-- .../workloads/TimeKeeperCorrectness.actor.cpp | 6 +-- fdbserver/workloads/TriggerRecovery.actor.cpp | 6 +-- fdbserver/workloads/UDPWorkload.actor.cpp | 13 +++--- fdbserver/workloads/UnitPerf.actor.cpp | 4 +- fdbserver/workloads/UnitTests.actor.cpp | 5 ++- fdbserver/workloads/Unreadable.actor.cpp | 5 +-- fdbserver/workloads/ValidateStorage.actor.cpp | 6 +-- fdbserver/workloads/VersionStamp.actor.cpp | 6 +-- fdbserver/workloads/WatchAndWait.actor.cpp | 6 +-- fdbserver/workloads/Watches.actor.cpp | 6 +-- .../WatchesSameKeyCorrectness.actor.cpp | 7 ++-- fdbserver/workloads/WorkerErrors.actor.cpp | 5 ++- fdbserver/workloads/WriteBandwidth.actor.cpp | 5 ++- fdbserver/workloads/WriteDuringRead.actor.cpp | 6 +-- .../workloads/WriteTagThrottling.actor.cpp | 6 +-- 142 files changed, 406 insertions(+), 470 deletions(-) diff --git a/fdbserver/include/fdbserver/workloads/workloads.actor.h b/fdbserver/include/fdbserver/workloads/workloads.actor.h index 27770a10c1c..cda22043ae7 100644 --- a/fdbserver/include/fdbserver/workloads/workloads.actor.h +++ b/fdbserver/include/fdbserver/workloads/workloads.actor.h @@ -64,6 +64,8 @@ struct WorkloadContext { }; struct TestWorkload : NonCopyable, WorkloadContext, ReferenceCounted { + // Implementations of TestWorkload need to provide their name by defining a static member variable called name: + // static constexpr const char* name = "WorkloadName"; int phases; // Subclasses are expected to also have a constructor with this signature (to work with WorkloadFactory<>): @@ -75,6 +77,8 @@ struct TestWorkload : NonCopyable, WorkloadContext, ReferenceCounted initialized() { return Void(); } + // WARNING: this method must not be implemented by a workload directly. Instead, this will be implemented by + // the workload factory. Instead, provide a static member variable called name. virtual std::string description() const = 0; virtual void disableFailureInjectionWorkloads(std::set& out) const; virtual Future setup(Database const& cx) { return Void(); } @@ -94,11 +98,26 @@ struct TestWorkload : NonCopyable, WorkloadContext, ReferenceCounted& m) = 0; }; +struct NoOptions {}; + +template +struct TestWorkloadImpl : Workload { + static_assert(std::is_convertible_v); + static_assert(std::is_convertible_v, + "Workload must have a static member `name` which is convertible to string"); + static_assert(std::is_same_v, + "Workload must not override TestWorkload::description"); + + TestWorkloadImpl(WorkloadContext const& wcx) : Workload(wcx) {} + template + TestWorkloadImpl(WorkloadContext const& wcx, std::enable_if_t o) : Workload(wcx, o) {} + + std::string description() const override { return Workload::NAME; } +}; + struct CompoundWorkload; class DeterministicRandom; -struct NoOptions {}; - struct FailureInjectionWorkload : TestWorkload { FailureInjectionWorkload(WorkloadContext const&); virtual ~FailureInjectionWorkload() {} @@ -126,12 +145,11 @@ struct FailureInjectorFactory : IFailureInjectorFactory { IFailureInjectorFactory::factories().push_back(Reference::addRef(this)); } Reference create(WorkloadContext const& wcx) override { - return makeReference(wcx, NoOptions()); + return makeReference>(wcx, NoOptions()); } }; struct CompoundWorkload : TestWorkload { - bool runFailureWorkloads = true; std::vector> workloads; std::vector> failureInjection; @@ -213,14 +231,17 @@ struct IWorkloadFactory : ReferenceCounted { virtual Reference create(WorkloadContext const& wcx) = 0; }; -template +template struct WorkloadFactory : IWorkloadFactory { - bool asClient; - WorkloadFactory(const char* name, bool asClient = false) : asClient(asClient) { - factories()[name] = Reference::addRef(this); + static_assert(std::is_convertible_v, + "Each workload must have a Workload::NAME member"); + using WorkloadType = TestWorkloadImpl; + bool runInUntrustedClient; + WorkloadFactory(bool runInUntrustedClient = false) : runInUntrustedClient(runInUntrustedClient) { + factories()[WorkloadType::NAME] = Reference::addRef(this); } Reference create(WorkloadContext const& wcx) override { - if (g_network->isSimulated() && asClient) { + if (g_network->isSimulated() && runInUntrustedClient) { return makeReference( [](WorkloadContext const& wcx) { return makeReference(wcx); }, wcx); } @@ -228,7 +249,7 @@ struct WorkloadFactory : IWorkloadFactory { } }; -#define REGISTER_WORKLOAD(classname) WorkloadFactory classname##WorkloadFactory(#classname) +#define REGISTER_WORKLOAD(classname) WorkloadFactory classname##WorkloadFactory struct DistributedTestResults { std::vector metrics; diff --git a/fdbserver/workloads/ApiCorrectness.actor.cpp b/fdbserver/workloads/ApiCorrectness.actor.cpp index 3777e8ea2ae..f54e41d7fb7 100644 --- a/fdbserver/workloads/ApiCorrectness.actor.cpp +++ b/fdbserver/workloads/ApiCorrectness.actor.cpp @@ -31,6 +31,7 @@ enum OperationType { SET, GET, GET_RANGE, GET_RANGE_SELECTOR, GET_KEY, CLEAR, CL // A workload that executes the NativeAPIs functions and verifies that their outcomes are correct struct ApiCorrectnessWorkload : ApiWorkload { + static constexpr auto NAME = "ApiCorrectness"; private: // Enable to track the activity on a particular key @@ -136,9 +137,7 @@ struct ApiCorrectnessWorkload : ApiWorkload { } ~ApiCorrectnessWorkload() override {} - - std::string description() const override { return "ApiCorrectness"; } - + void getMetrics(std::vector& m) override { m.emplace_back("Number of Random Operations Performed", numRandomOperations.getValue(), Averaged::False); } @@ -765,4 +764,4 @@ struct ApiCorrectnessWorkload : ApiWorkload { } }; -WorkloadFactory ApiCorrectnessWorkloadFactory("ApiCorrectness"); +WorkloadFactory ApiCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/AsyncFileCorrectness.actor.cpp b/fdbserver/workloads/AsyncFileCorrectness.actor.cpp index 5dd51378197..04c5c898be9 100644 --- a/fdbserver/workloads/AsyncFileCorrectness.actor.cpp +++ b/fdbserver/workloads/AsyncFileCorrectness.actor.cpp @@ -44,6 +44,7 @@ struct OperationInfo { }; struct AsyncFileCorrectnessWorkload : public AsyncFileWorkload { + static constexpr auto NAME = "AsyncFileCorrectness"; // Maximum number of bytes operated on by a file operation int maxOperationSize; @@ -94,9 +95,7 @@ struct AsyncFileCorrectnessWorkload : public AsyncFileWorkload { } ~AsyncFileCorrectnessWorkload() override {} - - std::string description() const override { return "AsyncFileCorrectness"; } - + Future setup(Database const& cx) override { if (enabled) return _setup(this); @@ -436,4 +435,4 @@ struct AsyncFileCorrectnessWorkload : public AsyncFileWorkload { } }; -WorkloadFactory AsyncFileCorrectnessWorkloadFactory("AsyncFileCorrectness"); +WorkloadFactory AsyncFileCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/AsyncFileRead.actor.cpp b/fdbserver/workloads/AsyncFileRead.actor.cpp index 17267adf6c3..b275da82adc 100644 --- a/fdbserver/workloads/AsyncFileRead.actor.cpp +++ b/fdbserver/workloads/AsyncFileRead.actor.cpp @@ -144,6 +144,7 @@ struct IOLog { }; struct AsyncFileReadWorkload : public AsyncFileWorkload { + constexpr static auto NAME = "AsyncFileRead"; // Buffers used to store what is being read or written std::vector> readBuffers; @@ -185,8 +186,6 @@ struct AsyncFileReadWorkload : public AsyncFileWorkload { ~AsyncFileReadWorkload() override {} - std::string description() const override { return "AsyncFileRead"; } - Future setup(Database const& cx) override { if (enabled) return _setup(this); @@ -329,4 +328,4 @@ struct AsyncFileReadWorkload : public AsyncFileWorkload { } }; -WorkloadFactory AsyncFileReadWorkloadFactory("AsyncFileRead"); +WorkloadFactory AsyncFileReadWorkloadFactory; diff --git a/fdbserver/workloads/AsyncFileWrite.actor.cpp b/fdbserver/workloads/AsyncFileWrite.actor.cpp index 45352c946db..1d33febd94b 100644 --- a/fdbserver/workloads/AsyncFileWrite.actor.cpp +++ b/fdbserver/workloads/AsyncFileWrite.actor.cpp @@ -26,6 +26,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct AsyncFileWriteWorkload : public AsyncFileWorkload { + static constexpr auto NAME = "AsyncFileWrite"; // Buffer used to store what is being written Reference writeBuffer; @@ -52,9 +53,7 @@ struct AsyncFileWriteWorkload : public AsyncFileWorkload { fileSize = getOption(options, "fileSize"_sr, 10002432); sequential = getOption(options, "sequential"_sr, true); } - - std::string description() const override { return "AsyncFileWrite"; } - + Future setup(Database const& cx) override { if (enabled) return _setup(this); @@ -153,4 +152,4 @@ struct AsyncFileWriteWorkload : public AsyncFileWorkload { } }; -WorkloadFactory AsyncFileWriteWorkloadFactory("AsyncFileWrite"); +WorkloadFactory AsyncFileWriteWorkloadFactory; diff --git a/fdbserver/workloads/AtomicOps.actor.cpp b/fdbserver/workloads/AtomicOps.actor.cpp index cbde2560d88..4c260d930c9 100644 --- a/fdbserver/workloads/AtomicOps.actor.cpp +++ b/fdbserver/workloads/AtomicOps.actor.cpp @@ -26,10 +26,11 @@ #include "fdbserver/workloads/workloads.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. -//#define SevAtomicOpDebug SevInfo +// #define SevAtomicOpDebug SevInfo #define SevAtomicOpDebug SevVerbose struct AtomicOpsWorkload : TestWorkload { + static constexpr auto NAME = "AtomicOps"; int opNum, actorCount, nodeCount; uint32_t opType; bool apiVersion500 = false; @@ -106,9 +107,7 @@ struct AtomicOpsWorkload : TestWorkload { } TraceEvent("AtomicWorkload").detail("OpType", opType); } - - std::string description() const override { return "AtomicOps"; } - + Future setup(Database const& cx) override { if (apiVersion500) cx->apiVersion = ApiVersion(500); @@ -438,4 +437,4 @@ struct AtomicOpsWorkload : TestWorkload { } }; -WorkloadFactory AtomicOpsWorkloadFactory("AtomicOps"); +WorkloadFactory AtomicOpsWorkloadFactory; diff --git a/fdbserver/workloads/AtomicOpsApiCorrectness.actor.cpp b/fdbserver/workloads/AtomicOpsApiCorrectness.actor.cpp index bd10514d5d0..1c7d93162ee 100644 --- a/fdbserver/workloads/AtomicOpsApiCorrectness.actor.cpp +++ b/fdbserver/workloads/AtomicOpsApiCorrectness.actor.cpp @@ -25,6 +25,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct AtomicOpsApiCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "AtomicOpsApiCorrectness"; bool testFailed = false; uint32_t opType; @@ -42,9 +43,7 @@ struct AtomicOpsApiCorrectnessWorkload : TestWorkload { AtomicOpsApiCorrectnessWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { opType = getOption(options, "opType"_sr, -1); } - - std::string description() const override { return "AtomicOpsApiCorrectness"; } - + Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -640,4 +639,4 @@ struct AtomicOpsApiCorrectnessWorkload : TestWorkload { } }; -WorkloadFactory AtomicOpsApiCorrectnessWorkloadFactory("AtomicOpsApiCorrectness"); +WorkloadFactory AtomicOpsApiCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/AtomicRestore.actor.cpp b/fdbserver/workloads/AtomicRestore.actor.cpp index 1f1d0aea3bd..2acc8b092db 100644 --- a/fdbserver/workloads/AtomicRestore.actor.cpp +++ b/fdbserver/workloads/AtomicRestore.actor.cpp @@ -29,6 +29,7 @@ // A workload which test the correctness of backup and restore process struct AtomicRestoreWorkload : TestWorkload { + static constexpr auto NAME = "AtomicRestore"; double startAfter, restoreAfter; bool fastRestore; // true: use fast restore, false: use old style restore Standalone> backupRanges; @@ -73,8 +74,6 @@ struct AtomicRestoreWorkload : TestWorkload { ASSERT(removePrefix.size() == 0); } - std::string description() const override { return "AtomicRestore"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -146,4 +145,4 @@ struct AtomicRestoreWorkload : TestWorkload { } }; -WorkloadFactory AtomicRestoreWorkloadFactory("AtomicRestore"); +WorkloadFactory AtomicRestoreWorkloadFactory; diff --git a/fdbserver/workloads/AtomicSwitchover.actor.cpp b/fdbserver/workloads/AtomicSwitchover.actor.cpp index df31da1294c..1f7cc50eb36 100644 --- a/fdbserver/workloads/AtomicSwitchover.actor.cpp +++ b/fdbserver/workloads/AtomicSwitchover.actor.cpp @@ -27,6 +27,7 @@ // A workload which test the correctness of backup and restore process struct AtomicSwitchoverWorkload : TestWorkload { + static constexpr auto NAME = "AtomicSwitchover"; double switch1delay, switch2delay, stopDelay; Standalone> backupRanges; Database extraDB; @@ -43,8 +44,6 @@ struct AtomicSwitchoverWorkload : TestWorkload { extraDB = Database::createSimulatedExtraDatabase(g_simulator->extraDatabases[0], wcx.defaultTenant); } - std::string description() const override { return "AtomicSwitchover"; } - Future setup(Database const& cx) override { if (clientId != 0) return Void(); @@ -199,4 +198,4 @@ struct AtomicSwitchoverWorkload : TestWorkload { } }; -WorkloadFactory AtomicSwitchoverWorkloadFactory("AtomicSwitchover"); +WorkloadFactory AtomicSwitchoverWorkloadFactory; diff --git a/fdbserver/workloads/AutomaticIdempotencyWorkload.actor.cpp b/fdbserver/workloads/AutomaticIdempotencyWorkload.actor.cpp index 9da78044b2b..717232bd258 100644 --- a/fdbserver/workloads/AutomaticIdempotencyWorkload.actor.cpp +++ b/fdbserver/workloads/AutomaticIdempotencyWorkload.actor.cpp @@ -29,6 +29,7 @@ // If a transaction commits multiple times or doesn't commit, that probably indicates a problem with // `determineCommitStatus` in NativeAPI. struct AutomaticIdempotencyWorkload : TestWorkload { + static constexpr auto NAME = "AutomaticIdempotencyCorrectness"; int64_t numTransactions; Key keyPrefix; @@ -37,8 +38,6 @@ struct AutomaticIdempotencyWorkload : TestWorkload { keyPrefix = KeyRef(getOption(options, "keyPrefix"_sr, "automaticIdempotencyKeyPrefix"_sr)); } - std::string description() const override { return "AutomaticIdempotency"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return _start(this, cx); } @@ -92,4 +91,4 @@ struct AutomaticIdempotencyWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory AutomaticIdempotencyWorkloadFactory("AutomaticIdempotencyCorrectness"); +WorkloadFactory AutomaticIdempotencyWorkloadFactory; diff --git a/fdbserver/workloads/BackgroundSelectors.actor.cpp b/fdbserver/workloads/BackgroundSelectors.actor.cpp index 63ee6511cfc..467f7b926cf 100644 --- a/fdbserver/workloads/BackgroundSelectors.actor.cpp +++ b/fdbserver/workloads/BackgroundSelectors.actor.cpp @@ -31,6 +31,7 @@ KeySelector randomizedSelector(const KeyRef& key, bool orEqual, int offset) { } struct BackgroundSelectorWorkload : TestWorkload { + static constexpr auto NAME = "BackgroundSelector"; int actorsPerClient, maxDiff, minDrift, maxDrift, resultLimit; double testDuration, transactionsPerSecond; @@ -47,9 +48,7 @@ struct BackgroundSelectorWorkload : TestWorkload { transactionsPerSecond = getOption(options, "transactionsPerSecond"_sr, 10.0) / (clientCount * actorsPerClient); resultLimit = 10 * maxDiff; } - - std::string description() const override { return "BackgroundSelector"; } - + Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return _start(cx, this); } @@ -218,4 +217,4 @@ struct BackgroundSelectorWorkload : TestWorkload { } }; -WorkloadFactory BackgroundSelectorWorkloadFactory("BackgroundSelector"); +WorkloadFactory BackgroundSelectorWorkloadFactory; diff --git a/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp b/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp index fe94248696d..0feee4f55c8 100644 --- a/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp +++ b/fdbserver/workloads/BackupAndParallelRestoreCorrectness.actor.cpp @@ -33,6 +33,7 @@ // A workload which test the correctness of backup and restore process struct BackupAndParallelRestoreCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "BackupAndParallelRestoreCorrectness"; double backupAfter, restoreAfter, abortAndRestartAfter; double backupStartAt, restoreStartAfterBackupFinished, stopDifferentialAfter; Key backupTag; @@ -136,8 +137,6 @@ struct BackupAndParallelRestoreCorrectnessWorkload : TestWorkload { } } - std::string description() const override { return "BackupAndParallelRestoreCorrectness"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -791,5 +790,4 @@ struct BackupAndParallelRestoreCorrectnessWorkload : TestWorkload { int BackupAndParallelRestoreCorrectnessWorkload::backupAgentRequests = 0; -WorkloadFactory BackupAndParallelRestoreCorrectnessWorkloadFactory( - "BackupAndParallelRestoreCorrectness"); +WorkloadFactory BackupAndParallelRestoreCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/BackupCorrectness.actor.cpp b/fdbserver/workloads/BackupCorrectness.actor.cpp index 8d561886829..7bd309457e3 100644 --- a/fdbserver/workloads/BackupCorrectness.actor.cpp +++ b/fdbserver/workloads/BackupCorrectness.actor.cpp @@ -32,6 +32,7 @@ // A workload which test the correctness of backup and restore process struct BackupAndRestoreCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "BackupAndRestoreCorrectness"; double backupAfter, restoreAfter, abortAndRestartAfter; double minBackupAfter; double backupStartAt, restoreStartAfterBackupFinished, stopDifferentialAfter; @@ -168,8 +169,6 @@ struct BackupAndRestoreCorrectnessWorkload : TestWorkload { } } - std::string description() const override { return "BackupAndRestoreCorrectness"; } - Future setup(Database const& cx) override { if (clientId != 0) { return Void(); @@ -947,5 +946,4 @@ std::string getTestEncryptionFileName() { return "test_encryption_key_file"; } -WorkloadFactory BackupAndRestoreCorrectnessWorkloadFactory( - "BackupAndRestoreCorrectness"); +WorkloadFactory BackupAndRestoreCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/BackupToBlob.actor.cpp b/fdbserver/workloads/BackupToBlob.actor.cpp index 4dcb0d1a3f1..d1995f388b2 100644 --- a/fdbserver/workloads/BackupToBlob.actor.cpp +++ b/fdbserver/workloads/BackupToBlob.actor.cpp @@ -33,7 +33,7 @@ struct BackupToBlobWorkload : TestWorkload { int initSnapshotInterval = 0; int snapshotInterval = 100000; - static constexpr const char* DESCRIPTION = "BackupToBlob"; + static constexpr auto NAME = "BackupToBlob"; BackupToBlobWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { backupAfter = getOption(options, "backupAfter"_sr, 10.0); @@ -48,8 +48,6 @@ struct BackupToBlobWorkload : TestWorkload { backupURL = backupURLString; } - std::string description() const override { return DESCRIPTION; } - Future setup(Database const& cx) override { return Void(); } ACTOR static Future _start(Database cx, BackupToBlobWorkload* self) { @@ -79,4 +77,4 @@ struct BackupToBlobWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory BackupToBlobWorkloadFactory(BackupToBlobWorkload::DESCRIPTION); +WorkloadFactory BackupToBlobWorkloadFactory; diff --git a/fdbserver/workloads/BackupToDBAbort.actor.cpp b/fdbserver/workloads/BackupToDBAbort.actor.cpp index 3fa244e1238..59918448e05 100644 --- a/fdbserver/workloads/BackupToDBAbort.actor.cpp +++ b/fdbserver/workloads/BackupToDBAbort.actor.cpp @@ -27,6 +27,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct BackupToDBAbort : TestWorkload { + static constexpr auto NAME = "BackupToDBAbort"; double abortDelay; Database extraDB; Standalone> backupRanges; @@ -42,9 +43,7 @@ struct BackupToDBAbort : TestWorkload { lockid = UID(0xbeeffeed, 0xdecaf00d); } - - std::string description() const override { return "BackupToDBAbort"; } - + Future setup(const Database& cx) override { if (clientId != 0) return Void(); diff --git a/fdbserver/workloads/BackupToDBCorrectness.actor.cpp b/fdbserver/workloads/BackupToDBCorrectness.actor.cpp index 58bbf36f77e..f56780d4af9 100644 --- a/fdbserver/workloads/BackupToDBCorrectness.actor.cpp +++ b/fdbserver/workloads/BackupToDBCorrectness.actor.cpp @@ -31,6 +31,7 @@ // database must be idle after the restore completes, and this workload checks // that the restore range does not change post restore. struct BackupToDBCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "BackupToDBCorrectness"; double backupAfter, abortAndRestartAfter, restoreAfter; double backupStartAt, restoreStartAfterBackupFinished, stopDifferentialAfter; Key backupTag, restoreTag; @@ -144,8 +145,6 @@ struct BackupToDBCorrectnessWorkload : TestWorkload { TraceEvent("BARW_Start").detail("Locked", locked); } - std::string description() const override { return "BackupToDBCorrectness"; } - Future setup(Database const& cx) override { if (clientId != 0) { return Void(); @@ -773,4 +772,4 @@ struct BackupToDBCorrectnessWorkload : TestWorkload { int BackupToDBCorrectnessWorkload::drAgentRequests = 0; -WorkloadFactory BackupToDBCorrectnessWorkloadFactory("BackupToDBCorrectness"); +WorkloadFactory BackupToDBCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/BackupToDBUpgrade.actor.cpp b/fdbserver/workloads/BackupToDBUpgrade.actor.cpp index abf10ca90ca..231881050b0 100644 --- a/fdbserver/workloads/BackupToDBUpgrade.actor.cpp +++ b/fdbserver/workloads/BackupToDBUpgrade.actor.cpp @@ -31,6 +31,7 @@ // A workload which test the correctness of upgrading DR from 5.1 to 5.2 struct BackupToDBUpgradeWorkload : TestWorkload { + static constexpr auto NAME = "BackupToDBUpgrade"; double backupAfter, stopDifferentialAfter; Key backupTag, restoreTag, backupPrefix, extraPrefix; int backupRangesCount, backupRangeLengthMax; @@ -85,8 +86,6 @@ struct BackupToDBUpgradeWorkload : TestWorkload { TraceEvent("DRU_Start").log(); } - std::string description() const override { return "BackupToDBUpgrade"; } - Future setup(Database const& cx) override { if (clientId != 0) return Void(); @@ -539,4 +538,4 @@ struct BackupToDBUpgradeWorkload : TestWorkload { } }; -WorkloadFactory BackupToDBUpgradeWorkloadFactory("BackupToDBUpgrade"); +WorkloadFactory BackupToDBUpgradeWorkloadFactory; diff --git a/fdbserver/workloads/BlobGranuleCorrectnessWorkload.actor.cpp b/fdbserver/workloads/BlobGranuleCorrectnessWorkload.actor.cpp index fd21b90f93b..5e35e7dd7e3 100644 --- a/fdbserver/workloads/BlobGranuleCorrectnessWorkload.actor.cpp +++ b/fdbserver/workloads/BlobGranuleCorrectnessWorkload.actor.cpp @@ -28,7 +28,6 @@ #include "fdbclient/BlobGranuleReader.actor.h" #include "fdbclient/ManagementAPI.actor.h" #include "fdbclient/NativeAPI.actor.h" -#include "fdbclient/ReadYourWrites.h" #include "fdbclient/SystemData.h" #include "fdbclient/TenantManagement.actor.h" #include "fdbclient/Tuple.h" @@ -186,6 +185,7 @@ struct ThreadData : ReferenceCounted, NonCopyable { * are written to blob, and can validate that the granule data is correct at any desired version. */ struct BlobGranuleCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "BlobGranuleCorrectnessWorkload"; bool doSetup; double testDuration; @@ -265,7 +265,6 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload { return entry.get(); } - std::string description() const override { return "BlobGranuleCorrectnessWorkload"; } Future setup(Database const& cx) override { return _setup(cx, this); } ACTOR Future _setup(Database cx, BlobGranuleCorrectnessWorkload* self) { @@ -1030,4 +1029,4 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory BlobGranuleCorrectnessWorkloadFactory("BlobGranuleCorrectnessWorkload"); +WorkloadFactory BlobGranuleCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/BlobGranuleRangesWorkload.actor.cpp b/fdbserver/workloads/BlobGranuleRangesWorkload.actor.cpp index 40268caa184..ec731a9577b 100644 --- a/fdbserver/workloads/BlobGranuleRangesWorkload.actor.cpp +++ b/fdbserver/workloads/BlobGranuleRangesWorkload.actor.cpp @@ -42,6 +42,7 @@ // A workload specifically designed to stress the blob range management of the blob manager + blob worker, and test the // blob database api functions struct BlobGranuleRangesWorkload : TestWorkload { + static constexpr auto NAME = "BlobGranuleRanges"; // test settings double testDuration; int operationsPerSecond; @@ -88,7 +89,6 @@ struct BlobGranuleRangesWorkload : TestWorkload { TraceEvent("BlobGranuleRangesWorkloadInit").detail("TargetRanges", targetRanges); } - std::string description() const override { return "BlobGranuleRangesWorkload"; } Future setup(Database const& cx) override { return _setup(cx, this); } std::string newKey() { @@ -675,4 +675,4 @@ struct BlobGranuleRangesWorkload : TestWorkload { } }; -WorkloadFactory BlobGranuleRangesWorkloadFactory("BlobGranuleRanges"); +WorkloadFactory BlobGranuleRangesWorkloadFactory; diff --git a/fdbserver/workloads/BlobGranuleVerifier.actor.cpp b/fdbserver/workloads/BlobGranuleVerifier.actor.cpp index 5f1629b3560..3b87852af95 100644 --- a/fdbserver/workloads/BlobGranuleVerifier.actor.cpp +++ b/fdbserver/workloads/BlobGranuleVerifier.actor.cpp @@ -50,6 +50,7 @@ * To catch availability issues with the blob worker, it does a request to each granule at the end of the test. */ struct BlobGranuleVerifierWorkload : TestWorkload { + static constexpr auto NAME = "BlobGranuleVerifier"; bool doSetup; double testDuration; double timeTravelLimit; @@ -172,7 +173,6 @@ struct BlobGranuleVerifierWorkload : TestWorkload { } } - std::string description() const override { return "BlobGranuleVerifier"; } Future setup(Database const& cx) override { return _setup(cx, this); } ACTOR Future _setup(Database cx, BlobGranuleVerifierWorkload* self) { @@ -1236,4 +1236,4 @@ struct BlobGranuleVerifierWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory BlobGranuleVerifierWorkloadFactory("BlobGranuleVerifier"); +WorkloadFactory BlobGranuleVerifierWorkloadFactory; diff --git a/fdbserver/workloads/BulkLoad.actor.cpp b/fdbserver/workloads/BulkLoad.actor.cpp index e5726cdfcbf..cc5447c321f 100644 --- a/fdbserver/workloads/BulkLoad.actor.cpp +++ b/fdbserver/workloads/BulkLoad.actor.cpp @@ -25,6 +25,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct BulkLoadWorkload : TestWorkload { + static constexpr auto NAME = "BulkLoad"; int clientCount, actorCount, writesPerTransaction, valueBytes; double testDuration; Value value; @@ -48,8 +49,6 @@ struct BulkLoadWorkload : TestWorkload { keyPrefix = unprintable(keyPrefix.toString()); } - std::string description() const override { return "BulkLoad"; } - Future start(Database const& cx) override { for (int c = 0; c < actorCount; c++) clients.push_back(timeout(bulkLoadClient(cx, this, clientId, c), testDuration, Void())); @@ -115,4 +114,4 @@ struct BulkLoadWorkload : TestWorkload { } }; -WorkloadFactory BulkLoadWorkloadFactory("BulkLoad"); +WorkloadFactory BulkLoadWorkloadFactory; diff --git a/fdbserver/workloads/BulkSetup.actor.cpp b/fdbserver/workloads/BulkSetup.actor.cpp index db797722a5a..7bcb3320be6 100644 --- a/fdbserver/workloads/BulkSetup.actor.cpp +++ b/fdbserver/workloads/BulkSetup.actor.cpp @@ -26,6 +26,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct BulkSetupWorkload : TestWorkload { + static constexpr auto NAME = "BulkSetup"; std::vector tenantNames; int nodeCount; @@ -42,8 +43,6 @@ struct BulkSetupWorkload : TestWorkload { } } - std::string description() const override { return "BulkSetup"; } - void getMetrics(std::vector& m) override {} Key keyForIndex(int n) { return key(n); } @@ -72,4 +71,4 @@ struct BulkSetupWorkload : TestWorkload { Future check(Database const& cx) override { return true; } }; -WorkloadFactory BulkSetupWorkloadFactory("BulkSetup"); +WorkloadFactory BulkSetupWorkloadFactory; diff --git a/fdbserver/workloads/Cache.actor.cpp b/fdbserver/workloads/Cache.actor.cpp index 23bd9e3d92f..d4ae2381c17 100644 --- a/fdbserver/workloads/Cache.actor.cpp +++ b/fdbserver/workloads/Cache.actor.cpp @@ -24,13 +24,13 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct CacheWorkload : TestWorkload { + static constexpr auto NAME = "Cache"; Key keyPrefix; CacheWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { keyPrefix = unprintable(getOption(options, "keyPrefix"_sr, ""_sr).toString()); } - std::string description() const override { return "CacheWorkload"; } Future setup(Database const& cx) override { if (clientId == 0) { // Call management API to cache keys under the given prefix @@ -43,4 +43,4 @@ struct CacheWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory CacheWorkloadFactory("Cache"); +WorkloadFactory CacheWorkloadFactory; diff --git a/fdbserver/workloads/ChangeConfig.actor.cpp b/fdbserver/workloads/ChangeConfig.actor.cpp index 5e2af183b98..5882cc1df6c 100644 --- a/fdbserver/workloads/ChangeConfig.actor.cpp +++ b/fdbserver/workloads/ChangeConfig.actor.cpp @@ -30,6 +30,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct ChangeConfigWorkload : TestWorkload { + static constexpr auto NAME = "ChangeConfig"; double minDelayBeforeChange, maxDelayBeforeChange; std::string configMode; //<\"single\"|\"double\"|\"triple\"> std::string networkAddresses; // comma separated list e.g. "127.0.0.1:4000,127.0.0.1:4001" @@ -47,8 +48,6 @@ struct ChangeConfigWorkload : TestWorkload { } } - std::string description() const override { return "ChangeConfig"; } - void disableFailureInjectionWorkloads(std::set& out) const override { out.insert("all"); } Future start(Database const& cx) override { @@ -226,4 +225,4 @@ struct ChangeConfigWorkload : TestWorkload { } }; -WorkloadFactory ChangeConfigWorkloadFactory("ChangeConfig"); +WorkloadFactory ChangeConfigWorkloadFactory; diff --git a/fdbserver/workloads/ChangeFeedOperations.actor.cpp b/fdbserver/workloads/ChangeFeedOperations.actor.cpp index a0b1bf99236..7517c6f98d6 100644 --- a/fdbserver/workloads/ChangeFeedOperations.actor.cpp +++ b/fdbserver/workloads/ChangeFeedOperations.actor.cpp @@ -372,6 +372,7 @@ enum Op { }; struct ChangeFeedOperationsWorkload : TestWorkload { + static constexpr auto NAME = "ChangeFeedOperations"; // test settings double testDuration; int operationsPerSecond; @@ -513,7 +514,6 @@ struct ChangeFeedOperationsWorkload : TestWorkload { } } - std::string description() const override { return "ChangeFeedOperationsWorkload"; } Future setup(Database const& cx) override { return _setup(cx, this); } ACTOR Future _setup(Database cx, ChangeFeedOperationsWorkload* self) { @@ -772,4 +772,4 @@ struct ChangeFeedOperationsWorkload : TestWorkload { } }; -WorkloadFactory ChangeFeedOperationsWorkloadFactory("ChangeFeedOperations"); +WorkloadFactory ChangeFeedOperationsWorkloadFactory; diff --git a/fdbserver/workloads/ChangeFeeds.actor.cpp b/fdbserver/workloads/ChangeFeeds.actor.cpp index 580a07072a5..f66fc5e9b93 100644 --- a/fdbserver/workloads/ChangeFeeds.actor.cpp +++ b/fdbserver/workloads/ChangeFeeds.actor.cpp @@ -165,6 +165,7 @@ bool compareData(Standalone> source, Standalone client; @@ -172,7 +173,6 @@ struct ChangeFeedsWorkload : TestWorkload { testDuration = getOption(options, "testDuration"_sr, 10.0); } - std::string description() const override { return "ChangeFeedsWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (clientId == 0) { @@ -235,4 +235,4 @@ struct ChangeFeedsWorkload : TestWorkload { } }; -WorkloadFactory ChangeFeedsWorkloadFactory("ChangeFeeds"); +WorkloadFactory ChangeFeedsWorkloadFactory; diff --git a/fdbserver/workloads/ClearSingleRange.actor.cpp b/fdbserver/workloads/ClearSingleRange.actor.cpp index 38565bed4c4..ada165bde7e 100644 --- a/fdbserver/workloads/ClearSingleRange.actor.cpp +++ b/fdbserver/workloads/ClearSingleRange.actor.cpp @@ -25,6 +25,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct ClearSingleRange : TestWorkload { + static constexpr auto NAME = "ClearSingleRange"; Key begin; Key end; double startDelay; @@ -34,9 +35,7 @@ struct ClearSingleRange : TestWorkload { end = getOption(options, "end"_sr, normalKeys.end); startDelay = getOption(options, "beginClearRange"_sr, 10.0); } - - std::string description() const override { return "ClearSingleRangeWorkload"; } - + Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return clientId != 0 ? Void() : fdbClientClearRange(cx, this); } @@ -64,4 +63,4 @@ struct ClearSingleRange : TestWorkload { } }; -WorkloadFactory ClearSingleRangeWorkloadFactory("ClearSingleRange"); +WorkloadFactory ClearSingleRangeWorkloadFactory; diff --git a/fdbserver/workloads/ClientTransactionProfileCorrectness.actor.cpp b/fdbserver/workloads/ClientTransactionProfileCorrectness.actor.cpp index 6366d0060b0..1a9ccd4bfb8 100644 --- a/fdbserver/workloads/ClientTransactionProfileCorrectness.actor.cpp +++ b/fdbserver/workloads/ClientTransactionProfileCorrectness.actor.cpp @@ -197,6 +197,7 @@ bool checkTxInfoEntryFormat(BinaryReader& reader) { } struct ClientTransactionProfileCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "ClientTransactionProfileCorrectness"; double samplingProbability; int64_t trInfoSizeLimit; @@ -212,9 +213,7 @@ struct ClientTransactionProfileCorrectnessWorkload : TestWorkload { .detail("SamplingProbability", samplingProbability) .detail("TrInfoSizeLimit", trInfoSizeLimit); } - - std::string description() const override { return "ClientTransactionProfileCorrectness"; } - + Future setup(Database const& cx) override { if (clientId == 0) { IKnobCollection::getMutableGlobalKnobCollection().setKnob("csi_status_delay", @@ -368,5 +367,4 @@ struct ClientTransactionProfileCorrectnessWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory ClientTransactionProfileCorrectnessWorkloadFactory( - "ClientTransactionProfileCorrectness"); +WorkloadFactory ClientTransactionProfileCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/ClogSingleConnection.actor.cpp b/fdbserver/workloads/ClogSingleConnection.actor.cpp index 0852a562e07..82edd79af9c 100644 --- a/fdbserver/workloads/ClogSingleConnection.actor.cpp +++ b/fdbserver/workloads/ClogSingleConnection.actor.cpp @@ -29,6 +29,7 @@ class ClogSingleConnectionWorkload : public TestWorkload { Optional clogDuration; // If empty, clog forever public: + static constexpr auto NAME = "ClogSingleConnection"; ClogSingleConnectionWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { auto minDelay = getOption(options, "minDelay"_sr, 0.0); auto maxDelay = getOption(options, "maxDelay"_sr, 10.0); @@ -39,9 +40,6 @@ class ClogSingleConnectionWorkload : public TestWorkload { } } - std::string description() const override { - return g_network->isSimulated() ? "ClogSingleConnection" : "NoClogging"; - } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -68,4 +66,4 @@ class ClogSingleConnectionWorkload : public TestWorkload { } }; -WorkloadFactory ClogSingleConnectionWorkloadFactory("ClogSingleConnection"); +WorkloadFactory ClogSingleConnectionWorkloadFactory; diff --git a/fdbserver/workloads/CommitBugCheck.actor.cpp b/fdbserver/workloads/CommitBugCheck.actor.cpp index 89a6f3b67e6..d776650e4a8 100644 --- a/fdbserver/workloads/CommitBugCheck.actor.cpp +++ b/fdbserver/workloads/CommitBugCheck.actor.cpp @@ -24,12 +24,11 @@ // Regression tests for 2 commit related bugs struct CommitBugWorkload : TestWorkload { + static constexpr auto NAME = "CommitBug"; bool success; CommitBugWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { success = true; } - std::string description() const override { return "CommitBugWorkload"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return timeout(bug1(cx, this) && bug2(cx, this), 60, Void()); } @@ -157,4 +156,4 @@ struct CommitBugWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory CommitBugWorkloadFactory("CommitBug"); +WorkloadFactory CommitBugWorkloadFactory; diff --git a/fdbserver/workloads/ConfigIncrement.actor.cpp b/fdbserver/workloads/ConfigIncrement.actor.cpp index fb8ae79974d..8e7a899b633 100644 --- a/fdbserver/workloads/ConfigIncrement.actor.cpp +++ b/fdbserver/workloads/ConfigIncrement.actor.cpp @@ -128,6 +128,7 @@ class ConfigIncrementWorkload : public TestWorkload { } public: + static constexpr auto NAME = "ConfigIncrement"; ConfigIncrementWorkload(WorkloadContext const& wcx) : TestWorkload(wcx), transactions("Transactions"), retries("Retries"), commitUnknownResult("CommitUnknownResult") { @@ -137,8 +138,6 @@ class ConfigIncrementWorkload : public TestWorkload { meanSleepBetweenTransactions = getOption(options, "meanSleepBetweenTransactions"_sr, 0.1); } - std::string description() const override { return "ConfigIncrementWorkload"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -161,6 +160,6 @@ class ConfigIncrementWorkload : public TestWorkload { } }; -WorkloadFactory ConfigIncrementWorkloadFactory("ConfigIncrement"); +WorkloadFactory ConfigIncrementWorkloadFactory; KeyRef const ConfigIncrementWorkload::testKnobName = "test_int"_sr; diff --git a/fdbserver/workloads/ConfigureDatabase.actor.cpp b/fdbserver/workloads/ConfigureDatabase.actor.cpp index 76fce0eb3d5..6ccec4a9cd6 100644 --- a/fdbserver/workloads/ConfigureDatabase.actor.cpp +++ b/fdbserver/workloads/ConfigureDatabase.actor.cpp @@ -224,6 +224,7 @@ std::string generateRegions() { } struct ConfigureDatabaseWorkload : TestWorkload { + static constexpr auto NAME = "ConfigureDatabase"; double testDuration; int additionalDBs; bool allowDescriptorChange; @@ -246,8 +247,6 @@ struct ConfigureDatabaseWorkload : TestWorkload { g_simulator->usableRegions = 1; } - std::string description() const override { return "DestroyDatabaseWorkload"; } - void disableFailureInjectionWorkloads(std::set& out) const override { out.insert("MachineAttritionWorkload"); } @@ -478,4 +477,4 @@ struct ConfigureDatabaseWorkload : TestWorkload { } }; -WorkloadFactory DestroyDatabaseWorkloadFactory("ConfigureDatabase"); +WorkloadFactory DestroyDatabaseWorkloadFactory; diff --git a/fdbserver/workloads/ConflictRange.actor.cpp b/fdbserver/workloads/ConflictRange.actor.cpp index daf45740fc4..2bd799f0e61 100644 --- a/fdbserver/workloads/ConflictRange.actor.cpp +++ b/fdbserver/workloads/ConflictRange.actor.cpp @@ -29,6 +29,7 @@ // (sim2.actor.cpp) struct ConflictRangeWorkload : TestWorkload { + static constexpr auto NAME = "ConflictRange"; int minOperationsPerTransaction, maxOperationsPerTransaction, maxKeySpace, maxOffset, minInitialAmount, maxInitialAmount; double testDuration; @@ -46,9 +47,7 @@ struct ConflictRangeWorkload : TestWorkload { testDuration = getOption(options, "testDuration"_sr, 10.0); testReadYourWrites = getOption(options, "testReadYourWrites"_sr, false); } - - std::string description() const override { return "ConflictRange"; } - + Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return _start(cx, this); } @@ -407,4 +406,4 @@ struct ConflictRangeWorkload : TestWorkload { } }; -WorkloadFactory ConflictRangeWorkloadFactory("ConflictRange"); +WorkloadFactory ConflictRangeWorkloadFactory; diff --git a/fdbserver/workloads/ConsistencyCheck.actor.cpp b/fdbserver/workloads/ConsistencyCheck.actor.cpp index d4bf710ccbd..03f5d3a0e45 100644 --- a/fdbserver/workloads/ConsistencyCheck.actor.cpp +++ b/fdbserver/workloads/ConsistencyCheck.actor.cpp @@ -41,10 +41,11 @@ #include "flow/actorcompiler.h" // This must be the last #include. -//#define SevCCheckInfo SevVerbose +// #define SevCCheckInfo SevVerbose #define SevCCheckInfo SevInfo struct ConsistencyCheckWorkload : TestWorkload { + static constexpr auto NAME = "ConsistencyCheck"; // Whether or not we should perform checks that will only pass if the database is in a quiescent state bool performQuiescentChecks; @@ -117,9 +118,7 @@ struct ConsistencyCheckWorkload : TestWorkload { repetitions = 0; bytesReadInPreviousRound = 0; } - - std::string description() const override { return "ConsistencyCheck"; } - + Future setup(Database const& cx) override { return _setup(cx, this); } ACTOR Future _setup(Database cx, ConsistencyCheckWorkload* self) { @@ -1559,4 +1558,4 @@ struct ConsistencyCheckWorkload : TestWorkload { } }; -WorkloadFactory ConsistencyCheckWorkloadFactory("ConsistencyCheck"); +WorkloadFactory ConsistencyCheckWorkloadFactory; diff --git a/fdbserver/workloads/CpuProfiler.actor.cpp b/fdbserver/workloads/CpuProfiler.actor.cpp index f5ebbf21741..c2b344804cd 100644 --- a/fdbserver/workloads/CpuProfiler.actor.cpp +++ b/fdbserver/workloads/CpuProfiler.actor.cpp @@ -26,6 +26,7 @@ // A workload which starts the CPU profiler at a given time and duration on all workers in a cluster struct CpuProfilerWorkload : TestWorkload { + static constexpr auto NAME = "CpuProfiler"; bool success; // How long to run the workload before starting the profiler @@ -47,9 +48,7 @@ struct CpuProfilerWorkload : TestWorkload { roles = getOption(options, "roles"_sr, std::vector()); success = true; } - - std::string description() const override { return "CpuProfiler"; } - + Future setup(Database const& cx) override { return Void(); } // Turns the profiler on or off @@ -134,4 +133,4 @@ struct CpuProfilerWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory CpuProfilerWorkloadFactory("CpuProfiler"); +WorkloadFactory CpuProfilerWorkloadFactory; diff --git a/fdbserver/workloads/CreateTenant.actor.cpp b/fdbserver/workloads/CreateTenant.actor.cpp index 624ebce1776..e263d3c6c37 100644 --- a/fdbserver/workloads/CreateTenant.actor.cpp +++ b/fdbserver/workloads/CreateTenant.actor.cpp @@ -26,13 +26,13 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct CreateTenantWorkload : TestWorkload { + static constexpr auto NAME = "CreateTenant"; TenantName tenant; CreateTenantWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { tenant = getOption(options, "name"_sr, "DefaultTenant"_sr); } - std::string description() const override { return "CreateTenant"; } Future setup(Database const& cx) override { if (clientId == 0) { return _setup(this, cx); @@ -59,4 +59,4 @@ struct CreateTenantWorkload : TestWorkload { } }; -WorkloadFactory CreateTenantWorkload("CreateTenant"); +WorkloadFactory CreateTenantWorkload; diff --git a/fdbserver/workloads/Cycle.actor.cpp b/fdbserver/workloads/Cycle.actor.cpp index 3ceaead9f07..53d0e3cb721 100644 --- a/fdbserver/workloads/Cycle.actor.cpp +++ b/fdbserver/workloads/Cycle.actor.cpp @@ -18,8 +18,6 @@ * limitations under the License. */ -#include - #include "flow/Arena.h" #include "flow/IRandom.h" #include "flow/Trace.h" @@ -48,6 +46,7 @@ struct CycleMembers { template struct CycleWorkload : TestWorkload, CycleMembers { + static constexpr auto NAME = MultiTenancy ? "TenantCycle" : "Cycle"; int actorCount, nodeCount; double testDuration, transactionsPerSecond, minExpectedTransactionsPerSecond, traceParentProbability; Key keyPrefix; @@ -87,14 +86,6 @@ struct CycleWorkload : TestWorkload, CycleMembers { } } - std::string description() const override { - if constexpr (MultiTenancy) { - return "TenantCycleWorkload"; - } else { - return "CycleWorkload"; - } - } - Future setup(Database const& cx) override { if constexpr (MultiTenancy) { cx->defaultTenant = this->tenant; @@ -337,5 +328,5 @@ struct CycleWorkload : TestWorkload, CycleMembers { } }; -WorkloadFactory> CycleWorkloadFactory("Cycle", false); -WorkloadFactory> TenantCycleWorkloadFactory("TenantCycle", true); +WorkloadFactory> CycleWorkloadFactory(false); +WorkloadFactory> TenantCycleWorkloadFactory(true); diff --git a/fdbserver/workloads/DDBalance.actor.cpp b/fdbserver/workloads/DDBalance.actor.cpp index 1b7b992e4a6..efd3dbfb84f 100644 --- a/fdbserver/workloads/DDBalance.actor.cpp +++ b/fdbserver/workloads/DDBalance.actor.cpp @@ -25,6 +25,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct DDBalanceWorkload : TestWorkload { + static constexpr auto NAME = "DDBalance"; int actorsPerClient, nodesPerActor, moversPerClient, currentbin, binCount, writesPerTransaction, keySpaceDriftFactor; double testDuration, warmingDelay, transactionsPerSecond; @@ -53,8 +54,6 @@ struct DDBalanceWorkload : TestWorkload { currentbin = deterministicRandom()->randomInt(0, binCount); } - std::string description() const override { return "DDBalance"; } - Future setup(Database const& cx) override { return ddbalanceSetup(cx, this); } Future start(Database const& cx) override { return _start(cx, this); } @@ -259,4 +258,4 @@ struct DDBalanceWorkload : TestWorkload { } }; -WorkloadFactory DDBalanceWorkloadFactory("DDBalance"); +WorkloadFactory DDBalanceWorkloadFactory; diff --git a/fdbserver/workloads/DDMetrics.actor.cpp b/fdbserver/workloads/DDMetrics.actor.cpp index 7fcb018a6f4..a2e52fe828d 100644 --- a/fdbserver/workloads/DDMetrics.actor.cpp +++ b/fdbserver/workloads/DDMetrics.actor.cpp @@ -27,14 +27,13 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct DDMetricsWorkload : TestWorkload { + static constexpr auto NAME = "DDMetrics"; double startDelay, ddDone; DDMetricsWorkload(WorkloadContext const& wcx) : TestWorkload(wcx), ddDone(0.0) { startDelay = getOption(options, "beginPoll"_sr, 10.0); } - std::string description() const override { return "Data Distribution Metrics"; } - ACTOR Future getHighPriorityRelocationsInFlight(Database cx, DDMetricsWorkload* self) { WorkerInterface masterWorker = wait(getMasterWorker(cx, self->dbInfo)); @@ -74,4 +73,4 @@ struct DDMetricsWorkload : TestWorkload { void getMetrics(std::vector& m) override { m.emplace_back("DDDuration", ddDone, Averaged::False); } }; -WorkloadFactory DDMetricsWorkloadFactory("DDMetrics"); +WorkloadFactory DDMetricsWorkloadFactory; diff --git a/fdbserver/workloads/DDMetricsExclude.actor.cpp b/fdbserver/workloads/DDMetricsExclude.actor.cpp index 9aca58b5703..890de774e31 100644 --- a/fdbserver/workloads/DDMetricsExclude.actor.cpp +++ b/fdbserver/workloads/DDMetricsExclude.actor.cpp @@ -27,6 +27,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct DDMetricsExcludeWorkload : TestWorkload { + static constexpr auto NAME = "DDMetricsExclude"; double ddDone; Value excludeIp; int excludePort; @@ -91,7 +92,6 @@ struct DDMetricsExcludeWorkload : TestWorkload { return Void(); } - std::string description() const override { return "Data Distribution Metrics Exclude"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return _start(cx, this); } Future check(Database const& cx) override { @@ -108,4 +108,4 @@ struct DDMetricsExcludeWorkload : TestWorkload { } }; -WorkloadFactory DDMetricsExcludeWorkloadFactory("DDMetricsExclude"); +WorkloadFactory DDMetricsExcludeWorkloadFactory; diff --git a/fdbserver/workloads/DataDistributionMetrics.actor.cpp b/fdbserver/workloads/DataDistributionMetrics.actor.cpp index cdaf2cb5b51..0ce4b285d44 100644 --- a/fdbserver/workloads/DataDistributionMetrics.actor.cpp +++ b/fdbserver/workloads/DataDistributionMetrics.actor.cpp @@ -27,6 +27,7 @@ #include "flow/actorcompiler.h" // This must be the last include struct DataDistributionMetricsWorkload : KVWorkload { + static constexpr auto NAME = "DataDistributionMetrics"; int numShards, readPerTx, writePerTx; int64_t avgBytes, transactionTimeLimit; @@ -199,7 +200,6 @@ struct DataDistributionMetricsWorkload : KVWorkload { return Void(); } - std::string description() const override { return "DataDistributionMetrics"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return _start(cx, this); } @@ -216,4 +216,4 @@ struct DataDistributionMetricsWorkload : KVWorkload { } }; -WorkloadFactory DataDistributionMetricsWorkloadFactory("DataDistributionMetrics"); +WorkloadFactory DataDistributionMetricsWorkloadFactory; diff --git a/fdbserver/workloads/DataLossRecovery.actor.cpp b/fdbserver/workloads/DataLossRecovery.actor.cpp index 996c403efbd..246357b45ec 100644 --- a/fdbserver/workloads/DataLossRecovery.actor.cpp +++ b/fdbserver/workloads/DataLossRecovery.actor.cpp @@ -42,6 +42,7 @@ std::string printValue(const ErrorOr>& value) { } // namespace struct DataLossRecoveryWorkload : TestWorkload { + static constexpr auto NAME = "DataLossRecovery"; FlowLock startMoveKeysParallelismLock; FlowLock finishMoveKeysParallelismLock; const bool enabled; @@ -59,8 +60,6 @@ struct DataLossRecoveryWorkload : TestWorkload { pass = false; } - std::string description() const override { return "DataLossRecovery"; } - Future setup(Database const& cx) override { return Void(); } void disableFailureInjectionWorkloads(std::set& out) const override { out.insert("MoveKeysWorkload"); } @@ -269,4 +268,4 @@ struct DataLossRecoveryWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory DataLossRecoveryWorkloadFactory("DataLossRecovery"); +WorkloadFactory DataLossRecoveryWorkloadFactory; diff --git a/fdbserver/workloads/DifferentClustersSameRV.actor.cpp b/fdbserver/workloads/DifferentClustersSameRV.actor.cpp index 0e9bf3d1ed0..39873ac4902 100644 --- a/fdbserver/workloads/DifferentClustersSameRV.actor.cpp +++ b/fdbserver/workloads/DifferentClustersSameRV.actor.cpp @@ -36,6 +36,7 @@ void traceError(const char* filename, int line, Error const& e) { // A workload attempts to read from two different clusters with the same read version. struct DifferentClustersSameRVWorkload : TestWorkload { + static constexpr auto NAME = "DifferentClustersSameRV"; Database originalDB; Database extraDB; double testDuration; @@ -53,8 +54,6 @@ struct DifferentClustersSameRVWorkload : TestWorkload { keyToWatch = getOption(options, "keyToWatch"_sr, "anotherKey"_sr); } - std::string description() const override { return "DifferentClustersSameRV"; } - Future setup(Database const& cx) override { if (clientId != 0) { return Void(); @@ -294,4 +293,4 @@ struct DifferentClustersSameRVWorkload : TestWorkload { } }; -WorkloadFactory DifferentClustersSameRVWorkloadFactory("DifferentClustersSameRV"); +WorkloadFactory DifferentClustersSameRVWorkloadFactory; diff --git a/fdbserver/workloads/DiskDurability.actor.cpp b/fdbserver/workloads/DiskDurability.actor.cpp index 0d5048e6b4a..cbcdf45a93c 100644 --- a/fdbserver/workloads/DiskDurability.actor.cpp +++ b/fdbserver/workloads/DiskDurability.actor.cpp @@ -26,6 +26,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct DiskDurabilityWorkload : public AsyncFileWorkload { + static constexpr auto NAME = "DiskDurability"; struct FileBlock { FileBlock(int blockNum) : blockNum(blockNum), lastData(0), lock(new FlowLock(1)) {} ~FileBlock() {} @@ -99,8 +100,6 @@ struct DiskDurabilityWorkload : public AsyncFileWorkload { ~DiskDurabilityWorkload() override {} - std::string description() const override { return "DiskDurability"; } - Future setup(Database const& cx) override { if (enabled) return _setup(this); @@ -184,4 +183,4 @@ struct DiskDurabilityWorkload : public AsyncFileWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory DiskDurabilityWorkloadFactory("DiskDurability"); +WorkloadFactory DiskDurabilityWorkloadFactory; diff --git a/fdbserver/workloads/DiskDurabilityTest.actor.cpp b/fdbserver/workloads/DiskDurabilityTest.actor.cpp index 836f7217f28..9ccaa100ee1 100644 --- a/fdbserver/workloads/DiskDurabilityTest.actor.cpp +++ b/fdbserver/workloads/DiskDurabilityTest.actor.cpp @@ -26,6 +26,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct DiskDurabilityTest : TestWorkload { + static constexpr auto NAME = "DiskDurabilityTest"; bool enabled; std::string filename; KeyRange range, metrics; @@ -38,7 +39,6 @@ struct DiskDurabilityTest : TestWorkload { metrics = prefixRange(prefix); } - std::string description() const override { return "DiskDurabilityTest"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (enabled) @@ -184,4 +184,4 @@ struct DiskDurabilityTest : TestWorkload { } } }; -WorkloadFactory DiskDurabilityTestFactory("DiskDurabilityTest"); +WorkloadFactory DiskDurabilityTestFactory; diff --git a/fdbserver/workloads/DiskFailureInjection.actor.cpp b/fdbserver/workloads/DiskFailureInjection.actor.cpp index 319b9849f7f..95e6099346b 100644 --- a/fdbserver/workloads/DiskFailureInjection.actor.cpp +++ b/fdbserver/workloads/DiskFailureInjection.actor.cpp @@ -29,6 +29,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct DiskFailureInjectionWorkload : FailureInjectionWorkload { + static constexpr auto NAME = "DiskFailureInjection"; bool enabled; double testDuration = 60.0; double startDelay = 0.0; @@ -68,13 +69,6 @@ struct DiskFailureInjectionWorkload : FailureInjectionWorkload { void initFailureInjectionMode(DeterministicRandom& random) override { enabled = clientId == 0; } - std::string description() const override { - if (g_simulator == g_network) - return "DiskFailureInjection"; - else - return "NoSimDiskFailureInjection"; - } - Future setup(Database const& cx) override { return Void(); } // Starts the workload by - @@ -278,5 +272,5 @@ struct DiskFailureInjectionWorkload : FailureInjectionWorkload { } } }; -WorkloadFactory DiskFailureInjectionWorkloadFactory("DiskFailureInjection"); +WorkloadFactory DiskFailureInjectionWorkloadFactory; FailureInjectorFactory DiskFailureInjectionWorkloadFailureInjectionFactory; diff --git a/fdbserver/workloads/DummyWorkload.actor.cpp b/fdbserver/workloads/DummyWorkload.actor.cpp index a908085b3e3..7dbd0de0407 100644 --- a/fdbserver/workloads/DummyWorkload.actor.cpp +++ b/fdbserver/workloads/DummyWorkload.actor.cpp @@ -23,6 +23,7 @@ // The workload that do nothing. It can be used for waiting for quiescence struct DummyWorkload : TestWorkload { + static constexpr auto NAME = "DummyWorkload"; bool displayWorkers; double displayDelay; @@ -31,8 +32,6 @@ struct DummyWorkload : TestWorkload { displayDelay = getOption(options, "displayDelay"_sr, 0.0); } - std::string description() const override { return "DummyWorkload"; } - Future start(Database const& cx) override { if ((clientId == 0) && (displayWorkers)) { return _start(this, cx); @@ -52,4 +51,4 @@ struct DummyWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory DummyWorkloadFactory("DummyWorkload"); +WorkloadFactory DummyWorkloadFactory; diff --git a/fdbserver/workloads/EncryptKeyProxyTest.actor.cpp b/fdbserver/workloads/EncryptKeyProxyTest.actor.cpp index 970b3162bf8..4b19e1034f1 100644 --- a/fdbserver/workloads/EncryptKeyProxyTest.actor.cpp +++ b/fdbserver/workloads/EncryptKeyProxyTest.actor.cpp @@ -39,6 +39,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct EncryptKeyProxyTestWorkload : TestWorkload { + static constexpr auto NAME = "EncryptKeyProxyTest"; EncryptKeyProxyInterface ekpInf; Reference const> dbInfo; Arena arena; @@ -61,8 +62,6 @@ struct EncryptKeyProxyTestWorkload : TestWorkload { } } - std::string description() const override { return "EncryptKeyProxyTest"; } - Future setup(Database const& ctx) override { return Void(); } ACTOR Future simEmptyDomainIdCache(EncryptKeyProxyTestWorkload* self) { @@ -344,4 +343,4 @@ struct EncryptKeyProxyTestWorkload : TestWorkload { std::atomic EncryptKeyProxyTestWorkload::seed = 0; -WorkloadFactory EncryptKeyProxyTestWorkloadFactory("EncryptKeyProxyTest"); +WorkloadFactory EncryptKeyProxyTestWorkloadFactory; diff --git a/fdbserver/workloads/EncryptionOps.actor.cpp b/fdbserver/workloads/EncryptionOps.actor.cpp index ca75a395659..83ca7fccc0f 100644 --- a/fdbserver/workloads/EncryptionOps.actor.cpp +++ b/fdbserver/workloads/EncryptionOps.actor.cpp @@ -109,6 +109,7 @@ struct WorkloadMetrics { // 3. Time spent decrypting the buffer (doesn't incude key lookup time); also records the throughput in MB/sec. struct EncryptionOpsWorkload : TestWorkload { + static constexpr auto NAME = "EncryptionOps"; int mode; int64_t numIterations; int pageSize; @@ -489,8 +490,6 @@ struct EncryptionOpsWorkload : TestWorkload { Future setup(Database const& ctx) override { return Void(); } - std::string description() const override { return "EncryptionOps"; } - Future start(Database const& cx) override { return _start(cx, this); } ACTOR Future _start(Database cx, EncryptionOpsWorkload* self) { @@ -506,4 +505,4 @@ struct EncryptionOpsWorkload : TestWorkload { void getMetrics(std::vector& m) override { metrics->recordMetrics(getModeStr(), numIterations); } }; -WorkloadFactory EncryptionOpsWorkloadFactory("EncryptionOps"); +WorkloadFactory EncryptionOpsWorkloadFactory; diff --git a/fdbserver/workloads/ExternalWorkload.actor.cpp b/fdbserver/workloads/ExternalWorkload.actor.cpp index dde3c04c477..b7d3164ddcf 100644 --- a/fdbserver/workloads/ExternalWorkload.actor.cpp +++ b/fdbserver/workloads/ExternalWorkload.actor.cpp @@ -107,7 +107,7 @@ struct ExternalWorkload : TestWorkload, FDBWorkloadContext { FDBWorkloadFactory* (*workloadFactory)(FDBLogger*); std::shared_ptr workloadImpl; - constexpr static const char* NAME = "External"; + constexpr static auto NAME = "External"; static std::string getDefaultLibraryPath() { auto self = exePath(); @@ -163,8 +163,6 @@ struct ExternalWorkload : TestWorkload, FDBWorkloadContext { } } - std::string description() const override { return NAME; } - ACTOR Future assertTrue(StringRef stage, Future f) { bool res = wait(f); if (!res) { @@ -278,4 +276,4 @@ struct ExternalWorkload : TestWorkload, FDBWorkloadContext { }; } // namespace -WorkloadFactory CycleWorkloadFactory(ExternalWorkload::NAME); +WorkloadFactory CycleWorkloadFactory; diff --git a/fdbserver/workloads/FastTriggeredWatches.actor.cpp b/fdbserver/workloads/FastTriggeredWatches.actor.cpp index cafdda2fc8b..32ba9ed1a66 100644 --- a/fdbserver/workloads/FastTriggeredWatches.actor.cpp +++ b/fdbserver/workloads/FastTriggeredWatches.actor.cpp @@ -27,6 +27,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct FastTriggeredWatchesWorkload : TestWorkload { + static constexpr auto NAME = "FastTriggeredWatches"; // Tests the time it takes for a watch to be fired after the value has changed in the storage server int nodes, keyBytes; double testDuration; @@ -42,8 +43,6 @@ struct FastTriggeredWatchesWorkload : TestWorkload { keyBytes = std::max(getOption(options, "keyBytes"_sr, 16), 16); } - std::string description() const override { return "Watches"; } - Future setup(Database const& cx) override { if (clientId == 0) return _setup(cx, this); @@ -182,4 +181,4 @@ struct FastTriggeredWatchesWorkload : TestWorkload { } }; -WorkloadFactory FastTriggeredWatchesWorkloadFactory("FastTriggeredWatches"); +WorkloadFactory FastTriggeredWatchesWorkloadFactory; diff --git a/fdbserver/workloads/FileSystem.actor.cpp b/fdbserver/workloads/FileSystem.actor.cpp index b5340e9c120..722c1c59ac2 100644 --- a/fdbserver/workloads/FileSystem.actor.cpp +++ b/fdbserver/workloads/FileSystem.actor.cpp @@ -25,6 +25,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct FileSystemWorkload : TestWorkload { + static constexpr auto NAME = "FileSystem"; int actorCount, writeActorCount, fileCount, pathMinChars, pathCharRange, serverCount, userIDCount; double testDuration, transactionsPerSecond, deletedFilesRatio; bool discardEdgeMeasurements, performingWrites, loggingQueries; @@ -61,8 +62,6 @@ struct FileSystemWorkload : TestWorkload { loggingQueries = getOption(options, "loggingQueries"_sr, false); } - std::string description() const override { return "ReadWrite"; } - Future setup(Database const& cx) override { return nodeSetup(cx, this); } Future start(Database const& cx) override { return _start(cx, this); } @@ -334,4 +333,4 @@ struct FileSystemWorkload : TestWorkload { }; }; -WorkloadFactory FileSystemWorkloadFactory("FileSystem"); +WorkloadFactory FileSystemWorkloadFactory; diff --git a/fdbserver/workloads/Fuzz.cpp b/fdbserver/workloads/Fuzz.cpp index d26726c3e66..dc21072de77 100644 --- a/fdbserver/workloads/Fuzz.cpp +++ b/fdbserver/workloads/Fuzz.cpp @@ -23,6 +23,7 @@ #include "fdbserver/workloads/workloads.actor.h" struct ActorFuzzWorkload : TestWorkload { + static constexpr auto NAME = "ActorFuzz"; bool enabled; std::pair fuzzResults; @@ -30,7 +31,6 @@ struct ActorFuzzWorkload : TestWorkload { enabled = !clientId; // only do this on the "first" client } - std::string description() const override { return "ActorFuzzWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (enabled) { @@ -51,4 +51,4 @@ struct ActorFuzzWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory ActorFuzzWorkloadFactory("ActorFuzz"); +WorkloadFactory ActorFuzzWorkloadFactory; diff --git a/fdbserver/workloads/FuzzApiCorrectness.actor.cpp b/fdbserver/workloads/FuzzApiCorrectness.actor.cpp index 8342e35f9f6..2a8602f106c 100644 --- a/fdbserver/workloads/FuzzApiCorrectness.actor.cpp +++ b/fdbserver/workloads/FuzzApiCorrectness.actor.cpp @@ -106,6 +106,7 @@ struct ExceptionContract { }; struct FuzzApiCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "FuzzApiCorrectness"; static std::once_flag onceFlag; static std::vector(unsigned int const&, FuzzApiCorrectnessWorkload* const&, Reference const&)>> @@ -208,8 +209,6 @@ struct FuzzApiCorrectnessWorkload : TestWorkload { .detail("NewSeverity", SevInfo); } - std::string description() const override { return "FuzzApiCorrectness"; } - static TenantName getTenant(int num) { return TenantNameRef(format("tenant_%d", num)); } Optional getTenantGroup(int num) { int groupNum = num % (numTenantGroups + 1); @@ -1475,4 +1474,4 @@ std::once_flag FuzzApiCorrectnessWorkload::onceFlag; std::vector(unsigned int const&, FuzzApiCorrectnessWorkload* const&, Reference const&)>> FuzzApiCorrectnessWorkload::testCases; -WorkloadFactory FuzzApiCorrectnessWorkloadFactory("FuzzApiCorrectness"); +WorkloadFactory FuzzApiCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/GetMappedRange.actor.cpp b/fdbserver/workloads/GetMappedRange.actor.cpp index 250f26eb08e..2542627d9cf 100644 --- a/fdbserver/workloads/GetMappedRange.actor.cpp +++ b/fdbserver/workloads/GetMappedRange.actor.cpp @@ -39,6 +39,7 @@ const KeyRef RECORD = "RECORD"_sr; const KeyRef INDEX = "INDEX"_sr; struct GetMappedRangeWorkload : ApiWorkload { + static constexpr auto NAME = "GetMappedRange"; bool enabled; Snapshot snapshot = Snapshot::False; @@ -52,8 +53,6 @@ struct GetMappedRangeWorkload : ApiWorkload { enabled = !clientId; // only do this on the "first" client } - std::string description() const override { return "GetMappedRange"; } - Future start(Database const& cx) override { // This workload is generated different from typical ApiWorkload. So don't use ApiWorkload::_start. if (enabled) { @@ -463,4 +462,4 @@ struct GetMappedRangeWorkload : ApiWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory GetMappedRangeWorkloadFactory("GetMappedRange"); +WorkloadFactory GetMappedRangeWorkloadFactory; diff --git a/fdbserver/workloads/GetRangeStream.actor.cpp b/fdbserver/workloads/GetRangeStream.actor.cpp index 68ec509de75..b5c0a104d69 100644 --- a/fdbserver/workloads/GetRangeStream.actor.cpp +++ b/fdbserver/workloads/GetRangeStream.actor.cpp @@ -25,6 +25,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct GetRangeStream : TestWorkload { + static constexpr auto NAME = "GetRangeStream"; PerfIntCounter bytesRead; bool useGetRange; Key begin; @@ -37,9 +38,7 @@ struct GetRangeStream : TestWorkload { end = getOption(options, "end"_sr, normalKeys.end); printKVPairs = getOption(options, "printKVPairs"_sr, false); } - - std::string description() const override { return "GetRangeStreamWorkload"; } - + Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -125,4 +124,4 @@ struct GetRangeStream : TestWorkload { } }; -WorkloadFactory GetRangeStreamWorkloadFactory("GetRangeStream"); +WorkloadFactory GetRangeStreamWorkloadFactory; diff --git a/fdbserver/workloads/GlobalTagThrottling.actor.cpp b/fdbserver/workloads/GlobalTagThrottling.actor.cpp index 07191f31716..2e2ec07a046 100644 --- a/fdbserver/workloads/GlobalTagThrottling.actor.cpp +++ b/fdbserver/workloads/GlobalTagThrottling.actor.cpp @@ -48,17 +48,17 @@ class GlobalTagThrottlingWorkload : public TestWorkload { } public: + static constexpr auto NAME = "GlobalTagThrottling"; explicit GlobalTagThrottlingWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { transactionTag = getOption(options, "transactionTag"_sr, "sampleTag"_sr); reservedQuota = getOption(options, "reservedQuota"_sr, 0.0); totalQuota = getOption(options, "totalQuota"_sr, 0.0); } - std::string description() const override { return "GlobalTagThrottling"; } Future setup(Database const& cx) override { return clientId ? Void() : setup(this, cx); } Future start(Database const& cx) override { return Void(); } Future check(Database const& cx) override { return true; } void getMetrics(std::vector& m) override {} }; -WorkloadFactory GlobalTagThrottlingWorkloadFactory("GlobalTagThrottling"); +WorkloadFactory GlobalTagThrottlingWorkloadFactory; diff --git a/fdbserver/workloads/HealthMetricsApi.actor.cpp b/fdbserver/workloads/HealthMetricsApi.actor.cpp index 988c3970c7e..494a5697da5 100644 --- a/fdbserver/workloads/HealthMetricsApi.actor.cpp +++ b/fdbserver/workloads/HealthMetricsApi.actor.cpp @@ -46,7 +46,7 @@ struct HealthMetricsApiWorkload : TestWorkload { // internal states bool healthMetricsStoppedUpdating = false; - static constexpr const char* NAME = "HealthMetricsApi"; + static constexpr auto NAME = "HealthMetricsApi"; HealthMetricsApiWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { testDuration = getOption(options, "testDuration"_sr, 120.0); @@ -54,9 +54,7 @@ struct HealthMetricsApiWorkload : TestWorkload { sendDetailedHealthMetrics = getOption(options, "sendDetailedHealthMetrics"_sr, true); maxAllowedStaleness = getOption(options, "maxAllowedStaleness"_sr, 60.0); } - - std::string description() const override { return HealthMetricsApiWorkload::NAME; } - + ACTOR static Future _setup(Database cx, HealthMetricsApiWorkload* self) { if (!self->sendDetailedHealthMetrics) { // Clear detailed health metrics that are already populated @@ -176,4 +174,4 @@ struct HealthMetricsApiWorkload : TestWorkload { }; } }; -WorkloadFactory HealthMetricsApiWorkloadFactory(HealthMetricsApiWorkload::NAME); +WorkloadFactory HealthMetricsApiWorkloadFactory; diff --git a/fdbserver/workloads/HighContentionPrefixAllocatorWorkload.actor.cpp b/fdbserver/workloads/HighContentionPrefixAllocatorWorkload.actor.cpp index b5becdabd7a..5a6fd65b221 100644 --- a/fdbserver/workloads/HighContentionPrefixAllocatorWorkload.actor.cpp +++ b/fdbserver/workloads/HighContentionPrefixAllocatorWorkload.actor.cpp @@ -25,7 +25,7 @@ // This workload tests the basic contract of the high contention allocator struct HighContentionPrefixAllocatorWorkload : TestWorkload { - static constexpr const char* NAME = "HighContentionPrefixAllocator"; + static constexpr auto NAME = "HighContentionPrefixAllocator"; Subspace allocatorSubspace; HighContentionPrefixAllocator allocator; @@ -43,8 +43,6 @@ struct HighContentionPrefixAllocatorWorkload : TestWorkload { maxAllocationsPerTransaction = getOption(options, "maxAllocationsPerTransaction"_sr, 20); } - std::string description() const override { return HighContentionPrefixAllocatorWorkload::NAME; } - Future setup(Database const& cx) override { return Void(); } ACTOR static Future runAllocationTransaction(Database cx, HighContentionPrefixAllocatorWorkload* self) { diff --git a/fdbserver/workloads/IDDTxnProcessorApiCorrectness.actor.cpp b/fdbserver/workloads/IDDTxnProcessorApiCorrectness.actor.cpp index 56b15fa0e7e..7233a125ca2 100644 --- a/fdbserver/workloads/IDDTxnProcessorApiCorrectness.actor.cpp +++ b/fdbserver/workloads/IDDTxnProcessorApiCorrectness.actor.cpp @@ -52,7 +52,7 @@ void verifyInitDataEqual(Reference real, Reference setup(Database const& cx) override { return enabled ? _setup(cx, this) : Void(); } Future start(Database const& cx) override { return enabled ? _start(cx, this) : Void(); } @@ -137,6 +136,5 @@ struct IDDTxnProcessorApiWorkload : TestWorkload { } // Give the database time to recover from our damage void getMetrics(std::vector& m) override {} }; -const char* IDDTxnProcessorApiWorkload::desc = "IDDTxnProcessorApiCorrectness"; -WorkloadFactory IDDTxnProcessorApiWorkload(IDDTxnProcessorApiWorkload::desc); \ No newline at end of file +WorkloadFactory IDDTxnProcessorApiWorkload; \ No newline at end of file diff --git a/fdbserver/workloads/Increment.actor.cpp b/fdbserver/workloads/Increment.actor.cpp index 0bd1504e51c..1db71991d5e 100644 --- a/fdbserver/workloads/Increment.actor.cpp +++ b/fdbserver/workloads/Increment.actor.cpp @@ -25,6 +25,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct Increment : TestWorkload { + static constexpr auto NAME = "Increment"; int actorCount, nodeCount; double testDuration, transactionsPerSecond, minExpectedTransactionsPerSecond; @@ -41,9 +42,7 @@ struct Increment : TestWorkload { nodeCount = getOption(options, "nodeCount"_sr, transactionsPerSecond * clientCount); minExpectedTransactionsPerSecond = transactionsPerSecond * getOption(options, "expectedRate"_sr, 0.7); } - - std::string description() const override { return "IncrementWorkload"; } - + Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { for (int c = 0; c < actorCount; c++) @@ -176,4 +175,4 @@ struct Increment : TestWorkload { } }; -WorkloadFactory IncrementWorkloadFactory("Increment"); +WorkloadFactory IncrementWorkloadFactory; diff --git a/fdbserver/workloads/IncrementalBackup.actor.cpp b/fdbserver/workloads/IncrementalBackup.actor.cpp index 17968c316c4..283edfee48e 100644 --- a/fdbserver/workloads/IncrementalBackup.actor.cpp +++ b/fdbserver/workloads/IncrementalBackup.actor.cpp @@ -32,7 +32,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct IncrementalBackupWorkload : TestWorkload { - + static constexpr auto NAME = "IncrementalBackup"; + Standalone backupDir; Standalone tag; FileBackupAgent backupAgent; @@ -56,8 +57,6 @@ struct IncrementalBackupWorkload : TestWorkload { clearBackupAgentKeys = getOption(options, "clearBackupAgentKeys"_sr, false); } - std::string description() const override { return "IncrementalBackup"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -252,4 +251,4 @@ struct IncrementalBackupWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory IncrementalBackupWorkloadFactory("IncrementalBackup"); +WorkloadFactory IncrementalBackupWorkloadFactory; diff --git a/fdbserver/workloads/IndexScan.actor.cpp b/fdbserver/workloads/IndexScan.actor.cpp index 2e39470c52c..e554aa71fe5 100644 --- a/fdbserver/workloads/IndexScan.actor.cpp +++ b/fdbserver/workloads/IndexScan.actor.cpp @@ -27,6 +27,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct IndexScanWorkload : KVWorkload { + constexpr static auto NAME = "IndexScan"; uint64_t rowsRead, chunks; int bytesPerRead, failedTransactions, scans; double totalTimeFetching, testDuration, transactionDuration; @@ -41,8 +42,6 @@ struct IndexScanWorkload : KVWorkload { readYourWrites = getOption(options, "readYourWrites"_sr, true); } - std::string description() const override { return "SimpleRead"; } - Future setup(Database const& cx) override { // this will be set up by and external force! return Void(); @@ -93,7 +92,9 @@ struct IndexScanWorkload : KVWorkload { ACTOR static Future serialScans(Database cx, IndexScanWorkload* self) { state double start = now(); try { - loop { wait(scanDatabase(cx, self)); } + loop { + wait(scanDatabase(cx, self)); + } } catch (...) { self->totalTimeFetching = now() - start; throw; @@ -144,4 +145,4 @@ struct IndexScanWorkload : KVWorkload { } }; -WorkloadFactory IndexScanWorkloadFactory("IndexScan"); +WorkloadFactory IndexScanWorkloadFactory; diff --git a/fdbserver/workloads/Inventory.actor.cpp b/fdbserver/workloads/Inventory.actor.cpp index 03106cc8059..69c563c69cb 100644 --- a/fdbserver/workloads/Inventory.actor.cpp +++ b/fdbserver/workloads/Inventory.actor.cpp @@ -26,6 +26,7 @@ // SOMEDAY: Make this actually run on multiple clients struct InventoryTestWorkload : TestWorkload { + static constexpr auto NAME = "InventoryTest"; std::map minExpectedResults, maxExpectedResults; // Destroyed last, since it's used in actor cancellation of InventoryTestClient(Actor) @@ -46,8 +47,6 @@ struct InventoryTestWorkload : TestWorkload { productsPerWrite = getOption(options, "productsPerWrite"_sr, 2); } - std::string description() const override { return "InventoryTest"; } - Future start(Database const& cx) override { if (clientId) return Void(); @@ -214,4 +213,4 @@ struct InventoryTestWorkload : TestWorkload { } }; -WorkloadFactory InventoryTestWorkloadFactory("InventoryTest"); +WorkloadFactory InventoryTestWorkloadFactory; diff --git a/fdbserver/workloads/KVStoreTest.actor.cpp b/fdbserver/workloads/KVStoreTest.actor.cpp index 4b8cd62e584..31544e36a1a 100644 --- a/fdbserver/workloads/KVStoreTest.actor.cpp +++ b/fdbserver/workloads/KVStoreTest.actor.cpp @@ -196,6 +196,7 @@ ACTOR Future testKVCommit(KVTest* test, TestHistogram* latency, Per Future testKVStore(struct KVStoreTestWorkload* const&); struct KVStoreTestWorkload : TestWorkload { + static constexpr auto NAME = "KVStoreTest"; bool enabled, saturation; double testDuration, operationsPerSecond; double commitFraction, setFraction; @@ -224,7 +225,6 @@ struct KVStoreTestWorkload : TestWorkload { saturation = getOption(options, "saturation"_sr, false); storeType = getOption(options, "storeType"_sr, "ssd"_sr).toString(); } - std::string description() const override { return "KVStoreTest"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (enabled) @@ -251,7 +251,7 @@ struct KVStoreTestWorkload : TestWorkload { } }; -WorkloadFactory KVStoreTestWorkloadFactory("KVStoreTest"); +WorkloadFactory KVStoreTestWorkloadFactory; ACTOR Future testKVStoreMain(KVStoreTestWorkload* workload, KVTest* ptest) { state KVTest& test = *ptest; @@ -404,7 +404,9 @@ ACTOR Future testKVStore(KVStoreTestWorkload* workload) { try { choose { when(wait(main)) {} - when(wait(test.store->getError())) { ASSERT(false); } + when(wait(test.store->getError())) { + ASSERT(false); + } } } catch (Error& e) { err = e; diff --git a/fdbserver/workloads/KillRegion.actor.cpp b/fdbserver/workloads/KillRegion.actor.cpp index 5580bb8398c..b3dcc7ec00f 100644 --- a/fdbserver/workloads/KillRegion.actor.cpp +++ b/fdbserver/workloads/KillRegion.actor.cpp @@ -29,6 +29,7 @@ #include "flow/actorcompiler.h" // This must be the last include. struct KillRegionWorkload : TestWorkload { + static constexpr auto NAME = "KillRegion"; bool enabled; double testDuration; @@ -39,8 +40,6 @@ struct KillRegionWorkload : TestWorkload { g_simulator->usableRegions = 1; } - std::string description() const override { return "KillRegionWorkload"; } - void disableFailureInjectionWorkloads(std::set& out) const override { out.insert("all"); } Future setup(Database const& cx) override { @@ -121,7 +120,9 @@ struct KillRegionWorkload : TestWorkload { wait(success(ManagementAPI::changeConfig( cx.getReference(), g_simulator->disablePrimary + " repopulate_anti_quorum=1", true))); choose { - when(wait(waitForStorageRecovered(self))) { break; } + when(wait(waitForStorageRecovered(self))) { + break; + } when(wait(delay(300.0))) {} } } @@ -134,4 +135,4 @@ struct KillRegionWorkload : TestWorkload { } }; -WorkloadFactory KillRegionWorkloadFactory("KillRegion"); +WorkloadFactory KillRegionWorkloadFactory; diff --git a/fdbserver/workloads/LocalRatekeeper.actor.cpp b/fdbserver/workloads/LocalRatekeeper.actor.cpp index ef54b1e1161..fd92bb865a5 100644 --- a/fdbserver/workloads/LocalRatekeeper.actor.cpp +++ b/fdbserver/workloads/LocalRatekeeper.actor.cpp @@ -45,6 +45,7 @@ ACTOR Future getRandomStorage(Database cx) { } struct LocalRatekeeperWorkload : TestWorkload { + static constexpr auto NAME = "LocalRatekeeper"; double startAfter = 0.0; double blockWritesFor; @@ -55,7 +56,6 @@ struct LocalRatekeeperWorkload : TestWorkload { blockWritesFor = getOption( options, "blockWritesFor"_sr, double(SERVER_KNOBS->STORAGE_DURABILITY_LAG_HARD_MAX) / double(1e6)); } - std::string description() const override { return "LocalRatekeeperWorkload"; } ACTOR static Future testStorage(LocalRatekeeperWorkload* self, Database cx, StorageServerInterface ssi) { state Transaction tr(cx); @@ -148,4 +148,4 @@ struct LocalRatekeeperWorkload : TestWorkload { } // namespace -WorkloadFactory LocalRatekeeperWorkloadFactory("LocalRatekeeper"); +WorkloadFactory LocalRatekeeperWorkloadFactory; diff --git a/fdbserver/workloads/LockDatabase.actor.cpp b/fdbserver/workloads/LockDatabase.actor.cpp index 81f46f8c32d..e46d3302859 100644 --- a/fdbserver/workloads/LockDatabase.actor.cpp +++ b/fdbserver/workloads/LockDatabase.actor.cpp @@ -26,6 +26,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct LockDatabaseWorkload : TestWorkload { + static constexpr auto NAME = "LockDatabase"; + double lockAfter, unlockAfter; bool ok; bool onlyCheckLocked; @@ -37,8 +39,6 @@ struct LockDatabaseWorkload : TestWorkload { ASSERT(unlockAfter > lockAfter); } - std::string description() const override { return "LockDatabase"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -132,4 +132,4 @@ struct LockDatabaseWorkload : TestWorkload { } }; -WorkloadFactory LockDatabaseWorkloadFactory("LockDatabase"); +WorkloadFactory LockDatabaseWorkloadFactory; diff --git a/fdbserver/workloads/LockDatabaseFrequently.actor.cpp b/fdbserver/workloads/LockDatabaseFrequently.actor.cpp index 3e4d6a6c042..5c53c27fb18 100644 --- a/fdbserver/workloads/LockDatabaseFrequently.actor.cpp +++ b/fdbserver/workloads/LockDatabaseFrequently.actor.cpp @@ -25,6 +25,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct LockDatabaseFrequentlyWorkload : TestWorkload { + static constexpr auto NAME = "LockDatabaseFrequently"; + double delayBetweenLocks; double testDuration; PerfIntCounter lockCount{ "LockCount" }; @@ -34,8 +36,6 @@ struct LockDatabaseFrequentlyWorkload : TestWorkload { testDuration = getOption(options, "testDuration"_sr, 60); } - std::string description() const override { return "LockDatabaseFrequently"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return clientId == 0 ? worker(this, cx) : Void(); } @@ -72,4 +72,4 @@ struct LockDatabaseFrequentlyWorkload : TestWorkload { } }; -WorkloadFactory LockDatabaseFrequentlyWorkloadFactory("LockDatabaseFrequently"); +WorkloadFactory LockDatabaseFrequentlyWorkloadFactory; diff --git a/fdbserver/workloads/LogMetrics.actor.cpp b/fdbserver/workloads/LogMetrics.actor.cpp index 5950af5af60..3e150c18661 100644 --- a/fdbserver/workloads/LogMetrics.actor.cpp +++ b/fdbserver/workloads/LogMetrics.actor.cpp @@ -31,6 +31,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct LogMetricsWorkload : TestWorkload { + static constexpr auto NAME = "LogMetrics"; + std::string dataFolder; double logAt, logDuration, logsPerSecond; @@ -41,7 +43,6 @@ struct LogMetricsWorkload : TestWorkload { dataFolder = getOption(options, "dataFolder"_sr, ""_sr).toString(); } - std::string description() const override { return "LogMetricsWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (clientId) @@ -94,4 +95,4 @@ struct LogMetricsWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory LogMetricsWorkloadFactory("LogMetrics"); +WorkloadFactory LogMetricsWorkloadFactory; diff --git a/fdbserver/workloads/LowLatency.actor.cpp b/fdbserver/workloads/LowLatency.actor.cpp index 46bd365c95e..c8a644d3e59 100644 --- a/fdbserver/workloads/LowLatency.actor.cpp +++ b/fdbserver/workloads/LowLatency.actor.cpp @@ -28,6 +28,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct LowLatencyWorkload : TestWorkload { + static constexpr auto NAME = "LowLatency"; + double testDuration; double maxGRVLatency; double maxCommitLatency; @@ -46,9 +48,7 @@ struct LowLatencyWorkload : TestWorkload { testWrites = getOption(options, "testWrites"_sr, true); testKey = getOption(options, "testKey"_sr, "testKey"_sr); } - - std::string description() const override { return "LowLatency"; } - + Future setup(Database const& cx) override { if (g_network->isSimulated()) { IKnobCollection::getMutableGlobalKnobCollection().setKnob("min_delay_cc_worst_fit_candidacy_seconds", @@ -120,4 +120,4 @@ struct LowLatencyWorkload : TestWorkload { } }; -WorkloadFactory LowLatencyWorkloadFactory("LowLatency"); +WorkloadFactory LowLatencyWorkloadFactory; diff --git a/fdbserver/workloads/MachineAttrition.actor.cpp b/fdbserver/workloads/MachineAttrition.actor.cpp index 2ff53660d98..9d1dff8348a 100644 --- a/fdbserver/workloads/MachineAttrition.actor.cpp +++ b/fdbserver/workloads/MachineAttrition.actor.cpp @@ -62,6 +62,7 @@ ACTOR Future ignoreSSFailuresForDuration(Database cx, double duration) { } struct MachineAttritionWorkload : FailureInjectionWorkload { + static constexpr auto NAME = "Attrition"; bool enabled; int machinesToKill = 2, machinesToLeave = 1, workersToKill = 2, workersToLeave = 1; double testDuration = 10.0, suspendDuration = 1.0, liveDuration = 5.0; @@ -155,7 +156,6 @@ struct MachineAttritionWorkload : FailureInjectionWorkload { return machines; } - std::string description() const override { return "MachineAttritionWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (enabled) { @@ -468,6 +468,6 @@ struct MachineAttritionWorkload : FailureInjectionWorkload { } }; -WorkloadFactory MachineAttritionWorkloadFactory("Attrition"); +WorkloadFactory MachineAttritionWorkloadFactory; // TODO: Enable MachineAttritionWorkload injection once this is bug-free // FailureInjectorFactory MachineAttritionFailureWorkloadFactory; diff --git a/fdbserver/workloads/Mako.actor.cpp b/fdbserver/workloads/Mako.actor.cpp index 140d7fda458..ff30bbb2fd2 100644 --- a/fdbserver/workloads/Mako.actor.cpp +++ b/fdbserver/workloads/Mako.actor.cpp @@ -45,6 +45,8 @@ enum { }; enum { OP_COUNT, OP_RANGE }; struct MakoWorkload : TestWorkload { + static constexpr auto NAME = "Mako"; + uint64_t rowCount, seqNumLen, sampleSize, actorCountPerClient, keyBytes, maxValueBytes, minValueBytes, csSize, csCount, csPartitionSize, csStepSizeInPartition; double testDuration, loadTime, warmingDelay, maxInsertRate, transactionsPerSecond, allowedLatency, @@ -165,12 +167,6 @@ struct MakoWorkload : TestWorkload { } } - std::string description() const override { - // Mako is a simple workload to measure the performance of FDB. - // The primary purpose of this benchmark is to generate consistent performance results - return "Mako"; - } - Future setup(Database const& cx) override { if (doChecksumVerificationOnly) return Void(); @@ -885,4 +881,4 @@ struct MakoWorkload : TestWorkload { } }; -WorkloadFactory MakoloadFactory("Mako"); +WorkloadFactory MakoloadFactory; diff --git a/fdbserver/workloads/MemoryLifetime.actor.cpp b/fdbserver/workloads/MemoryLifetime.actor.cpp index ffa80a8dd64..a206fbb7d2e 100644 --- a/fdbserver/workloads/MemoryLifetime.actor.cpp +++ b/fdbserver/workloads/MemoryLifetime.actor.cpp @@ -28,6 +28,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct MemoryLifetime : KVWorkload { + static constexpr auto NAME = "MemoryLifetime"; double testDuration; std::vector> clients; @@ -38,8 +39,6 @@ struct MemoryLifetime : KVWorkload { valueString = std::string(maxValueBytes, '.'); } - std::string description() const override { return "MemoryLifetime"; } - Value randomValue() const { return StringRef((uint8_t*)valueString.c_str(), deterministicRandom()->randomInt(minValueBytes, maxValueBytes + 1)); @@ -170,4 +169,4 @@ struct MemoryLifetime : KVWorkload { } }; -WorkloadFactory MemoryLifetimeWorkloadFactory("MemoryLifetime"); +WorkloadFactory MemoryLifetimeWorkloadFactory; diff --git a/fdbserver/workloads/MetaclusterManagementWorkload.actor.cpp b/fdbserver/workloads/MetaclusterManagementWorkload.actor.cpp index b8c26524c24..9367bdca5e2 100644 --- a/fdbserver/workloads/MetaclusterManagementWorkload.actor.cpp +++ b/fdbserver/workloads/MetaclusterManagementWorkload.actor.cpp @@ -43,6 +43,7 @@ FDB_DEFINE_BOOLEAN_PARAM(AllowPartialMetaclusterOperations); struct MetaclusterManagementWorkload : TestWorkload { + static constexpr auto NAME = "MetaclusterManagement"; struct DataClusterData { Database db; @@ -92,9 +93,7 @@ struct MetaclusterManagementWorkload : TestWorkload { maxTenantGroups = std::min(2 * maxTenants, getOption(options, "maxTenantGroups"_sr, 20)); testDuration = getOption(options, "testDuration"_sr, 120.0); } - - std::string description() const override { return "MetaclusterManagement"; } - + void disableFailureInjectionWorkloads(std::set& out) const override { out.insert("MachineAttritionWorkload"); } @@ -935,4 +934,4 @@ struct MetaclusterManagementWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory MetaclusterManagementWorkloadFactory("MetaclusterManagement"); +WorkloadFactory MetaclusterManagementWorkloadFactory; diff --git a/fdbserver/workloads/MetricLogging.actor.cpp b/fdbserver/workloads/MetricLogging.actor.cpp index 92e0ccbae8c..817727a6c7e 100644 --- a/fdbserver/workloads/MetricLogging.actor.cpp +++ b/fdbserver/workloads/MetricLogging.actor.cpp @@ -26,6 +26,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct MetricLoggingWorkload : TestWorkload { + static constexpr auto NAME = "MetricLogging"; int actorCount, metricCount; double testDuration; bool testBool, enabled; @@ -51,8 +52,6 @@ struct MetricLoggingWorkload : TestWorkload { } } - std::string description() const override { return "MetricLogging"; } - Future setup(Database const& cx) override { return _setup(this, cx); } ACTOR Future _setup(MetricLoggingWorkload* self, Database cx) { @@ -99,4 +98,4 @@ struct MetricLoggingWorkload : TestWorkload { } }; -WorkloadFactory MetricLoggingWorkloadFactory("MetricLogging"); +WorkloadFactory MetricLoggingWorkloadFactory; diff --git a/fdbserver/workloads/MiniCycle.actor.cpp b/fdbserver/workloads/MiniCycle.actor.cpp index f427dbaae54..6b52520907a 100644 --- a/fdbserver/workloads/MiniCycle.actor.cpp +++ b/fdbserver/workloads/MiniCycle.actor.cpp @@ -32,6 +32,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct MiniCycleWorkload : TestWorkload { + static constexpr auto NAME = "MiniCycle"; + int actorCount, nodeCount; double testDuration, transactionsPerSecond, minExpectedTransactionsPerSecond, traceParentProbability; Key keyPrefix; @@ -52,8 +54,6 @@ struct MiniCycleWorkload : TestWorkload { minExpectedTransactionsPerSecond = transactionsPerSecond * getOption(options, "expectedRate"_sr, 0.7); } - std::string description() const override { return "MiniCycleWorkload"; } - Future setup(Database const& cx) override { return bulkSetup(cx->clone(), this, @@ -90,7 +90,9 @@ struct MiniCycleWorkload : TestWorkload { if (!ok) return false; } - when(wait(end)) { break; } + when(wait(end)) { + break; + } } } @@ -340,4 +342,4 @@ struct MiniCycleWorkload : TestWorkload { } }; -WorkloadFactory MiniCycleWorkloadFactory("MiniCycle"); +WorkloadFactory MiniCycleWorkloadFactory; diff --git a/fdbserver/workloads/MutationLogReaderCorrectness.actor.cpp b/fdbserver/workloads/MutationLogReaderCorrectness.actor.cpp index 11fd72bed1f..ae431e60152 100644 --- a/fdbserver/workloads/MutationLogReaderCorrectness.actor.cpp +++ b/fdbserver/workloads/MutationLogReaderCorrectness.actor.cpp @@ -32,6 +32,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct MutationLogReaderCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "MutationLogReaderCorrectness"; + bool enabled; int records; Version versionRange; @@ -66,8 +68,6 @@ struct MutationLogReaderCorrectnessWorkload : TestWorkload { endVersion = recordVersion(records - 1) + 1; } - std::string description() const override { return "MutationLogReaderCorrectness"; } - Future start(Database const& cx) override { if (enabled) { return _start(cx, this); @@ -158,5 +158,4 @@ struct MutationLogReaderCorrectnessWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory MutationLogReaderCorrectnessWorkloadFactory( - "MutationLogReaderCorrectness"); +WorkloadFactory MutationLogReaderCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/ParallelRestore.actor.cpp b/fdbserver/workloads/ParallelRestore.actor.cpp index af685cb5f50..114cfee191b 100644 --- a/fdbserver/workloads/ParallelRestore.actor.cpp +++ b/fdbserver/workloads/ParallelRestore.actor.cpp @@ -19,7 +19,6 @@ */ #include "fdbrpc/simulator.h" -#include "fdbclient/BackupAgent.actor.h" #include "fdbclient/BackupContainer.h" #include "fdbserver/workloads/workloads.actor.h" #include "fdbserver/workloads/BulkSetup.actor.h" @@ -28,13 +27,13 @@ // A workload which test the correctness of backup and restore process struct RunRestoreWorkerWorkload : TestWorkload { + static constexpr auto NAME = "RunRestoreWorkerWorkload"; + Future worker; RunRestoreWorkerWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { TraceEvent("RunRestoreWorkerWorkloadMX").log(); } - std::string description() const override { return "RunRestoreWorkerWorkload"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -59,4 +58,4 @@ struct RunRestoreWorkerWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory RunRestoreWorkerWorkloadFactory("RunRestoreWorkerWorkload"); +WorkloadFactory RunRestoreWorkerWorkloadFactory; diff --git a/fdbserver/workloads/Performance.actor.cpp b/fdbserver/workloads/Performance.actor.cpp index 0119d3bae45..f00fd2bc1ee 100644 --- a/fdbserver/workloads/Performance.actor.cpp +++ b/fdbserver/workloads/Performance.actor.cpp @@ -25,6 +25,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct PerformanceWorkload : TestWorkload { + static constexpr auto NAME = "Performance"; + Value probeWorkload; Standalone> savedOptions; @@ -50,7 +52,6 @@ struct PerformanceWorkload : TestWorkload { printf("saved %d options\n", savedOptions.size()); } - std::string description() const override { return "PerformanceTestWorkload"; } Future setup(Database const& cx) override { if (!clientId) return _setup(cx, this); @@ -228,4 +229,4 @@ struct PerformanceWorkload : TestWorkload { } }; -WorkloadFactory PerformanceWorkloadFactory("Performance"); +WorkloadFactory PerformanceWorkloadFactory; diff --git a/fdbserver/workloads/PhysicalShardMove.actor.cpp b/fdbserver/workloads/PhysicalShardMove.actor.cpp index d97a4fcceff..0ba4941e42c 100644 --- a/fdbserver/workloads/PhysicalShardMove.actor.cpp +++ b/fdbserver/workloads/PhysicalShardMove.actor.cpp @@ -44,6 +44,8 @@ std::string printValue(const ErrorOr>& value) { } // namespace struct PhysicalShardMoveWorkLoad : TestWorkload { + static constexpr auto NAME = "PhysicalShardMove"; + FlowLock startMoveKeysParallelismLock; FlowLock finishMoveKeysParallelismLock; FlowLock cleanUpDataMoveParallelismLock; @@ -59,8 +61,6 @@ struct PhysicalShardMoveWorkLoad : TestWorkload { pass = false; } - std::string description() const override { return "PhysicalShardMove"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -389,4 +389,4 @@ struct PhysicalShardMoveWorkLoad : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory PhysicalShardMoveWorkLoadFactory("PhysicalShardMove"); \ No newline at end of file +WorkloadFactory PhysicalShardMoveWorkLoadFactory; \ No newline at end of file diff --git a/fdbserver/workloads/Ping.actor.cpp b/fdbserver/workloads/Ping.actor.cpp index c8c67a275f8..d6c83cfb4b2 100644 --- a/fdbserver/workloads/Ping.actor.cpp +++ b/fdbserver/workloads/Ping.actor.cpp @@ -24,7 +24,6 @@ #include "fdbserver/workloads/workloads.actor.h" #include "fdbserver/WorkerInterface.actor.h" #include "fdbserver/QuietDatabase.h" -#include "fdbserver/ServerDBInfo.h" #include "flow/actorcompiler.h" // This must be the last #include. struct PingWorkloadInterface { @@ -39,6 +38,8 @@ struct PingWorkloadInterface { }; struct PingWorkload : TestWorkload { + static constexpr auto NAME = "Ping"; + double testDuration, operationsPerSecond; PingWorkloadInterface interf; bool logging, pingWorkers, registerInterface, broadcastTest, usePayload, parallelBroadcast, workerBroadcast; @@ -69,7 +70,6 @@ struct PingWorkload : TestWorkload { actorCount = getOption(options, "actorCount"_sr, 1); } - std::string description() const override { return "PingWorkload"; } Future setup(Database const& cx) override { if (pingWorkers || !registerInterface) return Void(); @@ -304,4 +304,4 @@ struct PingWorkload : TestWorkload { } }; -WorkloadFactory PingWorkloadFactory("Ping"); +WorkloadFactory PingWorkloadFactory; diff --git a/fdbserver/workloads/PrivateEndpoints.actor.cpp b/fdbserver/workloads/PrivateEndpoints.actor.cpp index ac52cc08035..a04ba75b023 100644 --- a/fdbserver/workloads/PrivateEndpoints.actor.cpp +++ b/fdbserver/workloads/PrivateEndpoints.actor.cpp @@ -25,7 +25,8 @@ namespace { struct PrivateEndpoints : TestWorkload { - static constexpr const char* WorkloadName = "PrivateEndpoints"; + static constexpr auto NAME = "PrivateEndpoints"; + bool success = true; int numSuccesses = 0; double startAfter; @@ -104,7 +105,6 @@ struct PrivateEndpoints : TestWorkload { addTestFor(&CommitProxyInterface::exclusionSafetyCheckReq); // addTestFor(&CommitProxyInterface::getDDMetrics); } - std::string description() const override { return WorkloadName; } Future start(Database const& cx) override { return _start(this, cx); } Future check(Database const& cx) override { return success; } void getMetrics(std::vector& m) override { @@ -126,7 +126,9 @@ struct PrivateEndpoints : TestWorkload { TraceEvent("PrivateEndpointTestDone").log(); return Void(); } - when(wait(testFuture)) { ++self->numSuccesses; } + when(wait(testFuture)) { + ++self->numSuccesses; + } } wait(delay(0.2)); } @@ -141,4 +143,4 @@ struct PrivateEndpoints : TestWorkload { } // namespace -WorkloadFactory PrivateEndpointsFactory(PrivateEndpoints::WorkloadName, true); +WorkloadFactory PrivateEndpointsFactory(true); diff --git a/fdbserver/workloads/ProtocolVersion.actor.cpp b/fdbserver/workloads/ProtocolVersion.actor.cpp index 037b9be1bef..69ad496cb0c 100644 --- a/fdbserver/workloads/ProtocolVersion.actor.cpp +++ b/fdbserver/workloads/ProtocolVersion.actor.cpp @@ -22,9 +22,9 @@ #include "flow/actorcompiler.h" // This must be the last include struct ProtocolVersionWorkload : TestWorkload { - ProtocolVersionWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {} + static constexpr auto NAME = "ProtocolVersion"; - std::string description() const override { return "ProtocolVersionWorkload"; } + ProtocolVersionWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {} Future start(Database const& cx) override { return _start(this, cx); } @@ -50,4 +50,4 @@ struct ProtocolVersionWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory ProtocolVersionWorkloadFactory("ProtocolVersion"); +WorkloadFactory ProtocolVersionWorkloadFactory; diff --git a/fdbserver/workloads/PubSubMultiples.actor.cpp b/fdbserver/workloads/PubSubMultiples.actor.cpp index 270a9af3479..a129bba1153 100644 --- a/fdbserver/workloads/PubSubMultiples.actor.cpp +++ b/fdbserver/workloads/PubSubMultiples.actor.cpp @@ -25,6 +25,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct PubSubMultiplesWorkload : TestWorkload { + static constexpr auto NAME = "PubSubMultiples"; + double testDuration, messagesPerSecond; int actorCount, inboxesPerActor; @@ -38,7 +40,6 @@ struct PubSubMultiplesWorkload : TestWorkload { inboxesPerActor = getOption(options, "inboxesPerActor"_sr, 20); } - std::string description() const override { return "PubSubMultiplesWorkload"; } Future setup(Database const& cx) override { return createNodes(this, cx); } Future start(Database const& cx) override { Future _ = startTests(this, cx); @@ -114,4 +115,4 @@ struct PubSubMultiplesWorkload : TestWorkload { } }; -WorkloadFactory PubSubMultiplesWorkloadFactory("PubSubMultiples"); +WorkloadFactory PubSubMultiplesWorkloadFactory; diff --git a/fdbserver/workloads/QueuePush.actor.cpp b/fdbserver/workloads/QueuePush.actor.cpp index 3eccbb54221..c7963a6b295 100644 --- a/fdbserver/workloads/QueuePush.actor.cpp +++ b/fdbserver/workloads/QueuePush.actor.cpp @@ -28,6 +28,8 @@ const int keyBytes = 16; struct QueuePushWorkload : TestWorkload { + static constexpr auto NAME = "QueuePush"; + int actorCount, valueBytes; double testDuration; bool forward; @@ -52,7 +54,6 @@ struct QueuePushWorkload : TestWorkload { startingKey = "0000000000000001"_sr; } - std::string description() const override { return "QueuePush"; } Future start(Database const& cx) override { return _start(cx, this); } Future check(Database const& cx) override { return true; } @@ -149,4 +150,4 @@ struct QueuePushWorkload : TestWorkload { } }; -WorkloadFactory QueuePushWorkloadFactory("QueuePush"); +WorkloadFactory QueuePushWorkloadFactory; diff --git a/fdbserver/workloads/RYWDisable.actor.cpp b/fdbserver/workloads/RYWDisable.actor.cpp index b1b3ca76845..6d9d6a67bdc 100644 --- a/fdbserver/workloads/RYWDisable.actor.cpp +++ b/fdbserver/workloads/RYWDisable.actor.cpp @@ -26,6 +26,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct RYWDisableWorkload : TestWorkload { + static constexpr auto NAME = "RYWDisable"; + int nodes, keyBytes; double testDuration; std::vector> clients; @@ -36,8 +38,6 @@ struct RYWDisableWorkload : TestWorkload { keyBytes = std::max(getOption(options, "keyBytes"_sr, 16), 16); } - std::string description() const override { return "RYWDisable"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -122,4 +122,4 @@ struct RYWDisableWorkload : TestWorkload { } }; -WorkloadFactory RYWDisableWorkloadFactory("RYWDisable"); +WorkloadFactory RYWDisableWorkloadFactory; diff --git a/fdbserver/workloads/RYWPerformance.actor.cpp b/fdbserver/workloads/RYWPerformance.actor.cpp index 584e07f84ca..21683439b76 100644 --- a/fdbserver/workloads/RYWPerformance.actor.cpp +++ b/fdbserver/workloads/RYWPerformance.actor.cpp @@ -26,6 +26,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct RYWPerformanceWorkload : TestWorkload { + static constexpr auto NAME = "RYWPerformance"; + int keyBytes, nodes, ranges; RYWPerformanceWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { nodes = getOption(options, "nodes"_sr, 10000); @@ -33,8 +35,6 @@ struct RYWPerformanceWorkload : TestWorkload { keyBytes = std::max(getOption(options, "keyBytes"_sr, 16), 16); } - std::string description() const override { return "RYWPerformance"; } - Future setup(Database const& cx) override { if (clientId == 0) return _setup(cx, this); @@ -312,4 +312,4 @@ struct RYWPerformanceWorkload : TestWorkload { } }; -WorkloadFactory RYWPerformanceWorkloadFactory("RYWPerformance"); +WorkloadFactory RYWPerformanceWorkloadFactory; diff --git a/fdbserver/workloads/RandomClogging.actor.cpp b/fdbserver/workloads/RandomClogging.actor.cpp index 0cf6796fea6..06bba66ac15 100644 --- a/fdbserver/workloads/RandomClogging.actor.cpp +++ b/fdbserver/workloads/RandomClogging.actor.cpp @@ -26,6 +26,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct RandomCloggingWorkload : FailureInjectionWorkload { + static constexpr auto NAME = "RandomClogging"; + bool enabled; double testDuration = 10.0; double scale = 1.0, clogginess = 1.0; @@ -57,12 +59,6 @@ struct RandomCloggingWorkload : FailureInjectionWorkload { iterate = random.random01() < 0.5; } - std::string description() const override { - if (g_simulator == g_network) - return "RandomClogging"; - else - return "NoRC"; - } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (g_network->isSimulated() && enabled) { @@ -146,5 +142,5 @@ struct RandomCloggingWorkload : FailureInjectionWorkload { } }; -WorkloadFactory RandomCloggingWorkloadFactory("RandomClogging"); +WorkloadFactory RandomCloggingWorkloadFactory; FailureInjectorFactory RandomCloggingFailureInjectionFactory; diff --git a/fdbserver/workloads/RandomMoveKeys.actor.cpp b/fdbserver/workloads/RandomMoveKeys.actor.cpp index 05b4ffd5c64..2ee6c2369ff 100644 --- a/fdbserver/workloads/RandomMoveKeys.actor.cpp +++ b/fdbserver/workloads/RandomMoveKeys.actor.cpp @@ -31,6 +31,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct MoveKeysWorkload : FailureInjectionWorkload { + static constexpr auto NAME = "RandomMoveKeys"; + bool enabled; double testDuration = 10.0, meanDelay = 0.05; double maxKeyspace = 0.1; @@ -47,7 +49,6 @@ struct MoveKeysWorkload : FailureInjectionWorkload { maxKeyspace = getOption(options, "maxKeyspace"_sr, maxKeyspace); } - std::string description() const override { return "MoveKeysWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return _start(cx, this); } @@ -243,5 +244,5 @@ struct MoveKeysWorkload : FailureInjectionWorkload { } }; -WorkloadFactory MoveKeysWorkloadFactory("RandomMoveKeys"); +WorkloadFactory MoveKeysWorkloadFactory; FailureInjectorFactory MoveKeysFailureInjectionFactory; diff --git a/fdbserver/workloads/RandomSelector.actor.cpp b/fdbserver/workloads/RandomSelector.actor.cpp index d5d8e23f167..97efea42887 100644 --- a/fdbserver/workloads/RandomSelector.actor.cpp +++ b/fdbserver/workloads/RandomSelector.actor.cpp @@ -25,6 +25,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct RandomSelectorWorkload : TestWorkload { + static constexpr auto NAME = "RandomSelector"; + int minOperationsPerTransaction, maxOperationsPerTransaction, maxKeySpace, maxOffset, minInitialAmount, maxInitialAmount; double testDuration; @@ -46,8 +48,6 @@ struct RandomSelectorWorkload : TestWorkload { fail = false; } - std::string description() const override { return "RandomSelector"; } - Future setup(Database const& cx) override { return randomSelectorSetup(cx->clone(), this); } Future start(Database const& cx) override { @@ -571,4 +571,4 @@ struct RandomSelectorWorkload : TestWorkload { } }; -WorkloadFactory RandomSelectorWorkloadFactory("RandomSelector"); +WorkloadFactory RandomSelectorWorkloadFactory; diff --git a/fdbserver/workloads/ReadAfterWrite.actor.cpp b/fdbserver/workloads/ReadAfterWrite.actor.cpp index 96a95db0404..219f30975f7 100644 --- a/fdbserver/workloads/ReadAfterWrite.actor.cpp +++ b/fdbserver/workloads/ReadAfterWrite.actor.cpp @@ -48,6 +48,7 @@ ACTOR Future latencyOfRead(Transaction* tr, Key k) { // Measure the latency of a storage server making a committed value available for reading. struct ReadAfterWriteWorkload : KVWorkload { + static constexpr auto NAME = "ReadAfterWrite"; double testDuration; ContinuousSample propagationLatency; @@ -56,8 +57,6 @@ struct ReadAfterWriteWorkload : KVWorkload { testDuration = getOption(options, "testDuration"_sr, 10.0); } - std::string description() const override { return "ReadAfterWriteWorkload"; } - Future setup(Database const& cx) override { return Void(); } ACTOR static Future benchmark(Database cx, ReadAfterWriteWorkload* self) { @@ -122,4 +121,4 @@ struct ReadAfterWriteWorkload : KVWorkload { } }; -WorkloadFactory ReadAfterWriteWorkloadFactory("ReadAfterWrite"); +WorkloadFactory ReadAfterWriteWorkloadFactory; diff --git a/fdbserver/workloads/ReadHotDetection.actor.cpp b/fdbserver/workloads/ReadHotDetection.actor.cpp index 81be6220d63..7779d3a6b2f 100644 --- a/fdbserver/workloads/ReadHotDetection.actor.cpp +++ b/fdbserver/workloads/ReadHotDetection.actor.cpp @@ -27,6 +27,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct ReadHotDetectionWorkload : TestWorkload { + static constexpr auto NAME = "ReadHotDetection"; + int actorCount, keyCount; double testDuration, transactionsPerSecond; @@ -44,8 +46,6 @@ struct ReadHotDetectionWorkload : TestWorkload { readKey = StringRef(format("testkey%08x", deterministicRandom()->randomInt(0, keyCount))); } - std::string description() const override { return "ReadHotDetection"; } - Future setup(Database const& cx) override { return _setup(cx, this); } Future start(Database const& cx) override { @@ -162,4 +162,4 @@ struct ReadHotDetectionWorkload : TestWorkload { } }; -WorkloadFactory ReadHotDetectionWorkloadFactory("ReadHotDetection"); +WorkloadFactory ReadHotDetectionWorkloadFactory; diff --git a/fdbserver/workloads/ReadWrite.actor.cpp b/fdbserver/workloads/ReadWrite.actor.cpp index d7a44cb6e1a..2897361f35d 100644 --- a/fdbserver/workloads/ReadWrite.actor.cpp +++ b/fdbserver/workloads/ReadWrite.actor.cpp @@ -363,6 +363,7 @@ static Future getInconsistentReadVersion(Database const& db) { } struct ReadWriteWorkload : ReadWriteCommon { + static constexpr auto NAME = "ReadWrite"; // use ReadWrite as a ramp up workload bool rampUpLoad; // indicate this is a ramp up workload int rampSweepCount; // how many times of ramp up @@ -430,8 +431,6 @@ struct ReadWriteWorkload : ReadWriteCommon { } } - std::string description() const override { return descriptionString.toString(); } - void getMetrics(std::vector& m) override { ReadWriteCommon::getMetrics(m); if (!rampUpLoad) { @@ -773,4 +772,4 @@ ACTOR Future>> trackInsertionCount(Datab return countInsertionRates; } -WorkloadFactory ReadWriteWorkloadFactory("ReadWrite"); +WorkloadFactory ReadWriteWorkloadFactory; diff --git a/fdbserver/workloads/RemoveServersSafely.actor.cpp b/fdbserver/workloads/RemoveServersSafely.actor.cpp index 6fc3fab69d5..64b2c1e85b2 100644 --- a/fdbserver/workloads/RemoveServersSafely.actor.cpp +++ b/fdbserver/workloads/RemoveServersSafely.actor.cpp @@ -32,6 +32,8 @@ std::string describe(uint32_t const& item) { } struct RemoveServersSafelyWorkload : TestWorkload { + static constexpr auto NAME = "RemoveServersSafely"; + bool enabled, killProcesses; int minMachinesToKill, maxMachinesToKill, maxSafetyCheckRetries; double minDelay, maxDelay; @@ -58,7 +60,6 @@ struct RemoveServersSafelyWorkload : TestWorkload { } } - std::string description() const override { return "RemoveServersSafelyWorkload"; } Future setup(Database const& cx) override { if (!enabled) return Void(); @@ -807,4 +808,4 @@ struct RemoveServersSafelyWorkload : TestWorkload { } }; -WorkloadFactory RemoveServersSafelyWorkloadFactory("RemoveServersSafely"); +WorkloadFactory RemoveServersSafelyWorkloadFactory; diff --git a/fdbserver/workloads/ReportConflictingKeys.actor.cpp b/fdbserver/workloads/ReportConflictingKeys.actor.cpp index 14a5e69a34a..140cea4532e 100644 --- a/fdbserver/workloads/ReportConflictingKeys.actor.cpp +++ b/fdbserver/workloads/ReportConflictingKeys.actor.cpp @@ -29,6 +29,7 @@ // For this test to report properly buggify must be disabled (flow.h) , and failConnection must be disabled in // (sim2.actor.cpp) struct ReportConflictingKeysWorkload : TestWorkload { + static constexpr auto NAME = "ReportConflictingKeys"; double testDuration, transactionsPerSecond, addReadConflictRangeProb, addWriteConflictRangeProb; Key keyPrefix; @@ -57,8 +58,6 @@ struct ReportConflictingKeysWorkload : TestWorkload { nodeCount = getOption(options, "nodeCount"_sr, 100); } - std::string description() const override { return "ReportConflictingKeysWorkload"; } - Future setup(Database const& cx) override { return Void(); } Future start(const Database& cx) override { return _start(cx->clone(), this); } @@ -297,4 +296,4 @@ struct ReportConflictingKeysWorkload : TestWorkload { } }; -WorkloadFactory ReportConflictingKeysWorkload("ReportConflictingKeys"); +WorkloadFactory ReportConflictingKeysWorkload; diff --git a/fdbserver/workloads/RestoreBackup.actor.cpp b/fdbserver/workloads/RestoreBackup.actor.cpp index c2f30e490c8..7254d4b59dc 100644 --- a/fdbserver/workloads/RestoreBackup.actor.cpp +++ b/fdbserver/workloads/RestoreBackup.actor.cpp @@ -27,7 +27,7 @@ #include "fdbserver/workloads/workloads.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. -struct RestoreBackupWorkload final : TestWorkload { +struct RestoreBackupWorkload : TestWorkload { FileBackupAgent backupAgent; Reference backupContainer; @@ -44,7 +44,7 @@ struct RestoreBackupWorkload final : TestWorkload { stopWhenDone.set(getOption(options, "stopWhenDone"_sr, false)); } - static constexpr const char* DESCRIPTION = "RestoreBackup"; + static constexpr auto NAME = "RestoreBackup"; ACTOR static Future waitOnBackup(RestoreBackupWorkload* self, Database cx) { state Version waitForVersion; @@ -124,11 +124,10 @@ struct RestoreBackupWorkload final : TestWorkload { return Void(); } - std::string description() const override { return DESCRIPTION; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return clientId ? Void() : _start(this, cx); } Future check(Database const& cx) override { return true; } void getMetrics(std::vector& m) override {} }; -WorkloadFactory RestoreBackupWorkloadFactory(RestoreBackupWorkload::DESCRIPTION); +WorkloadFactory RestoreBackupWorkloadFactory; diff --git a/fdbserver/workloads/RestoreFromBlob.actor.cpp b/fdbserver/workloads/RestoreFromBlob.actor.cpp index ad5a66262aa..afea1585e80 100644 --- a/fdbserver/workloads/RestoreFromBlob.actor.cpp +++ b/fdbserver/workloads/RestoreFromBlob.actor.cpp @@ -32,7 +32,7 @@ struct RestoreFromBlobWorkload : TestWorkload { Standalone backupURL; WaitForComplete waitForComplete{ false }; - static constexpr const char* DESCRIPTION = "RestoreFromBlob"; + static constexpr auto NAME = "RestoreFromBlob"; RestoreFromBlobWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { restoreAfter = getOption(options, "restoreAfter"_sr, 10.0); @@ -48,8 +48,6 @@ struct RestoreFromBlobWorkload : TestWorkload { backupURL = backupURLString; } - std::string description() const override { return DESCRIPTION; } - Future setup(Database const& cx) override { return Void(); } ACTOR static Future _start(Database cx, RestoreFromBlobWorkload* self) { @@ -71,4 +69,4 @@ struct RestoreFromBlobWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory RestoreFromBlobWorkloadFactory(RestoreFromBlobWorkload::DESCRIPTION); +WorkloadFactory RestoreFromBlobWorkloadFactory; diff --git a/fdbserver/workloads/Rollback.actor.cpp b/fdbserver/workloads/Rollback.actor.cpp index a2ff27cafe7..fa0c7dddf4b 100644 --- a/fdbserver/workloads/Rollback.actor.cpp +++ b/fdbserver/workloads/Rollback.actor.cpp @@ -33,6 +33,8 @@ // While the network is still clogged, the workload kills the proxy and clogs the unclogged tlog's interface. // Note: The clogged network link's latency will become "clogDuration". struct RollbackWorkload : FailureInjectionWorkload { + static constexpr auto NAME = "Rollback"; + bool enableFailures = false, multiple = true, enabled; double meanDelay = 20.0, clogDuration = clogDuration = 3.0, testDuration = 10.0; @@ -53,7 +55,6 @@ struct RollbackWorkload : FailureInjectionWorkload { enableFailures = random.random01() < 0.2; } - std::string description() const override { return "RollbackWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (g_simulator == g_network && enabled) @@ -131,5 +132,5 @@ struct RollbackWorkload : FailureInjectionWorkload { } }; -WorkloadFactory RollbackWorkloadFactory("Rollback"); +WorkloadFactory RollbackWorkloadFactory; FailureInjectorFactory RollbackFailureInjectorFactory; diff --git a/fdbserver/workloads/RyowCorrectness.actor.cpp b/fdbserver/workloads/RyowCorrectness.actor.cpp index 07290cf9dfd..a248f5e704d 100644 --- a/fdbserver/workloads/RyowCorrectness.actor.cpp +++ b/fdbserver/workloads/RyowCorrectness.actor.cpp @@ -54,6 +54,7 @@ struct Operation { // A workload which executes random sequences of operations on RYOW transactions and confirms the results struct RyowCorrectnessWorkload : ApiWorkload { + static constexpr auto NAME = "RyowCorrectness"; // How long the test should run int duration; @@ -66,8 +67,6 @@ struct RyowCorrectnessWorkload : ApiWorkload { opsPerTransaction = getOption(options, "opsPerTransaction"_sr, 50); } - std::string description() const override { return "RyowCorrectness"; } - ACTOR Future performSetup(Database cx, RyowCorrectnessWorkload* self) { std::vector types; types.push_back(READ_YOUR_WRITES); @@ -358,4 +357,4 @@ struct RyowCorrectnessWorkload : ApiWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory RyowCorrectnessWorkloadFactory("RyowCorrectness"); +WorkloadFactory RyowCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/SaveAndKill.actor.cpp b/fdbserver/workloads/SaveAndKill.actor.cpp index 069b6877ac0..08e478c203c 100644 --- a/fdbserver/workloads/SaveAndKill.actor.cpp +++ b/fdbserver/workloads/SaveAndKill.actor.cpp @@ -33,6 +33,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct SaveAndKillWorkload : TestWorkload { + static constexpr auto NAME = "SaveAndKill"; std::string restartInfo; double testDuration; @@ -44,7 +45,6 @@ struct SaveAndKillWorkload : TestWorkload { isRestoring = getOption(options, "isRestoring"_sr, 0); } - std::string description() const override { return "SaveAndKillWorkload"; } void disableFailureInjectionWorkloads(std::set& out) const override { out.insert("all"); } Future setup(Database const& cx) override { g_simulator->disableSwapsToAll(); @@ -157,4 +157,4 @@ struct SaveAndKillWorkload : TestWorkload { void getMetrics(std::vector&) override {} }; -WorkloadFactory SaveAndKillWorkloadFactory("SaveAndKill"); +WorkloadFactory SaveAndKillWorkloadFactory; diff --git a/fdbserver/workloads/SelectorCorrectness.actor.cpp b/fdbserver/workloads/SelectorCorrectness.actor.cpp index 7391850be47..157ed86b589 100644 --- a/fdbserver/workloads/SelectorCorrectness.actor.cpp +++ b/fdbserver/workloads/SelectorCorrectness.actor.cpp @@ -25,6 +25,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct SelectorCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "SelectorCorrectness"; + int minOperationsPerTransaction, maxOperationsPerTransaction, maxKeySpace, maxOffset; bool testReadYourWrites; double testDuration; @@ -43,8 +45,6 @@ struct SelectorCorrectnessWorkload : TestWorkload { testDuration = getOption(options, "testDuration"_sr, 10.0); } - std::string description() const override { return "SelectorCorrectness"; } - Future setup(Database const& cx) override { return SelectorCorrectnessSetup(cx->clone(), this); } Future start(Database const& cx) override { @@ -245,4 +245,4 @@ struct SelectorCorrectnessWorkload : TestWorkload { } }; -WorkloadFactory SelectorCorrectnessWorkloadFactory("SelectorCorrectness"); +WorkloadFactory SelectorCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/Serializability.actor.cpp b/fdbserver/workloads/Serializability.actor.cpp index 2ae286b54a6..c520c652b6c 100644 --- a/fdbserver/workloads/Serializability.actor.cpp +++ b/fdbserver/workloads/Serializability.actor.cpp @@ -26,6 +26,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct SerializabilityWorkload : TestWorkload { + static constexpr auto NAME = "Serializability"; + double testDuration; bool adjacentKeys; int nodes; @@ -83,8 +85,6 @@ struct SerializabilityWorkload : TestWorkload { .detail("MaxClearSize", maxClearSize); } - std::string description() const override { return "Serializability"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -531,4 +531,4 @@ struct SerializabilityWorkload : TestWorkload { } }; -WorkloadFactory SerializabilityWorkloadFactory("Serializability"); +WorkloadFactory SerializabilityWorkloadFactory; diff --git a/fdbserver/workloads/Sideband.actor.cpp b/fdbserver/workloads/Sideband.actor.cpp index d992972d436..14e7c3102af 100644 --- a/fdbserver/workloads/Sideband.actor.cpp +++ b/fdbserver/workloads/Sideband.actor.cpp @@ -50,6 +50,8 @@ struct SidebandInterface { }; struct SidebandWorkload : TestWorkload { + static constexpr auto NAME = "Sideband"; + double testDuration, operationsPerSecond; SidebandInterface interf; @@ -63,7 +65,6 @@ struct SidebandWorkload : TestWorkload { operationsPerSecond = getOption(options, "operationsPerSecond"_sr, 50.0); } - std::string description() const override { return "SidebandWorkload"; } Future setup(Database const& cx) override { return persistInterface(this, cx->clone()); } Future start(Database const& cx) override { clients.push_back(mutator(this, cx->clone())); @@ -189,4 +190,4 @@ struct SidebandWorkload : TestWorkload { } }; -WorkloadFactory SidebandWorkloadFactory("Sideband"); +WorkloadFactory SidebandWorkloadFactory; diff --git a/fdbserver/workloads/SidebandSingle.actor.cpp b/fdbserver/workloads/SidebandSingle.actor.cpp index a518385507b..900d93f1d04 100644 --- a/fdbserver/workloads/SidebandSingle.actor.cpp +++ b/fdbserver/workloads/SidebandSingle.actor.cpp @@ -34,6 +34,8 @@ */ struct SidebandSingleWorkload : TestWorkload { + static constexpr auto NAME = "SidebandSingle"; + double testDuration, operationsPerSecond; // Pair represents PromiseStream> interf; @@ -48,7 +50,6 @@ struct SidebandSingleWorkload : TestWorkload { operationsPerSecond = getOption(options, "operationsPerSecond"_sr, 50.0); } - std::string description() const override { return "SidebandSingleWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (clientId != 0) @@ -191,4 +192,4 @@ struct SidebandSingleWorkload : TestWorkload { } }; -WorkloadFactory SidebandSingleWorkloadFactory("SidebandSingle"); +WorkloadFactory SidebandSingleWorkloadFactory; diff --git a/fdbserver/workloads/SimpleAtomicAdd.actor.cpp b/fdbserver/workloads/SimpleAtomicAdd.actor.cpp index b65710baf61..8be6e1705c1 100644 --- a/fdbserver/workloads/SimpleAtomicAdd.actor.cpp +++ b/fdbserver/workloads/SimpleAtomicAdd.actor.cpp @@ -26,6 +26,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct SimpleAtomicAddWorkload : TestWorkload { + static constexpr auto NAME = "SimpleAtomicAdd"; + int addValue; int iterations; bool initialize; @@ -43,8 +45,6 @@ struct SimpleAtomicAddWorkload : TestWorkload { sumKey = getOption(options, "sumKey"_sr, "sumKey"_sr); } - std::string description() const override { return "SimpleAtomicAdd"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -134,4 +134,4 @@ struct SimpleAtomicAddWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory SimpleAtomicAddWorkloadFactory("SimpleAtomicAdd"); +WorkloadFactory SimpleAtomicAddWorkloadFactory; diff --git a/fdbserver/workloads/SkewedReadWrite.actor.cpp b/fdbserver/workloads/SkewedReadWrite.actor.cpp index f537a0a1e52..20fcf24233e 100644 --- a/fdbserver/workloads/SkewedReadWrite.actor.cpp +++ b/fdbserver/workloads/SkewedReadWrite.actor.cpp @@ -35,6 +35,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct SkewedReadWriteWorkload : ReadWriteCommon { + static constexpr auto NAME = "SkewedReadWrite"; // server based hot traffic setting int skewRound = 0; // skewDuration = ceil(testDuration / skewRound) double hotServerFraction = 0, hotServerShardFraction = 1.0; // set > 0 to issue hot key based on shard map @@ -59,7 +60,6 @@ struct SkewedReadWriteWorkload : ReadWriteCommon { ASSERT((hotServerReadFrac >= hotServerFraction || hotServerWriteFrac >= hotServerFraction) && skewRound > 0); } - std::string description() const override { return descriptionString.toString(); } Future start(Database const& cx) override { return _start(cx, this); } void debugPrintServerShards() const { @@ -366,7 +366,7 @@ struct SkewedReadWriteWorkload : ReadWriteCommon { } }; -WorkloadFactory SkewedReadWriteWorkloadFactory("SkewedReadWrite"); +WorkloadFactory SkewedReadWriteWorkloadFactory; TEST_CASE("/KVWorkload/methods/ParseKeyForIndex") { WorkloadContext wcx; @@ -374,7 +374,7 @@ TEST_CASE("/KVWorkload/methods/ParseKeyForIndex") { wcx.clientCount = 1; wcx.sharedRandomNumber = 1; - auto wk = SkewedReadWriteWorkload(wcx); + auto wk = TestWorkloadImpl(wcx); for (int i = 0; i < 1000; ++i) { auto idx = deterministicRandom()->randomInt64(0, wk.nodeCount); Key k = wk.keyForIndex(idx); diff --git a/fdbserver/workloads/SlowTaskWorkload.actor.cpp b/fdbserver/workloads/SlowTaskWorkload.actor.cpp index f03debca867..bb4b69d7e93 100644 --- a/fdbserver/workloads/SlowTaskWorkload.actor.cpp +++ b/fdbserver/workloads/SlowTaskWorkload.actor.cpp @@ -27,11 +27,10 @@ // Stress test the slow task profiler or flow profiler struct SlowTaskWorkload : TestWorkload { + static constexpr auto NAME = "SlowTaskWorkload"; SlowTaskWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {} - std::string description() const override { return "SlowTaskWorkload"; } - Future start(Database const& cx) override { setupRunLoopProfiler(); return go(); @@ -79,4 +78,4 @@ struct SlowTaskWorkload : TestWorkload { } }; -WorkloadFactory SlowTaskWorkloadFactory("SlowTaskWorkload"); +WorkloadFactory SlowTaskWorkloadFactory; diff --git a/fdbserver/workloads/SnapTest.actor.cpp b/fdbserver/workloads/SnapTest.actor.cpp index e2eb69e8bed..e69c5ab9c27 100644 --- a/fdbserver/workloads/SnapTest.actor.cpp +++ b/fdbserver/workloads/SnapTest.actor.cpp @@ -96,6 +96,8 @@ void printMessages(std::vector>& messages) { } struct SnapTestWorkload : TestWorkload { + static constexpr auto NAME = "SnapTest"; + public: // variables int numSnaps; // num of snapshots to be taken // FIXME: currently validation works on numSnap = 1 @@ -124,7 +126,6 @@ struct SnapTestWorkload : TestWorkload { } public: // workload functions - std::string description() const override { return "SnapTest"; } Future setup(Database const& cx) override { TraceEvent("SnapTestWorkloadSetup").log(); return Void(); @@ -343,4 +344,4 @@ struct SnapTestWorkload : TestWorkload { } }; -WorkloadFactory SnapTestWorkloadFactory("SnapTest"); +WorkloadFactory SnapTestWorkloadFactory; diff --git a/fdbserver/workloads/SpecialKeySpaceCorrectness.actor.cpp b/fdbserver/workloads/SpecialKeySpaceCorrectness.actor.cpp index 5c7f269088b..6bf11293d6c 100644 --- a/fdbserver/workloads/SpecialKeySpaceCorrectness.actor.cpp +++ b/fdbserver/workloads/SpecialKeySpaceCorrectness.actor.cpp @@ -35,6 +35,7 @@ #include "flow/actorcompiler.h" struct SpecialKeySpaceCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "SpecialKeySpaceCorrectness"; int actorCount, minKeysPerRange, maxKeysPerRange, rangeCount, keyBytes, valBytes, conflictRangeSizeFactor; double testDuration, absoluteRandomProb, transactionsPerSecond; @@ -61,7 +62,6 @@ struct SpecialKeySpaceCorrectnessWorkload : TestWorkload { ASSERT(conflictRangeSizeFactor >= 1); } - std::string description() const override { return "SpecialKeySpaceCorrectness"; } Future setup(Database const& cx) override { return _setup(cx, this); } Future start(Database const& cx) override { return _start(cx, this); } Future check(Database const& cx) override { return wrongResults.getValue() == 0; } @@ -1548,4 +1548,4 @@ struct SpecialKeySpaceCorrectnessWorkload : TestWorkload { } }; -WorkloadFactory SpecialKeySpaceCorrectnessFactory("SpecialKeySpaceCorrectness"); +WorkloadFactory SpecialKeySpaceCorrectnessFactory; diff --git a/fdbserver/workloads/StatusWorkload.actor.cpp b/fdbserver/workloads/StatusWorkload.actor.cpp index 52fbb438604..be9ff6d1677 100644 --- a/fdbserver/workloads/StatusWorkload.actor.cpp +++ b/fdbserver/workloads/StatusWorkload.actor.cpp @@ -28,6 +28,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct StatusWorkload : TestWorkload { + static constexpr auto NAME = "Status"; + double testDuration, requestsPerSecond; bool enableLatencyBands; @@ -52,7 +54,6 @@ struct StatusWorkload : TestWorkload { } } - std::string description() const override { return "StatusWorkload"; } Future setup(Database const& cx) override { if (enableLatencyBands) { latencyBandActor = configureLatencyBands(this, cx); @@ -203,7 +204,7 @@ struct StatusWorkload : TestWorkload { } }; -WorkloadFactory StatusWorkloadFactory("Status"); +WorkloadFactory StatusWorkloadFactory; TEST_CASE("/fdbserver/status/schema/basic") { json_spirit::mValue schema = diff --git a/fdbserver/workloads/StorageQuota.actor.cpp b/fdbserver/workloads/StorageQuota.actor.cpp index d3ab1ec826c..16230834124 100644 --- a/fdbserver/workloads/StorageQuota.actor.cpp +++ b/fdbserver/workloads/StorageQuota.actor.cpp @@ -25,9 +25,9 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct StorageQuotaWorkload : TestWorkload { + static constexpr auto NAME = "StorageQuota"; StorageQuotaWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {} - std::string description() const override { return "StorageQuotaWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return (clientId == 0) ? _start(cx) : Void(); } Future check(Database const& cx) override { return true; } @@ -75,4 +75,4 @@ struct StorageQuotaWorkload : TestWorkload { } }; -WorkloadFactory StorageQuotaWorkloadFactory("StorageQuota"); +WorkloadFactory StorageQuotaWorkloadFactory; diff --git a/fdbserver/workloads/StorageServerCheckpointRestoreTest.actor.cpp b/fdbserver/workloads/StorageServerCheckpointRestoreTest.actor.cpp index f3d6533f18c..b2b42285916 100644 --- a/fdbserver/workloads/StorageServerCheckpointRestoreTest.actor.cpp +++ b/fdbserver/workloads/StorageServerCheckpointRestoreTest.actor.cpp @@ -44,6 +44,7 @@ std::string printValue(const ErrorOr>& value) { } // namespace struct SSCheckpointRestoreWorkload : TestWorkload { + static constexpr auto NAME = "SSCheckpointRestoreWorkload"; const bool enabled; bool pass; @@ -56,8 +57,6 @@ struct SSCheckpointRestoreWorkload : TestWorkload { pass = false; } - std::string description() const override { return "SSCheckpoint"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -246,4 +245,4 @@ struct SSCheckpointRestoreWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory SSCheckpointRestoreWorkloadFactory("SSCheckpointRestoreWorkload"); \ No newline at end of file +WorkloadFactory SSCheckpointRestoreWorkloadFactory; \ No newline at end of file diff --git a/fdbserver/workloads/Storefront.actor.cpp b/fdbserver/workloads/Storefront.actor.cpp index e1c2b72baa8..ff09fc9768d 100644 --- a/fdbserver/workloads/Storefront.actor.cpp +++ b/fdbserver/workloads/Storefront.actor.cpp @@ -31,6 +31,8 @@ typedef uint64_t orderID; struct StorefrontWorkload : TestWorkload { + static constexpr auto NAME = "Storefront"; + double testDuration, transactionsPerSecond, minExpectedTransactionsPerSecond; int actorCount, itemCount, maxOrderSize; // bool isFulfilling; @@ -51,8 +53,6 @@ struct StorefrontWorkload : TestWorkload { minExpectedTransactionsPerSecond = transactionsPerSecond * getOption(options, "expectedRate"_sr, 0.9); } - std::string description() const override { return "StorefrontWorkload"; } - Future setup(Database const& cx) override { return bulkSetup(cx, this, itemCount, Promise()); } Future start(Database const& cx) override { @@ -288,4 +288,4 @@ struct StorefrontWorkload : TestWorkload { } }; -WorkloadFactory StorefrontWorkloadFactory("Storefront"); +WorkloadFactory StorefrontWorkloadFactory; diff --git a/fdbserver/workloads/StreamingRangeRead.actor.cpp b/fdbserver/workloads/StreamingRangeRead.actor.cpp index a461fc4fb3e..290b1d4597a 100644 --- a/fdbserver/workloads/StreamingRangeRead.actor.cpp +++ b/fdbserver/workloads/StreamingRangeRead.actor.cpp @@ -84,6 +84,7 @@ ACTOR Future convertStream(PromiseStream input, PromiseStream } struct StreamingRangeReadWorkload : KVWorkload { + static constexpr auto NAME = "StreamingRangeRead"; double testDuration; std::string valueString; Future client; @@ -100,7 +101,6 @@ struct StreamingRangeReadWorkload : KVWorkload { Standalone operator()(uint64_t n) { return KeyValueRef(keyForIndex(n, false), randomValue()); } - std::string description() const override { return "StreamingRangeReadWorkload"; } Future setup(Database const& cx) override { return bulkSetup(cx, this, nodeCount, Promise()); } Future start(Database const& cx) override { client = timeout(streamingClient(cx->clone(), this), testDuration, Void()); @@ -174,4 +174,4 @@ struct StreamingRangeReadWorkload : KVWorkload { } }; -WorkloadFactory StreamingRangeReadWorkloadFactory("StreamingRangeRead"); +WorkloadFactory StreamingRangeReadWorkloadFactory; diff --git a/fdbserver/workloads/StreamingRead.actor.cpp b/fdbserver/workloads/StreamingRead.actor.cpp index 891c835d2ec..da8656d2b30 100644 --- a/fdbserver/workloads/StreamingRead.actor.cpp +++ b/fdbserver/workloads/StreamingRead.actor.cpp @@ -26,6 +26,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct StreamingReadWorkload : TestWorkload { + static constexpr auto NAME = "StreamingRead"; + int actorCount, keyBytes, valueBytes, readsPerTransaction, nodeCount; int rangesPerTransaction; bool readSequentially; @@ -53,8 +55,6 @@ struct StreamingReadWorkload : TestWorkload { readSequentially = getOption(options, "readSequentially"_sr, false); } - std::string description() const override { return "StreamingRead"; } - Future setup(Database const& cx) override { return bulkSetup(cx, this, nodeCount, Promise(), true, warmingDelay); } @@ -150,4 +150,4 @@ struct StreamingReadWorkload : TestWorkload { } }; -WorkloadFactory StreamingReadWorkloadFactory("StreamingRead"); +WorkloadFactory StreamingReadWorkloadFactory; diff --git a/fdbserver/workloads/SubmitBackup.actor.cpp b/fdbserver/workloads/SubmitBackup.actor.cpp index fa61d82977e..8cf59652ed3 100644 --- a/fdbserver/workloads/SubmitBackup.actor.cpp +++ b/fdbserver/workloads/SubmitBackup.actor.cpp @@ -27,7 +27,8 @@ #include "fdbserver/workloads/workloads.actor.h" #include "flow/actorcompiler.h" // This must be the last #include. -struct SubmitBackupWorkload final : TestWorkload { +struct SubmitBackupWorkload : TestWorkload { + static constexpr auto NAME = "SubmitBackup"; FileBackupAgent backupAgent; @@ -49,8 +50,6 @@ struct SubmitBackupWorkload final : TestWorkload { incremental.set(getOption(options, "incremental"_sr, false)); } - static constexpr const char* DESCRIPTION = "SubmitBackup"; - ACTOR static Future _start(SubmitBackupWorkload* self, Database cx) { wait(delay(self->delayFor)); Standalone> backupRanges; @@ -76,11 +75,10 @@ struct SubmitBackupWorkload final : TestWorkload { return Void(); } - std::string description() const override { return DESCRIPTION; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return clientId ? Void() : _start(this, cx); } Future check(Database const& cx) override { return true; } void getMetrics(std::vector& m) override {} }; -WorkloadFactory SubmitBackupWorkloadFactory(SubmitBackupWorkload::DESCRIPTION); +WorkloadFactory SubmitBackupWorkloadFactory; diff --git a/fdbserver/workloads/SuspendProcesses.actor.cpp b/fdbserver/workloads/SuspendProcesses.actor.cpp index 7b24b11eeb7..5fa2ecfbe69 100644 --- a/fdbserver/workloads/SuspendProcesses.actor.cpp +++ b/fdbserver/workloads/SuspendProcesses.actor.cpp @@ -29,6 +29,7 @@ #include "flow/actorcompiler.h" // has to be last include struct SuspendProcessesWorkload : TestWorkload { + static constexpr auto NAME = "SuspendProcesses"; std::vector prefixSuspendProcesses; double suspendTimeDuration; double waitTimeDuration; @@ -39,8 +40,6 @@ struct SuspendProcessesWorkload : TestWorkload { suspendTimeDuration = getOption(options, "suspendTimeDuration"_sr, 0); } - std::string description() const override { return "SuspendProcesses"; } - Future setup(Database const& cx) override { return Void(); } ACTOR Future _start(Database cx, SuspendProcessesWorkload* self) { @@ -87,4 +86,4 @@ struct SuspendProcessesWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory SuspendProcessesWorkloadFactory("SuspendProcesses"); +WorkloadFactory SuspendProcessesWorkloadFactory; diff --git a/fdbserver/workloads/TagThrottleApi.actor.cpp b/fdbserver/workloads/TagThrottleApi.actor.cpp index b1b06d2f8f2..ac474179598 100644 --- a/fdbserver/workloads/TagThrottleApi.actor.cpp +++ b/fdbserver/workloads/TagThrottleApi.actor.cpp @@ -30,15 +30,13 @@ struct TagThrottleApiWorkload : TestWorkload { bool autoThrottleEnabled; double testDuration; - constexpr static const char* NAME = "TagThrottleApi"; + constexpr static auto NAME = "TagThrottleApi"; TagThrottleApiWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { testDuration = getOption(options, "testDuration"_sr, 10.0); autoThrottleEnabled = SERVER_KNOBS->AUTO_TAG_THROTTLING_ENABLED; } - std::string description() const override { return TagThrottleApiWorkload::NAME; } - Future setup(Database const& cx) override { DatabaseContext::debugUseTags = true; return Void(); @@ -271,4 +269,4 @@ struct TagThrottleApiWorkload : TestWorkload { } }; -WorkloadFactory TagThrottleApiWorkloadFactory(TagThrottleApiWorkload::NAME); +WorkloadFactory TagThrottleApiWorkloadFactory; diff --git a/fdbserver/workloads/TargetedKill.actor.cpp b/fdbserver/workloads/TargetedKill.actor.cpp index 2ba29b814f6..f289673ebfc 100644 --- a/fdbserver/workloads/TargetedKill.actor.cpp +++ b/fdbserver/workloads/TargetedKill.actor.cpp @@ -30,6 +30,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct TargetedKillWorkload : TestWorkload { + static constexpr auto NAME = "TargetedKill"; + std::string machineToKill; bool enabled, killAllMachineProcesses; int numKillStorages; @@ -47,7 +49,6 @@ struct TargetedKillWorkload : TestWorkload { numKillStorages = getOption(options, "numKillStorages"_sr, 1); } - std::string description() const override { return "TargetedKillWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (enabled) @@ -162,4 +163,4 @@ struct TargetedKillWorkload : TestWorkload { } }; -WorkloadFactory TargetedKillWorkloadFactory("TargetedKill"); +WorkloadFactory TargetedKillWorkloadFactory; diff --git a/fdbserver/workloads/TaskBucketCorrectness.actor.cpp b/fdbserver/workloads/TaskBucketCorrectness.actor.cpp index 1df20d1ca00..c56ce64d8a3 100644 --- a/fdbserver/workloads/TaskBucketCorrectness.actor.cpp +++ b/fdbserver/workloads/TaskBucketCorrectness.actor.cpp @@ -18,11 +18,6 @@ * limitations under the License. */ -#include -#include -#include - -#include "fdbrpc/simulator.h" #include "flow/UnitTest.h" #include "flow/Error.h" #include "fdbclient/Tuple.h" @@ -207,6 +202,8 @@ REGISTER_TASKFUNC(SaidHelloTaskFunc); // A workload which test the correctness of TaskBucket struct TaskBucketCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "TaskBucketCorrectness"; + bool chained; int subtaskCount; @@ -215,8 +212,6 @@ struct TaskBucketCorrectnessWorkload : TestWorkload { subtaskCount = getOption(options, "subtaskCount"_sr, 20); } - std::string description() const override { return "TaskBucketCorrectness"; } - Future start(Database const& cx) override { return _start(cx, this); } Future check(Database const& cx) override { return _check(cx, this); } @@ -343,7 +338,7 @@ struct TaskBucketCorrectnessWorkload : TestWorkload { } }; -WorkloadFactory TaskBucketCorrectnessWorkloadFactory("TaskBucketCorrectness"); +WorkloadFactory TaskBucketCorrectnessWorkloadFactory; void print_subspace_key(const Subspace& subspace, int id) { printf("%d==========%s===%d\n", id, printable(StringRef(subspace.key())).c_str(), subspace.key().size()); diff --git a/fdbserver/workloads/TenantEntryCacheWorkload.actor.cpp b/fdbserver/workloads/TenantEntryCacheWorkload.actor.cpp index 07b716073b6..67bd5fd8659 100644 --- a/fdbserver/workloads/TenantEntryCacheWorkload.actor.cpp +++ b/fdbserver/workloads/TenantEntryCacheWorkload.actor.cpp @@ -18,7 +18,6 @@ * limitations under the License. */ -#include "fdbclient/DatabaseContext.h" #include "fdbclient/NativeAPI.actor.h" #include "fdbclient/TenantManagement.actor.h" @@ -42,6 +41,8 @@ TenantEntryCachePayload createPayload(const TenantName& name, const Ten } // namespace struct TenantEntryCacheWorkload : TestWorkload { + static constexpr auto NAME = "TenantEntryCache"; + const TenantName tenantNamePrefix = "tenant_entry_cache_workload_"_sr; TenantName localTenantNamePrefix; int maxTenants; @@ -316,9 +317,8 @@ struct TenantEntryCacheWorkload : TestWorkload { return Void(); } - std::string description() const override { return "TenantEntryCache"; } Future check(Database const& cx) override { return true; } void getMetrics(std::vector& m) override {} }; -WorkloadFactory TenantEntryCacheWorkloadFactory("TenantEntryCache"); \ No newline at end of file +WorkloadFactory TenantEntryCacheWorkloadFactory; \ No newline at end of file diff --git a/fdbserver/workloads/TenantManagementConcurrencyWorkload.actor.cpp b/fdbserver/workloads/TenantManagementConcurrencyWorkload.actor.cpp index d52ba98fc21..81cf4601104 100644 --- a/fdbserver/workloads/TenantManagementConcurrencyWorkload.actor.cpp +++ b/fdbserver/workloads/TenantManagementConcurrencyWorkload.actor.cpp @@ -38,6 +38,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct TenantManagementConcurrencyWorkload : TestWorkload { + static constexpr auto NAME = "TenantManagementConcurrency"; + const TenantName tenantNamePrefix = "tenant_management_concurrency_workload_"_sr; const Key testParametersKey = "test_parameters"_sr; @@ -62,8 +64,6 @@ struct TenantManagementConcurrencyWorkload : TestWorkload { } } - std::string description() const override { return "TenantManagementConcurrency"; } - void disableFailureInjectionWorkloads(std::set& out) const override { out.insert("MachineAttritionWorkload"); } @@ -343,5 +343,4 @@ struct TenantManagementConcurrencyWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory TenantManagementConcurrencyWorkloadFactory( - "TenantManagementConcurrency"); +WorkloadFactory TenantManagementConcurrencyWorkloadFactory; diff --git a/fdbserver/workloads/TenantManagementWorkload.actor.cpp b/fdbserver/workloads/TenantManagementWorkload.actor.cpp index b6a29cfd96e..1d6c7786de3 100644 --- a/fdbserver/workloads/TenantManagementWorkload.actor.cpp +++ b/fdbserver/workloads/TenantManagementWorkload.actor.cpp @@ -45,6 +45,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct TenantManagementWorkload : TestWorkload { + static constexpr auto NAME = "TenantManagement"; + struct TenantData { int64_t id; Optional tenantGroup; @@ -134,8 +136,6 @@ struct TenantManagementWorkload : TestWorkload { useMetacluster = getOption(options, "useMetacluster"_sr, defaultUseMetacluster); } - std::string description() const override { return "TenantManagement"; } - struct TestParameters { constexpr static FileIdentifier file_identifier = 1527576; @@ -1783,4 +1783,4 @@ struct TenantManagementWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory TenantManagementWorkload("TenantManagement"); +WorkloadFactory TenantManagementWorkload; diff --git a/fdbserver/workloads/ThreadSafety.actor.cpp b/fdbserver/workloads/ThreadSafety.actor.cpp index c3a61039967..95d6858fd2d 100644 --- a/fdbserver/workloads/ThreadSafety.actor.cpp +++ b/fdbserver/workloads/ThreadSafety.actor.cpp @@ -102,6 +102,8 @@ struct Barrier { // A workload which uses the thread safe API from multiple threads struct ThreadSafetyWorkload : TestWorkload { + static constexpr auto NAME = "ThreadSafety"; + int threadsPerClient; double threadDuration; @@ -135,8 +137,6 @@ struct ThreadSafetyWorkload : TestWorkload { noUnseed = true; } - std::string description() const override { return "ThreadSafety"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return _start(cx, this); } @@ -292,4 +292,4 @@ struct ThreadSafetyWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory ThreadSafetyWorkloadFactory("ThreadSafety"); +WorkloadFactory ThreadSafetyWorkloadFactory; diff --git a/fdbserver/workloads/Throttling.actor.cpp b/fdbserver/workloads/Throttling.actor.cpp index afcff1ea393..4f2ade0b401 100644 --- a/fdbserver/workloads/Throttling.actor.cpp +++ b/fdbserver/workloads/Throttling.actor.cpp @@ -80,7 +80,7 @@ struct ThrottlingWorkload : KVWorkload { TokenBucket tokenBucket; bool correctSpecialKeys = true; - static constexpr const char* NAME = "Throttling"; + static constexpr auto NAME = "Throttling"; ThrottlingWorkload(WorkloadContext const& wcx) : KVWorkload(wcx), transactionsCommitted(0) { testDuration = getOption(options, "testDuration"_sr, 60.0); @@ -193,7 +193,6 @@ struct ThrottlingWorkload : KVWorkload { return Void(); } - std::string description() const override { return ThrottlingWorkload::NAME; } Future start(Database const& cx) override { return _start(cx, this); } Future check(Database const& cx) override { return correctSpecialKeys; } @@ -202,4 +201,4 @@ struct ThrottlingWorkload : KVWorkload { } }; -WorkloadFactory ThrottlingWorkloadFactory(ThrottlingWorkload::NAME); +WorkloadFactory ThrottlingWorkloadFactory; diff --git a/fdbserver/workloads/Throughput.actor.cpp b/fdbserver/workloads/Throughput.actor.cpp index a8e1d8106bb..fdee65878d4 100644 --- a/fdbserver/workloads/Throughput.actor.cpp +++ b/fdbserver/workloads/Throughput.actor.cpp @@ -298,6 +298,8 @@ struct MeasureMulti : IMeasurer { }; struct ThroughputWorkload : TestWorkload { + static constexpr auto NAME = "Throughput"; + double targetLatency, testDuration, Pgain, Igain; Reference op; Reference measurer; @@ -358,8 +360,6 @@ struct ThroughputWorkload : TestWorkload { // testDuration = getOption( options, "testDuration"_sr, measureDelay + measureDuration ); } - std::string description() const override { return "Throughput"; } - Future setup(Database const& cx) override { return Void(); // No setup for now - use a separate workload to do setup } @@ -417,4 +417,4 @@ struct ThroughputWorkload : TestWorkload { void getMetrics(std::vector& m) override { measurer->getMetrics(m); } }; -WorkloadFactory ThroughputWorkloadFactory("Throughput"); +WorkloadFactory ThroughputWorkloadFactory; diff --git a/fdbserver/workloads/TimeKeeperCorrectness.actor.cpp b/fdbserver/workloads/TimeKeeperCorrectness.actor.cpp index acaa025d054..fe994acd088 100644 --- a/fdbserver/workloads/TimeKeeperCorrectness.actor.cpp +++ b/fdbserver/workloads/TimeKeeperCorrectness.actor.cpp @@ -25,6 +25,8 @@ #include "flow/actorcompiler.h" // has to be last include struct TimeKeeperCorrectnessWorkload : TestWorkload { + static constexpr auto NAME = "TimeKeeperCorrectness"; + double testDuration; std::map inMemTimeKeeper; @@ -32,8 +34,6 @@ struct TimeKeeperCorrectnessWorkload : TestWorkload { testDuration = getOption(options, "testDuration"_sr, 20.0); } - std::string description() const override { return "TimeKeeperCorrectness"; } - Future setup(Database const& cx) override { return Void(); } void getMetrics(std::vector& m) override {} @@ -122,4 +122,4 @@ struct TimeKeeperCorrectnessWorkload : TestWorkload { Future check(Database const& cx) override { return _check(cx, this); } }; -WorkloadFactory TimeKeeperCorrectnessWorkloadFactory("TimeKeeperCorrectness"); +WorkloadFactory TimeKeeperCorrectnessWorkloadFactory; diff --git a/fdbserver/workloads/TriggerRecovery.actor.cpp b/fdbserver/workloads/TriggerRecovery.actor.cpp index 14d739a8334..94c338e3903 100644 --- a/fdbserver/workloads/TriggerRecovery.actor.cpp +++ b/fdbserver/workloads/TriggerRecovery.actor.cpp @@ -27,6 +27,8 @@ #include "flow/actorcompiler.h" // has to be last include struct TriggerRecoveryLoopWorkload : TestWorkload { + static constexpr auto NAME = "TriggerRecoveryLoop"; + double startTime; int numRecoveries; double delayBetweenRecoveries; @@ -46,8 +48,6 @@ struct TriggerRecoveryLoopWorkload : TestWorkload { .detail("DelayBetweenRecoveries", delayBetweenRecoveries); } - std::string description() const override { return "TriggerRecoveryLoop"; } - ACTOR Future setOriginalNumOfResolvers(Database cx, TriggerRecoveryLoopWorkload* self) { DatabaseConfiguration config = wait(getDatabaseConfiguration(cx)); self->originalNumOfResolvers = self->currentNumOfResolvers = config.getDesiredResolvers(); @@ -173,4 +173,4 @@ struct TriggerRecoveryLoopWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory TriggerRecoveryLoopWorkloadFactory("TriggerRecoveryLoop"); +WorkloadFactory TriggerRecoveryLoopWorkloadFactory; diff --git a/fdbserver/workloads/UDPWorkload.actor.cpp b/fdbserver/workloads/UDPWorkload.actor.cpp index d9ea607d938..80456a2d7ec 100644 --- a/fdbserver/workloads/UDPWorkload.actor.cpp +++ b/fdbserver/workloads/UDPWorkload.actor.cpp @@ -40,7 +40,7 @@ namespace { struct UDPWorkload : TestWorkload { - constexpr static const char* name = "UDPWorkload"; + constexpr static auto NAME = "UDPWorkload"; // config Key keyPrefix; double runFor; @@ -61,7 +61,6 @@ struct UDPWorkload : TestWorkload { } } - std::string description() const override { return name; } ACTOR static Future _setup(UDPWorkload* self, Database cx) { state NetworkAddress localAddress(g_network->getLocalAddress().ip, deterministicRandom()->randomInt(self->minPort, self->maxPort + 1), @@ -184,7 +183,9 @@ struct UDPWorkload : TestWorkload { finished = delay(1.0); done = Never(); } - when(wait(finished)) { return Void(); } + when(wait(finished)) { + return Void(); + } } } } @@ -198,7 +199,9 @@ struct UDPWorkload : TestWorkload { loop { choose { when(wait(delay(0.1))) {} - when(wait(actors.getResult())) { UNSTOPPABLE_ASSERT(false); } + when(wait(actors.getResult())) { + UNSTOPPABLE_ASSERT(false); + } } if (!socket.get().isValid() || deterministicRandom()->random01() < 0.05) { peer = deterministicRandom()->randomChoice(*remotes); @@ -262,4 +265,4 @@ struct UDPWorkload : TestWorkload { } // namespace -WorkloadFactory UDPWorkloadFactory(UDPWorkload::name); +WorkloadFactory UDPWorkloadFactory; diff --git a/fdbserver/workloads/UnitPerf.actor.cpp b/fdbserver/workloads/UnitPerf.actor.cpp index fce0866f2c1..36a0e3a73c6 100644 --- a/fdbserver/workloads/UnitPerf.actor.cpp +++ b/fdbserver/workloads/UnitPerf.actor.cpp @@ -49,13 +49,13 @@ ACTOR Future unitPerfTest() { } struct UnitPerfWorkload : TestWorkload { + static constexpr auto NAME = "UnitPerf"; bool enabled; UnitPerfWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { enabled = !clientId; // only do this on the "first" client } - std::string description() const override { return "UnitPerfWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { if (enabled) @@ -66,4 +66,4 @@ struct UnitPerfWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory UnitPerfWorkloadFactory("UnitPerf"); +WorkloadFactory UnitPerfWorkloadFactory; diff --git a/fdbserver/workloads/UnitTests.actor.cpp b/fdbserver/workloads/UnitTests.actor.cpp index e22e53cf26d..eecff51fcb4 100644 --- a/fdbserver/workloads/UnitTests.actor.cpp +++ b/fdbserver/workloads/UnitTests.actor.cpp @@ -46,6 +46,8 @@ void forceLinkAtomicTests(); void forceLinkIdempotencyIdTests(); struct UnitTestWorkload : TestWorkload { + static constexpr auto NAME = "UnitTests"; + bool enabled; std::string testPattern; Optional testsIgnored; @@ -104,7 +106,6 @@ struct UnitTestWorkload : TestWorkload { forceLinkIdempotencyIdTests(); } - std::string description() const override { return "UnitTests"; } Future setup(Database const& cx) override { platform::eraseDirectoryRecursive(testParams.getDataDir()); return Void(); @@ -199,7 +200,7 @@ struct UnitTestWorkload : TestWorkload { } }; -WorkloadFactory UnitTestWorkloadFactory("UnitTests"); +WorkloadFactory UnitTestWorkloadFactory; TEST_CASE("/fdbserver/UnitTestWorkload/long delay") { wait(delay(60)); diff --git a/fdbserver/workloads/Unreadable.actor.cpp b/fdbserver/workloads/Unreadable.actor.cpp index 10781db717f..5f541e647f3 100644 --- a/fdbserver/workloads/Unreadable.actor.cpp +++ b/fdbserver/workloads/Unreadable.actor.cpp @@ -27,6 +27,7 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct UnreadableWorkload : TestWorkload { + static constexpr auto NAME = "Unreadable"; uint64_t nodeCount; double testDuration; std::vector> clients; @@ -36,8 +37,6 @@ struct UnreadableWorkload : TestWorkload { nodeCount = getOption(options, "nodeCount"_sr, (uint64_t)100000); } - std::string description() const override { return "Unreadable"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -476,4 +475,4 @@ struct UnreadableWorkload : TestWorkload { } }; -WorkloadFactory UnreadableWorkloadFactory("Unreadable"); +WorkloadFactory UnreadableWorkloadFactory; diff --git a/fdbserver/workloads/ValidateStorage.actor.cpp b/fdbserver/workloads/ValidateStorage.actor.cpp index e98700c88b5..9f77973a1c7 100644 --- a/fdbserver/workloads/ValidateStorage.actor.cpp +++ b/fdbserver/workloads/ValidateStorage.actor.cpp @@ -41,6 +41,8 @@ std::string printValue(const ErrorOr>& value) { } // namespace struct ValidateStorage : TestWorkload { + static constexpr auto NAME = "ValidateStorageWorkload"; + FlowLock startMoveKeysParallelismLock; FlowLock finishMoveKeysParallelismLock; FlowLock cleanUpDataMoveParallelismLock; @@ -56,8 +58,6 @@ struct ValidateStorage : TestWorkload { ValidateStorage(WorkloadContext const& wcx) : TestWorkload(wcx), enabled(!clientId), pass(true) {} - std::string description() const override { return "ValidateStorage"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -186,4 +186,4 @@ struct ValidateStorage : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory ValidateStorageFactory("ValidateStorageWorkload"); \ No newline at end of file +WorkloadFactory ValidateStorageFactory; \ No newline at end of file diff --git a/fdbserver/workloads/VersionStamp.actor.cpp b/fdbserver/workloads/VersionStamp.actor.cpp index 1278b8ccb9f..82e7d38c47b 100644 --- a/fdbserver/workloads/VersionStamp.actor.cpp +++ b/fdbserver/workloads/VersionStamp.actor.cpp @@ -29,6 +29,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct VersionStampWorkload : TestWorkload { + static constexpr auto NAME = "VersionStamp"; + uint64_t nodeCount; double testDuration; double transactionsPerSecond; @@ -58,8 +60,6 @@ struct VersionStampWorkload : TestWorkload { soleOwnerOfMetadataVersionKey = getOption(options, "soleOwnerOfMetadataVersionKey"_sr, false); } - std::string description() const override { return "VersionStamp"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { @@ -452,4 +452,4 @@ struct VersionStampWorkload : TestWorkload { } }; -WorkloadFactory VersionStampWorkloadFactory("VersionStamp"); +WorkloadFactory VersionStampWorkloadFactory; diff --git a/fdbserver/workloads/WatchAndWait.actor.cpp b/fdbserver/workloads/WatchAndWait.actor.cpp index a8017949a9d..4dfd8524221 100644 --- a/fdbserver/workloads/WatchAndWait.actor.cpp +++ b/fdbserver/workloads/WatchAndWait.actor.cpp @@ -27,6 +27,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct WatchAndWaitWorkload : TestWorkload { + static constexpr auto NAME = "WatchAndWait"; + uint64_t nodeCount, watchCount; int64_t nodePrefix; int keyBytes; @@ -55,8 +57,6 @@ struct WatchAndWaitWorkload : TestWorkload { } } - std::string description() const override { return "WatchAndWait"; } - Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return _start(cx, this); } @@ -130,4 +130,4 @@ struct WatchAndWaitWorkload : TestWorkload { } }; -WorkloadFactory WatchAndWaitWorkloadFactory("WatchAndWait"); +WorkloadFactory WatchAndWaitWorkloadFactory; diff --git a/fdbserver/workloads/Watches.actor.cpp b/fdbserver/workloads/Watches.actor.cpp index 37f3e624d29..f2bafae6b0b 100644 --- a/fdbserver/workloads/Watches.actor.cpp +++ b/fdbserver/workloads/Watches.actor.cpp @@ -28,6 +28,8 @@ const int sampleSize = 10000; struct WatchesWorkload : TestWorkload { + static constexpr auto NAME = "Watches"; + int nodes, keyBytes, extraPerNode; double testDuration; std::vector> clients; @@ -47,8 +49,6 @@ struct WatchesWorkload : TestWorkload { tempRand.randomShuffle(nodeOrder); } - std::string description() const override { return "Watches"; } - Future setup(Database const& cx) override { return _setup(cx, this); } Future start(Database const& cx) override { @@ -263,4 +263,4 @@ struct WatchesWorkload : TestWorkload { } }; -WorkloadFactory WatchesWorkloadFactory("Watches"); +WorkloadFactory WatchesWorkloadFactory; diff --git a/fdbserver/workloads/WatchesSameKeyCorrectness.actor.cpp b/fdbserver/workloads/WatchesSameKeyCorrectness.actor.cpp index ec728e2cf5a..72b14d2247b 100644 --- a/fdbserver/workloads/WatchesSameKeyCorrectness.actor.cpp +++ b/fdbserver/workloads/WatchesSameKeyCorrectness.actor.cpp @@ -27,15 +27,14 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct WatchesSameKeyWorkload : TestWorkload { + static constexpr auto NAME = "WatchesSameKeyCorrectness"; int numWatches; std::vector> cases; WatchesSameKeyWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) { numWatches = getOption(options, "numWatches"_sr, 3); } - - std::string description() const override { return "WatchesSameKeyCorrectness"; } - + Future setup(Database const& cx) override { cases.push_back(case1(cx, "foo1"_sr, this)); cases.push_back(case2(cx, "foo2"_sr, this)); @@ -241,4 +240,4 @@ struct WatchesSameKeyWorkload : TestWorkload { void getMetrics(std::vector& m) override {} }; -WorkloadFactory WatchesSameKeyWorkloadFactory("WatchesSameKeyCorrectness"); +WorkloadFactory WatchesSameKeyWorkloadFactory; diff --git a/fdbserver/workloads/WorkerErrors.actor.cpp b/fdbserver/workloads/WorkerErrors.actor.cpp index 2ab8c3e2552..ff6ea278fd2 100644 --- a/fdbserver/workloads/WorkerErrors.actor.cpp +++ b/fdbserver/workloads/WorkerErrors.actor.cpp @@ -28,9 +28,10 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct WorkerErrorsWorkload : TestWorkload { + static constexpr auto NAME = "WorkerErrors"; + WorkerErrorsWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {} - std::string description() const override { return "WorkerErrorsWorkload"; } Future setup(Database const& cx) override { return Void(); } Future start(Database const& cx) override { return _start(cx, this); } void getMetrics(std::vector& m) override {} @@ -65,4 +66,4 @@ struct WorkerErrorsWorkload : TestWorkload { Future check(Database const& cx) override { return true; } }; -WorkloadFactory WorkerErrorsWorkloadFactory("WorkerErrors"); +WorkloadFactory WorkerErrorsWorkloadFactory; diff --git a/fdbserver/workloads/WriteBandwidth.actor.cpp b/fdbserver/workloads/WriteBandwidth.actor.cpp index f77ce0584ee..4446ab676ae 100644 --- a/fdbserver/workloads/WriteBandwidth.actor.cpp +++ b/fdbserver/workloads/WriteBandwidth.actor.cpp @@ -29,6 +29,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct WriteBandwidthWorkload : KVWorkload { + static constexpr auto NAME = "WriteBandwidth"; + int keysPerTransaction; double testDuration, warmingDelay, loadTime, maxInsertRate; std::string valueString; @@ -48,7 +50,6 @@ struct WriteBandwidthWorkload : KVWorkload { maxInsertRate = getOption(options, "maxInsertRate"_sr, 1e12); } - std::string description() const override { return "WriteBandwidth"; } Future setup(Database const& cx) override { return _setup(cx, this); } Future start(Database const& cx) override { return _start(cx, this); } @@ -139,4 +140,4 @@ struct WriteBandwidthWorkload : KVWorkload { } }; -WorkloadFactory WriteBandwidthWorkloadFactory("WriteBandwidth"); +WorkloadFactory WriteBandwidthWorkloadFactory; diff --git a/fdbserver/workloads/WriteDuringRead.actor.cpp b/fdbserver/workloads/WriteDuringRead.actor.cpp index 2793d439b03..dedcad28b32 100644 --- a/fdbserver/workloads/WriteDuringRead.actor.cpp +++ b/fdbserver/workloads/WriteDuringRead.actor.cpp @@ -31,6 +31,8 @@ #include "flow/actorcompiler.h" // This must be the last #include. struct WriteDuringReadWorkload : TestWorkload { + static constexpr auto NAME = "WriteDuringRead"; + double testDuration, slowModeStart; int numOps; bool rarelyCommit, adjacentKeys; @@ -113,8 +115,6 @@ struct WriteDuringReadWorkload : TestWorkload { .detail("MaxClearSize", maxClearSize); } - std::string description() const override { return "WriteDuringRead"; } - ACTOR Future setupImpl(WriteDuringReadWorkload* self, Database cx) { // If we are operating in the default tenant but enable raw access, we should only write keys // in the tenant's key-space. @@ -1101,4 +1101,4 @@ struct WriteDuringReadWorkload : TestWorkload { } }; -WorkloadFactory WriteDuringReadWorkloadFactory("WriteDuringRead"); +WorkloadFactory WriteDuringReadWorkloadFactory; diff --git a/fdbserver/workloads/WriteTagThrottling.actor.cpp b/fdbserver/workloads/WriteTagThrottling.actor.cpp index b2e5f66a439..043bae5e0ff 100644 --- a/fdbserver/workloads/WriteTagThrottling.actor.cpp +++ b/fdbserver/workloads/WriteTagThrottling.actor.cpp @@ -59,7 +59,7 @@ struct WriteTagThrottlingWorkload : KVWorkload { bool fastSuccess = false; int rangeEachBadActor = 0; std::set throttledTags; - static constexpr const char* NAME = "WriteTagThrottling"; + static constexpr auto NAME = "WriteTagThrottling"; static constexpr int MIN_TAGS_PER_TRANSACTION = 1; static constexpr int MIN_TRANSACTION_TAG_LENGTH = 2; @@ -91,8 +91,6 @@ struct WriteTagThrottlingWorkload : KVWorkload { goodTag = TransactionTag(std::string("gT")); } - std::string description() const override { return WriteTagThrottlingWorkload::NAME; } - ACTOR static Future _setup(Database cx, WriteTagThrottlingWorkload* self) { ASSERT(CLIENT_KNOBS->MAX_TAGS_PER_TRANSACTION >= MIN_TAGS_PER_TRANSACTION && CLIENT_KNOBS->MAX_TRANSACTION_TAG_LENGTH >= MIN_TRANSACTION_TAG_LENGTH); @@ -324,4 +322,4 @@ struct WriteTagThrottlingWorkload : KVWorkload { } }; -WorkloadFactory WriteTagThrottlingWorkloadFactory(WriteTagThrottlingWorkload::NAME); +WorkloadFactory WriteTagThrottlingWorkloadFactory;