Force name and description of workloads to be the same

This commit is contained in:
Markus Pilman 2022-10-13 20:53:48 -06:00
parent df5825ff65
commit 49f0cf5ab0
142 changed files with 406 additions and 470 deletions

View File

@ -64,6 +64,8 @@ struct WorkloadContext {
};
struct TestWorkload : NonCopyable, WorkloadContext, ReferenceCounted<TestWorkload> {
// 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<TestWorkloa
}
virtual ~TestWorkload(){};
virtual Future<Void> 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<std::string>& out) const;
virtual Future<Void> setup(Database const& cx) { return Void(); }
@ -94,11 +98,26 @@ private:
virtual void getMetrics(std::vector<PerfMetric>& m) = 0;
};
struct NoOptions {};
template <class Workload, bool isFailureInjectionWorkload = false>
struct TestWorkloadImpl : Workload {
static_assert(std::is_convertible_v<Workload&, TestWorkload&>);
static_assert(std::is_convertible_v<decltype(Workload::NAME), std::string>,
"Workload must have a static member `name` which is convertible to string");
static_assert(std::is_same_v<decltype(&TestWorkload::description), decltype(&Workload::description)>,
"Workload must not override TestWorkload::description");
TestWorkloadImpl(WorkloadContext const& wcx) : Workload(wcx) {}
template <bool E = isFailureInjectionWorkload>
TestWorkloadImpl(WorkloadContext const& wcx, std::enable_if_t<E, NoOptions> 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<IFailureInjectorFactory>::addRef(this));
}
Reference<FailureInjectionWorkload> create(WorkloadContext const& wcx) override {
return makeReference<W>(wcx, NoOptions());
return makeReference<TestWorkloadImpl<W, true>>(wcx, NoOptions());
}
};
struct CompoundWorkload : TestWorkload {
bool runFailureWorkloads = true;
std::vector<Reference<TestWorkload>> workloads;
std::vector<Reference<FailureInjectionWorkload>> failureInjection;
@ -213,14 +231,17 @@ struct IWorkloadFactory : ReferenceCounted<IWorkloadFactory> {
virtual Reference<TestWorkload> create(WorkloadContext const& wcx) = 0;
};
template <class WorkloadType>
template <class Workload>
struct WorkloadFactory : IWorkloadFactory {
bool asClient;
WorkloadFactory(const char* name, bool asClient = false) : asClient(asClient) {
factories()[name] = Reference<IWorkloadFactory>::addRef(this);
static_assert(std::is_convertible_v<decltype(Workload::NAME), std::string>,
"Each workload must have a Workload::NAME member");
using WorkloadType = TestWorkloadImpl<Workload>;
bool runInUntrustedClient;
WorkloadFactory(bool runInUntrustedClient = false) : runInUntrustedClient(runInUntrustedClient) {
factories()[WorkloadType::NAME] = Reference<IWorkloadFactory>::addRef(this);
}
Reference<TestWorkload> create(WorkloadContext const& wcx) override {
if (g_network->isSimulated() && asClient) {
if (g_network->isSimulated() && runInUntrustedClient) {
return makeReference<ClientWorkload>(
[](WorkloadContext const& wcx) { return makeReference<WorkloadType>(wcx); }, wcx);
}
@ -228,7 +249,7 @@ struct WorkloadFactory : IWorkloadFactory {
}
};
#define REGISTER_WORKLOAD(classname) WorkloadFactory<classname> classname##WorkloadFactory(#classname)
#define REGISTER_WORKLOAD(classname) WorkloadFactory<classname> classname##WorkloadFactory
struct DistributedTestResults {
std::vector<PerfMetric> metrics;

View File

@ -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 @@ public:
}
~ApiCorrectnessWorkload() override {}
std::string description() const override { return "ApiCorrectness"; }
void getMetrics(std::vector<PerfMetric>& m) override {
m.emplace_back("Number of Random Operations Performed", numRandomOperations.getValue(), Averaged::False);
}
@ -765,4 +764,4 @@ public:
}
};
WorkloadFactory<ApiCorrectnessWorkload> ApiCorrectnessWorkloadFactory("ApiCorrectness");
WorkloadFactory<ApiCorrectnessWorkload> ApiCorrectnessWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (enabled)
return _setup(this);
@ -436,4 +435,4 @@ struct AsyncFileCorrectnessWorkload : public AsyncFileWorkload {
}
};
WorkloadFactory<AsyncFileCorrectnessWorkload> AsyncFileCorrectnessWorkloadFactory("AsyncFileCorrectness");
WorkloadFactory<AsyncFileCorrectnessWorkload> AsyncFileCorrectnessWorkloadFactory;

View File

@ -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<Reference<AsyncFileBuffer>> readBuffers;
@ -185,8 +186,6 @@ struct AsyncFileReadWorkload : public AsyncFileWorkload {
~AsyncFileReadWorkload() override {}
std::string description() const override { return "AsyncFileRead"; }
Future<Void> setup(Database const& cx) override {
if (enabled)
return _setup(this);
@ -329,4 +328,4 @@ struct AsyncFileReadWorkload : public AsyncFileWorkload {
}
};
WorkloadFactory<AsyncFileReadWorkload> AsyncFileReadWorkloadFactory("AsyncFileRead");
WorkloadFactory<AsyncFileReadWorkload> AsyncFileReadWorkloadFactory;

View File

@ -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<AsyncFileBuffer> 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<Void> setup(Database const& cx) override {
if (enabled)
return _setup(this);
@ -153,4 +152,4 @@ struct AsyncFileWriteWorkload : public AsyncFileWorkload {
}
};
WorkloadFactory<AsyncFileWriteWorkload> AsyncFileWriteWorkloadFactory("AsyncFileWrite");
WorkloadFactory<AsyncFileWriteWorkload> AsyncFileWriteWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (apiVersion500)
cx->apiVersion = ApiVersion(500);
@ -438,4 +437,4 @@ struct AtomicOpsWorkload : TestWorkload {
}
};
WorkloadFactory<AtomicOpsWorkload> AtomicOpsWorkloadFactory("AtomicOps");
WorkloadFactory<AtomicOpsWorkload> AtomicOpsWorkloadFactory;

View File

@ -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 @@ public:
AtomicOpsApiCorrectnessWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {
opType = getOption(options, "opType"_sr, -1);
}
std::string description() const override { return "AtomicOpsApiCorrectness"; }
Future<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -640,4 +639,4 @@ public:
}
};
WorkloadFactory<AtomicOpsApiCorrectnessWorkload> AtomicOpsApiCorrectnessWorkloadFactory("AtomicOpsApiCorrectness");
WorkloadFactory<AtomicOpsApiCorrectnessWorkload> AtomicOpsApiCorrectnessWorkloadFactory;

View File

@ -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<VectorRef<KeyRangeRef>> backupRanges;
@ -73,8 +74,6 @@ struct AtomicRestoreWorkload : TestWorkload {
ASSERT(removePrefix.size() == 0);
}
std::string description() const override { return "AtomicRestore"; }
Future<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -146,4 +145,4 @@ struct AtomicRestoreWorkload : TestWorkload {
}
};
WorkloadFactory<AtomicRestoreWorkload> AtomicRestoreWorkloadFactory("AtomicRestore");
WorkloadFactory<AtomicRestoreWorkload> AtomicRestoreWorkloadFactory;

View File

@ -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<VectorRef<KeyRangeRef>> 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<Void> setup(Database const& cx) override {
if (clientId != 0)
return Void();
@ -199,4 +198,4 @@ struct AtomicSwitchoverWorkload : TestWorkload {
}
};
WorkloadFactory<AtomicSwitchoverWorkload> AtomicSwitchoverWorkloadFactory("AtomicSwitchover");
WorkloadFactory<AtomicSwitchoverWorkload> AtomicSwitchoverWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override { return _start(this, cx); }
@ -92,4 +91,4 @@ struct AutomaticIdempotencyWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<AutomaticIdempotencyWorkload> AutomaticIdempotencyWorkloadFactory("AutomaticIdempotencyCorrectness");
WorkloadFactory<AutomaticIdempotencyWorkload> AutomaticIdempotencyWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override { return _start(cx, this); }
@ -218,4 +217,4 @@ struct BackgroundSelectorWorkload : TestWorkload {
}
};
WorkloadFactory<BackgroundSelectorWorkload> BackgroundSelectorWorkloadFactory("BackgroundSelector");
WorkloadFactory<BackgroundSelectorWorkload> BackgroundSelectorWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -791,5 +790,4 @@ struct BackupAndParallelRestoreCorrectnessWorkload : TestWorkload {
int BackupAndParallelRestoreCorrectnessWorkload::backupAgentRequests = 0;
WorkloadFactory<BackupAndParallelRestoreCorrectnessWorkload> BackupAndParallelRestoreCorrectnessWorkloadFactory(
"BackupAndParallelRestoreCorrectness");
WorkloadFactory<BackupAndParallelRestoreCorrectnessWorkload> BackupAndParallelRestoreCorrectnessWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (clientId != 0) {
return Void();
@ -947,5 +946,4 @@ std::string getTestEncryptionFileName() {
return "test_encryption_key_file";
}
WorkloadFactory<BackupAndRestoreCorrectnessWorkload> BackupAndRestoreCorrectnessWorkloadFactory(
"BackupAndRestoreCorrectness");
WorkloadFactory<BackupAndRestoreCorrectnessWorkload> BackupAndRestoreCorrectnessWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
ACTOR static Future<Void> _start(Database cx, BackupToBlobWorkload* self) {
@ -79,4 +77,4 @@ struct BackupToBlobWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<BackupToBlobWorkload> BackupToBlobWorkloadFactory(BackupToBlobWorkload::DESCRIPTION);
WorkloadFactory<BackupToBlobWorkload> BackupToBlobWorkloadFactory;

View File

@ -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<VectorRef<KeyRangeRef>> backupRanges;
@ -42,9 +43,7 @@ struct BackupToDBAbort : TestWorkload {
lockid = UID(0xbeeffeed, 0xdecaf00d);
}
std::string description() const override { return "BackupToDBAbort"; }
Future<Void> setup(const Database& cx) override {
if (clientId != 0)
return Void();

View File

@ -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<Void> setup(Database const& cx) override {
if (clientId != 0) {
return Void();
@ -773,4 +772,4 @@ struct BackupToDBCorrectnessWorkload : TestWorkload {
int BackupToDBCorrectnessWorkload::drAgentRequests = 0;
WorkloadFactory<BackupToDBCorrectnessWorkload> BackupToDBCorrectnessWorkloadFactory("BackupToDBCorrectness");
WorkloadFactory<BackupToDBCorrectnessWorkload> BackupToDBCorrectnessWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (clientId != 0)
return Void();
@ -539,4 +538,4 @@ struct BackupToDBUpgradeWorkload : TestWorkload {
}
};
WorkloadFactory<BackupToDBUpgradeWorkload> BackupToDBUpgradeWorkloadFactory("BackupToDBUpgrade");
WorkloadFactory<BackupToDBUpgradeWorkload> BackupToDBUpgradeWorkloadFactory;

View File

@ -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<ThreadData>, 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<Void> setup(Database const& cx) override { return _setup(cx, this); }
ACTOR Future<Void> _setup(Database cx, BlobGranuleCorrectnessWorkload* self) {
@ -1030,4 +1029,4 @@ struct BlobGranuleCorrectnessWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<BlobGranuleCorrectnessWorkload> BlobGranuleCorrectnessWorkloadFactory("BlobGranuleCorrectnessWorkload");
WorkloadFactory<BlobGranuleCorrectnessWorkload> BlobGranuleCorrectnessWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return _setup(cx, this); }
std::string newKey() {
@ -675,4 +675,4 @@ struct BlobGranuleRangesWorkload : TestWorkload {
}
};
WorkloadFactory<BlobGranuleRangesWorkload> BlobGranuleRangesWorkloadFactory("BlobGranuleRanges");
WorkloadFactory<BlobGranuleRangesWorkload> BlobGranuleRangesWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return _setup(cx, this); }
ACTOR Future<Void> _setup(Database cx, BlobGranuleVerifierWorkload* self) {
@ -1236,4 +1236,4 @@ struct BlobGranuleVerifierWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<BlobGranuleVerifierWorkload> BlobGranuleVerifierWorkloadFactory("BlobGranuleVerifier");
WorkloadFactory<BlobGranuleVerifierWorkload> BlobGranuleVerifierWorkloadFactory;

View File

@ -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<Void> 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<BulkLoadWorkload> BulkLoadWorkloadFactory("BulkLoad");
WorkloadFactory<BulkLoadWorkload> BulkLoadWorkloadFactory;

View File

@ -26,6 +26,7 @@
#include "flow/actorcompiler.h" // This must be the last #include.
struct BulkSetupWorkload : TestWorkload {
static constexpr auto NAME = "BulkSetup";
std::vector<TenantName> tenantNames;
int nodeCount;
@ -42,8 +43,6 @@ struct BulkSetupWorkload : TestWorkload {
}
}
std::string description() const override { return "BulkSetup"; }
void getMetrics(std::vector<PerfMetric>& m) override {}
Key keyForIndex(int n) { return key(n); }
@ -72,4 +71,4 @@ struct BulkSetupWorkload : TestWorkload {
Future<bool> check(Database const& cx) override { return true; }
};
WorkloadFactory<BulkSetupWorkload> BulkSetupWorkloadFactory("BulkSetup");
WorkloadFactory<BulkSetupWorkload> BulkSetupWorkloadFactory;

View File

@ -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<Void> 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<PerfMetric>& m) override {}
};
WorkloadFactory<CacheWorkload> CacheWorkloadFactory("Cache");
WorkloadFactory<CacheWorkload> CacheWorkloadFactory;

View File

@ -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<std::string>& out) const override { out.insert("all"); }
Future<Void> start(Database const& cx) override {
@ -226,4 +225,4 @@ struct ChangeConfigWorkload : TestWorkload {
}
};
WorkloadFactory<ChangeConfigWorkload> ChangeConfigWorkloadFactory("ChangeConfig");
WorkloadFactory<ChangeConfigWorkload> ChangeConfigWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return _setup(cx, this); }
ACTOR Future<Void> _setup(Database cx, ChangeFeedOperationsWorkload* self) {
@ -772,4 +772,4 @@ struct ChangeFeedOperationsWorkload : TestWorkload {
}
};
WorkloadFactory<ChangeFeedOperationsWorkload> ChangeFeedOperationsWorkloadFactory("ChangeFeedOperations");
WorkloadFactory<ChangeFeedOperationsWorkload> ChangeFeedOperationsWorkloadFactory;

View File

@ -165,6 +165,7 @@ bool compareData(Standalone<VectorRef<KeyValueRef>> source, Standalone<VectorRef
}
struct ChangeFeedsWorkload : TestWorkload {
static constexpr auto NAME = "ChangeFeeds";
double testDuration;
Future<Void> client;
@ -172,7 +173,6 @@ struct ChangeFeedsWorkload : TestWorkload {
testDuration = getOption(options, "testDuration"_sr, 10.0);
}
std::string description() const override { return "ChangeFeedsWorkload"; }
Future<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
if (clientId == 0) {
@ -235,4 +235,4 @@ struct ChangeFeedsWorkload : TestWorkload {
}
};
WorkloadFactory<ChangeFeedsWorkload> ChangeFeedsWorkloadFactory("ChangeFeeds");
WorkloadFactory<ChangeFeedsWorkload> ChangeFeedsWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override { return clientId != 0 ? Void() : fdbClientClearRange(cx, this); }
@ -64,4 +63,4 @@ struct ClearSingleRange : TestWorkload {
}
};
WorkloadFactory<ClearSingleRange> ClearSingleRangeWorkloadFactory("ClearSingleRange");
WorkloadFactory<ClearSingleRange> ClearSingleRangeWorkloadFactory;

View File

@ -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<Void> 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<PerfMetric>& m) override {}
};
WorkloadFactory<ClientTransactionProfileCorrectnessWorkload> ClientTransactionProfileCorrectnessWorkloadFactory(
"ClientTransactionProfileCorrectness");
WorkloadFactory<ClientTransactionProfileCorrectnessWorkload> ClientTransactionProfileCorrectnessWorkloadFactory;

View File

@ -29,6 +29,7 @@ class ClogSingleConnectionWorkload : public TestWorkload {
Optional<double> 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 @@ public:
}
}
std::string description() const override {
return g_network->isSimulated() ? "ClogSingleConnection" : "NoClogging";
}
Future<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -68,4 +66,4 @@ public:
}
};
WorkloadFactory<ClogSingleConnectionWorkload> ClogSingleConnectionWorkloadFactory("ClogSingleConnection");
WorkloadFactory<ClogSingleConnectionWorkload> ClogSingleConnectionWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> 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<PerfMetric>& m) override {}
};
WorkloadFactory<CommitBugWorkload> CommitBugWorkloadFactory("CommitBug");
WorkloadFactory<CommitBugWorkload> CommitBugWorkloadFactory;

View File

@ -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 @@ public:
meanSleepBetweenTransactions = getOption(options, "meanSleepBetweenTransactions"_sr, 0.1);
}
std::string description() const override { return "ConfigIncrementWorkload"; }
Future<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -161,6 +160,6 @@ public:
}
};
WorkloadFactory<ConfigIncrementWorkload> ConfigIncrementWorkloadFactory("ConfigIncrement");
WorkloadFactory<ConfigIncrementWorkload> ConfigIncrementWorkloadFactory;
KeyRef const ConfigIncrementWorkload::testKnobName = "test_int"_sr;

View File

@ -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<std::string>& out) const override {
out.insert("MachineAttritionWorkload");
}
@ -478,4 +477,4 @@ struct ConfigureDatabaseWorkload : TestWorkload {
}
};
WorkloadFactory<ConfigureDatabaseWorkload> DestroyDatabaseWorkloadFactory("ConfigureDatabase");
WorkloadFactory<ConfigureDatabaseWorkload> DestroyDatabaseWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override { return _start(cx, this); }
@ -407,4 +406,4 @@ struct ConflictRangeWorkload : TestWorkload {
}
};
WorkloadFactory<ConflictRangeWorkload> ConflictRangeWorkloadFactory("ConflictRange");
WorkloadFactory<ConflictRangeWorkload> ConflictRangeWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return _setup(cx, this); }
ACTOR Future<Void> _setup(Database cx, ConsistencyCheckWorkload* self) {
@ -1559,4 +1558,4 @@ struct ConsistencyCheckWorkload : TestWorkload {
}
};
WorkloadFactory<ConsistencyCheckWorkload> ConsistencyCheckWorkloadFactory("ConsistencyCheck");
WorkloadFactory<ConsistencyCheckWorkload> ConsistencyCheckWorkloadFactory;

View File

@ -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<std::string>());
success = true;
}
std::string description() const override { return "CpuProfiler"; }
Future<Void> setup(Database const& cx) override { return Void(); }
// Turns the profiler on or off
@ -134,4 +133,4 @@ struct CpuProfilerWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<CpuProfilerWorkload> CpuProfilerWorkloadFactory("CpuProfiler");
WorkloadFactory<CpuProfilerWorkload> CpuProfilerWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (clientId == 0) {
return _setup(this, cx);
@ -59,4 +59,4 @@ struct CreateTenantWorkload : TestWorkload {
}
};
WorkloadFactory<CreateTenantWorkload> CreateTenantWorkload("CreateTenant");
WorkloadFactory<CreateTenantWorkload> CreateTenantWorkload;

View File

@ -18,8 +18,6 @@
* limitations under the License.
*/
#include <cstring>
#include "flow/Arena.h"
#include "flow/IRandom.h"
#include "flow/Trace.h"
@ -48,6 +46,7 @@ struct CycleMembers<true> {
template <bool MultiTenancy>
struct CycleWorkload : TestWorkload, CycleMembers<MultiTenancy> {
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<MultiTenancy> {
}
}
std::string description() const override {
if constexpr (MultiTenancy) {
return "TenantCycleWorkload";
} else {
return "CycleWorkload";
}
}
Future<Void> setup(Database const& cx) override {
if constexpr (MultiTenancy) {
cx->defaultTenant = this->tenant;
@ -337,5 +328,5 @@ struct CycleWorkload : TestWorkload, CycleMembers<MultiTenancy> {
}
};
WorkloadFactory<CycleWorkload<false>> CycleWorkloadFactory("Cycle", false);
WorkloadFactory<CycleWorkload<true>> TenantCycleWorkloadFactory("TenantCycle", true);
WorkloadFactory<CycleWorkload<false>> CycleWorkloadFactory(false);
WorkloadFactory<CycleWorkload<true>> TenantCycleWorkloadFactory(true);

View File

@ -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<Void> setup(Database const& cx) override { return ddbalanceSetup(cx, this); }
Future<Void> start(Database const& cx) override { return _start(cx, this); }
@ -259,4 +258,4 @@ struct DDBalanceWorkload : TestWorkload {
}
};
WorkloadFactory<DDBalanceWorkload> DDBalanceWorkloadFactory("DDBalance");
WorkloadFactory<DDBalanceWorkload> DDBalanceWorkloadFactory;

View File

@ -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<int> getHighPriorityRelocationsInFlight(Database cx, DDMetricsWorkload* self) {
WorkerInterface masterWorker = wait(getMasterWorker(cx, self->dbInfo));
@ -74,4 +73,4 @@ struct DDMetricsWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override { m.emplace_back("DDDuration", ddDone, Averaged::False); }
};
WorkloadFactory<DDMetricsWorkload> DDMetricsWorkloadFactory("DDMetrics");
WorkloadFactory<DDMetricsWorkload> DDMetricsWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override { return _start(cx, this); }
Future<bool> check(Database const& cx) override {
@ -108,4 +108,4 @@ struct DDMetricsExcludeWorkload : TestWorkload {
}
};
WorkloadFactory<DDMetricsExcludeWorkload> DDMetricsExcludeWorkloadFactory("DDMetricsExclude");
WorkloadFactory<DDMetricsExcludeWorkload> DDMetricsExcludeWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override { return _start(cx, this); }
@ -216,4 +216,4 @@ struct DataDistributionMetricsWorkload : KVWorkload {
}
};
WorkloadFactory<DataDistributionMetricsWorkload> DataDistributionMetricsWorkloadFactory("DataDistributionMetrics");
WorkloadFactory<DataDistributionMetricsWorkload> DataDistributionMetricsWorkloadFactory;

View File

@ -42,6 +42,7 @@ std::string printValue(const ErrorOr<Optional<Value>>& 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<Void> setup(Database const& cx) override { return Void(); }
void disableFailureInjectionWorkloads(std::set<std::string>& out) const override { out.insert("MoveKeysWorkload"); }
@ -269,4 +268,4 @@ struct DataLossRecoveryWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<DataLossRecoveryWorkload> DataLossRecoveryWorkloadFactory("DataLossRecovery");
WorkloadFactory<DataLossRecoveryWorkload> DataLossRecoveryWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (clientId != 0) {
return Void();
@ -294,4 +293,4 @@ struct DifferentClustersSameRVWorkload : TestWorkload {
}
};
WorkloadFactory<DifferentClustersSameRVWorkload> DifferentClustersSameRVWorkloadFactory("DifferentClustersSameRV");
WorkloadFactory<DifferentClustersSameRVWorkload> DifferentClustersSameRVWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (enabled)
return _setup(this);
@ -184,4 +183,4 @@ struct DiskDurabilityWorkload : public AsyncFileWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<DiskDurabilityWorkload> DiskDurabilityWorkloadFactory("DiskDurability");
WorkloadFactory<DiskDurabilityWorkload> DiskDurabilityWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
if (enabled)
@ -184,4 +184,4 @@ struct DiskDurabilityTest : TestWorkload {
}
}
};
WorkloadFactory<DiskDurabilityTest> DiskDurabilityTestFactory("DiskDurabilityTest");
WorkloadFactory<DiskDurabilityTest> DiskDurabilityTestFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
// Starts the workload by -
@ -278,5 +272,5 @@ struct DiskFailureInjectionWorkload : FailureInjectionWorkload {
}
}
};
WorkloadFactory<DiskFailureInjectionWorkload> DiskFailureInjectionWorkloadFactory("DiskFailureInjection");
WorkloadFactory<DiskFailureInjectionWorkload> DiskFailureInjectionWorkloadFactory;
FailureInjectorFactory<DiskFailureInjectionWorkload> DiskFailureInjectionWorkloadFailureInjectionFactory;

View File

@ -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<Void> start(Database const& cx) override {
if ((clientId == 0) && (displayWorkers)) {
return _start(this, cx);
@ -52,4 +51,4 @@ struct DummyWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<DummyWorkload> DummyWorkloadFactory("DummyWorkload");
WorkloadFactory<DummyWorkload> DummyWorkloadFactory;

View File

@ -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<AsyncVar<struct ServerDBInfo> const> dbInfo;
Arena arena;
@ -61,8 +62,6 @@ struct EncryptKeyProxyTestWorkload : TestWorkload {
}
}
std::string description() const override { return "EncryptKeyProxyTest"; }
Future<Void> setup(Database const& ctx) override { return Void(); }
ACTOR Future<Void> simEmptyDomainIdCache(EncryptKeyProxyTestWorkload* self) {
@ -344,4 +343,4 @@ struct EncryptKeyProxyTestWorkload : TestWorkload {
std::atomic<int> EncryptKeyProxyTestWorkload::seed = 0;
WorkloadFactory<EncryptKeyProxyTestWorkload> EncryptKeyProxyTestWorkloadFactory("EncryptKeyProxyTest");
WorkloadFactory<EncryptKeyProxyTestWorkload> EncryptKeyProxyTestWorkloadFactory;

View File

@ -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<Void> setup(Database const& ctx) override { return Void(); }
std::string description() const override { return "EncryptionOps"; }
Future<Void> start(Database const& cx) override { return _start(cx, this); }
ACTOR Future<Void> _start(Database cx, EncryptionOpsWorkload* self) {
@ -506,4 +505,4 @@ struct EncryptionOpsWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override { metrics->recordMetrics(getModeStr(), numIterations); }
};
WorkloadFactory<EncryptionOpsWorkload> EncryptionOpsWorkloadFactory("EncryptionOps");
WorkloadFactory<EncryptionOpsWorkload> EncryptionOpsWorkloadFactory;

View File

@ -107,7 +107,7 @@ struct ExternalWorkload : TestWorkload, FDBWorkloadContext {
FDBWorkloadFactory* (*workloadFactory)(FDBLogger*);
std::shared_ptr<FDBWorkload> 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<Void> assertTrue(StringRef stage, Future<bool> f) {
bool res = wait(f);
if (!res) {
@ -278,4 +276,4 @@ struct ExternalWorkload : TestWorkload, FDBWorkloadContext {
};
} // namespace
WorkloadFactory<ExternalWorkload> CycleWorkloadFactory(ExternalWorkload::NAME);
WorkloadFactory<ExternalWorkload> CycleWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (clientId == 0)
return _setup(cx, this);
@ -182,4 +181,4 @@ struct FastTriggeredWatchesWorkload : TestWorkload {
}
};
WorkloadFactory<FastTriggeredWatchesWorkload> FastTriggeredWatchesWorkloadFactory("FastTriggeredWatches");
WorkloadFactory<FastTriggeredWatchesWorkload> FastTriggeredWatchesWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return nodeSetup(cx, this); }
Future<Void> start(Database const& cx) override { return _start(cx, this); }
@ -334,4 +333,4 @@ struct FileSystemWorkload : TestWorkload {
};
};
WorkloadFactory<FileSystemWorkload> FileSystemWorkloadFactory("FileSystem");
WorkloadFactory<FileSystemWorkload> FileSystemWorkloadFactory;

View File

@ -23,6 +23,7 @@
#include "fdbserver/workloads/workloads.actor.h"
struct ActorFuzzWorkload : TestWorkload {
static constexpr auto NAME = "ActorFuzz";
bool enabled;
std::pair<int, int> 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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
if (enabled) {
@ -51,4 +51,4 @@ struct ActorFuzzWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<ActorFuzzWorkload> ActorFuzzWorkloadFactory("ActorFuzz");
WorkloadFactory<ActorFuzzWorkload> ActorFuzzWorkloadFactory;

View File

@ -106,6 +106,7 @@ struct ExceptionContract {
};
struct FuzzApiCorrectnessWorkload : TestWorkload {
static constexpr auto NAME = "FuzzApiCorrectness";
static std::once_flag onceFlag;
static std::vector<std::function<
Future<Void>(unsigned int const&, FuzzApiCorrectnessWorkload* const&, Reference<ITransaction> 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<TenantGroupName> getTenantGroup(int num) {
int groupNum = num % (numTenantGroups + 1);
@ -1475,4 +1474,4 @@ std::once_flag FuzzApiCorrectnessWorkload::onceFlag;
std::vector<std::function<
Future<Void>(unsigned int const&, FuzzApiCorrectnessWorkload* const&, Reference<ITransaction> const&)>>
FuzzApiCorrectnessWorkload::testCases;
WorkloadFactory<FuzzApiCorrectnessWorkload> FuzzApiCorrectnessWorkloadFactory("FuzzApiCorrectness");
WorkloadFactory<FuzzApiCorrectnessWorkload> FuzzApiCorrectnessWorkloadFactory;

View File

@ -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<Void> 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<PerfMetric>& m) override {}
};
WorkloadFactory<GetMappedRangeWorkload> GetMappedRangeWorkloadFactory("GetMappedRange");
WorkloadFactory<GetMappedRangeWorkload> GetMappedRangeWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -125,4 +124,4 @@ struct GetRangeStream : TestWorkload {
}
};
WorkloadFactory<GetRangeStream> GetRangeStreamWorkloadFactory("GetRangeStream");
WorkloadFactory<GetRangeStream> GetRangeStreamWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return clientId ? Void() : setup(this, cx); }
Future<Void> start(Database const& cx) override { return Void(); }
Future<bool> check(Database const& cx) override { return true; }
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<GlobalTagThrottlingWorkload> GlobalTagThrottlingWorkloadFactory("GlobalTagThrottling");
WorkloadFactory<GlobalTagThrottlingWorkload> GlobalTagThrottlingWorkloadFactory;

View File

@ -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<Void> _setup(Database cx, HealthMetricsApiWorkload* self) {
if (!self->sendDetailedHealthMetrics) {
// Clear detailed health metrics that are already populated
@ -176,4 +174,4 @@ struct HealthMetricsApiWorkload : TestWorkload {
};
}
};
WorkloadFactory<HealthMetricsApiWorkload> HealthMetricsApiWorkloadFactory(HealthMetricsApiWorkload::NAME);
WorkloadFactory<HealthMetricsApiWorkload> HealthMetricsApiWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
ACTOR static Future<Void> runAllocationTransaction(Database cx, HighContentionPrefixAllocatorWorkload* self) {

View File

@ -52,7 +52,7 @@ void verifyInitDataEqual(Reference<InitialDataDistribution> real, Reference<Init
// Verify that all IDDTxnProcessor API implementations has consistent result
struct IDDTxnProcessorApiWorkload : TestWorkload {
static const char* desc;
static constexpr auto NAME = "IDDTxnProcessorApiCorrectness";
bool enabled;
double testDuration;
DDSharedContext ddContext;
@ -68,7 +68,6 @@ struct IDDTxnProcessorApiWorkload : TestWorkload {
testDuration = getOption(options, "testDuration"_sr, 10.0);
}
std::string description() const override { return desc; }
Future<Void> setup(Database const& cx) override { return enabled ? _setup(cx, this) : Void(); }
Future<Void> 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<PerfMetric>& m) override {}
};
const char* IDDTxnProcessorApiWorkload::desc = "IDDTxnProcessorApiCorrectness";
WorkloadFactory<IDDTxnProcessorApiWorkload> IDDTxnProcessorApiWorkload(IDDTxnProcessorApiWorkload::desc);
WorkloadFactory<IDDTxnProcessorApiWorkload> IDDTxnProcessorApiWorkload;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
for (int c = 0; c < actorCount; c++)
@ -176,4 +175,4 @@ struct Increment : TestWorkload {
}
};
WorkloadFactory<Increment> IncrementWorkloadFactory("Increment");
WorkloadFactory<Increment> IncrementWorkloadFactory;

View File

@ -32,7 +32,8 @@
#include "flow/actorcompiler.h" // This must be the last #include.
struct IncrementalBackupWorkload : TestWorkload {
static constexpr auto NAME = "IncrementalBackup";
Standalone<StringRef> backupDir;
Standalone<StringRef> tag;
FileBackupAgent backupAgent;
@ -56,8 +57,6 @@ struct IncrementalBackupWorkload : TestWorkload {
clearBackupAgentKeys = getOption(options, "clearBackupAgentKeys"_sr, false);
}
std::string description() const override { return "IncrementalBackup"; }
Future<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -252,4 +251,4 @@ struct IncrementalBackupWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<IncrementalBackupWorkload> IncrementalBackupWorkloadFactory("IncrementalBackup");
WorkloadFactory<IncrementalBackupWorkload> IncrementalBackupWorkloadFactory;

View File

@ -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<Void> 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<Void> 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<IndexScanWorkload> IndexScanWorkloadFactory("IndexScan");
WorkloadFactory<IndexScanWorkload> IndexScanWorkloadFactory;

View File

@ -26,6 +26,7 @@
// SOMEDAY: Make this actually run on multiple clients
struct InventoryTestWorkload : TestWorkload {
static constexpr auto NAME = "InventoryTest";
std::map<Key, int> 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<Void> start(Database const& cx) override {
if (clientId)
return Void();
@ -214,4 +213,4 @@ struct InventoryTestWorkload : TestWorkload {
}
};
WorkloadFactory<InventoryTestWorkload> InventoryTestWorkloadFactory("InventoryTest");
WorkloadFactory<InventoryTestWorkload> InventoryTestWorkloadFactory;

View File

@ -196,6 +196,7 @@ ACTOR Future<Void> testKVCommit(KVTest* test, TestHistogram<float>* latency, Per
Future<Void> 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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
if (enabled)
@ -251,7 +251,7 @@ struct KVStoreTestWorkload : TestWorkload {
}
};
WorkloadFactory<KVStoreTestWorkload> KVStoreTestWorkloadFactory("KVStoreTest");
WorkloadFactory<KVStoreTestWorkload> KVStoreTestWorkloadFactory;
ACTOR Future<Void> testKVStoreMain(KVStoreTestWorkload* workload, KVTest* ptest) {
state KVTest& test = *ptest;
@ -404,7 +404,9 @@ ACTOR Future<Void> 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;

View File

@ -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<std::string>& out) const override { out.insert("all"); }
Future<Void> 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<KillRegionWorkload> KillRegionWorkloadFactory("KillRegion");
WorkloadFactory<KillRegionWorkload> KillRegionWorkloadFactory;

View File

@ -45,6 +45,7 @@ ACTOR Future<StorageServerInterface> 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<Void> testStorage(LocalRatekeeperWorkload* self, Database cx, StorageServerInterface ssi) {
state Transaction tr(cx);
@ -148,4 +148,4 @@ struct LocalRatekeeperWorkload : TestWorkload {
} // namespace
WorkloadFactory<LocalRatekeeperWorkload> LocalRatekeeperWorkloadFactory("LocalRatekeeper");
WorkloadFactory<LocalRatekeeperWorkload> LocalRatekeeperWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -132,4 +132,4 @@ struct LockDatabaseWorkload : TestWorkload {
}
};
WorkloadFactory<LockDatabaseWorkload> LockDatabaseWorkloadFactory("LockDatabase");
WorkloadFactory<LockDatabaseWorkload> LockDatabaseWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override { return clientId == 0 ? worker(this, cx) : Void(); }
@ -72,4 +72,4 @@ struct LockDatabaseFrequentlyWorkload : TestWorkload {
}
};
WorkloadFactory<LockDatabaseFrequentlyWorkload> LockDatabaseFrequentlyWorkloadFactory("LockDatabaseFrequently");
WorkloadFactory<LockDatabaseFrequentlyWorkload> LockDatabaseFrequentlyWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
if (clientId)
@ -94,4 +95,4 @@ struct LogMetricsWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<LogMetricsWorkload> LogMetricsWorkloadFactory("LogMetrics");
WorkloadFactory<LogMetricsWorkload> LogMetricsWorkloadFactory;

View File

@ -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<Void> 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<LowLatencyWorkload> LowLatencyWorkloadFactory("LowLatency");
WorkloadFactory<LowLatencyWorkload> LowLatencyWorkloadFactory;

View File

@ -62,6 +62,7 @@ ACTOR Future<bool> 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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
if (enabled) {
@ -468,6 +468,6 @@ struct MachineAttritionWorkload : FailureInjectionWorkload {
}
};
WorkloadFactory<MachineAttritionWorkload> MachineAttritionWorkloadFactory("Attrition");
WorkloadFactory<MachineAttritionWorkload> MachineAttritionWorkloadFactory;
// TODO: Enable MachineAttritionWorkload injection once this is bug-free
// FailureInjectorFactory<MachineAttritionWorkload> MachineAttritionFailureWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (doChecksumVerificationOnly)
return Void();
@ -885,4 +881,4 @@ struct MakoWorkload : TestWorkload {
}
};
WorkloadFactory<MakoWorkload> MakoloadFactory("Mako");
WorkloadFactory<MakoWorkload> MakoloadFactory;

View File

@ -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<Future<Void>> 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<MemoryLifetime> MemoryLifetimeWorkloadFactory("MemoryLifetime");
WorkloadFactory<MemoryLifetime> MemoryLifetimeWorkloadFactory;

View File

@ -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<int>(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<std::string>& out) const override {
out.insert("MachineAttritionWorkload");
}
@ -935,4 +934,4 @@ struct MetaclusterManagementWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<MetaclusterManagementWorkload> MetaclusterManagementWorkloadFactory("MetaclusterManagement");
WorkloadFactory<MetaclusterManagementWorkload> MetaclusterManagementWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return _setup(this, cx); }
ACTOR Future<Void> _setup(MetricLoggingWorkload* self, Database cx) {
@ -99,4 +98,4 @@ struct MetricLoggingWorkload : TestWorkload {
}
};
WorkloadFactory<MetricLoggingWorkload> MetricLoggingWorkloadFactory("MetricLogging");
WorkloadFactory<MetricLoggingWorkload> MetricLoggingWorkloadFactory;

View File

@ -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<Void> 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<MiniCycleWorkload> MiniCycleWorkloadFactory("MiniCycle");
WorkloadFactory<MiniCycleWorkload> MiniCycleWorkloadFactory;

View File

@ -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<Void> start(Database const& cx) override {
if (enabled) {
return _start(cx, this);
@ -158,5 +158,4 @@ struct MutationLogReaderCorrectnessWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<MutationLogReaderCorrectnessWorkload> MutationLogReaderCorrectnessWorkloadFactory(
"MutationLogReaderCorrectness");
WorkloadFactory<MutationLogReaderCorrectnessWorkload> MutationLogReaderCorrectnessWorkloadFactory;

View File

@ -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<Void> worker;
RunRestoreWorkerWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {
TraceEvent("RunRestoreWorkerWorkloadMX").log();
}
std::string description() const override { return "RunRestoreWorkerWorkload"; }
Future<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -59,4 +58,4 @@ struct RunRestoreWorkerWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<RunRestoreWorkerWorkload> RunRestoreWorkerWorkloadFactory("RunRestoreWorkerWorkload");
WorkloadFactory<RunRestoreWorkerWorkload> RunRestoreWorkerWorkloadFactory;

View File

@ -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<VectorRef<KeyValueRef>> savedOptions;
@ -50,7 +52,6 @@ struct PerformanceWorkload : TestWorkload {
printf("saved %d options\n", savedOptions.size());
}
std::string description() const override { return "PerformanceTestWorkload"; }
Future<Void> setup(Database const& cx) override {
if (!clientId)
return _setup(cx, this);
@ -228,4 +229,4 @@ struct PerformanceWorkload : TestWorkload {
}
};
WorkloadFactory<PerformanceWorkload> PerformanceWorkloadFactory("Performance");
WorkloadFactory<PerformanceWorkload> PerformanceWorkloadFactory;

View File

@ -44,6 +44,8 @@ std::string printValue(const ErrorOr<Optional<Value>>& 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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -389,4 +389,4 @@ struct PhysicalShardMoveWorkLoad : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<PhysicalShardMoveWorkLoad> PhysicalShardMoveWorkLoadFactory("PhysicalShardMove");
WorkloadFactory<PhysicalShardMoveWorkLoad> PhysicalShardMoveWorkLoadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (pingWorkers || !registerInterface)
return Void();
@ -304,4 +304,4 @@ struct PingWorkload : TestWorkload {
}
};
WorkloadFactory<PingWorkload> PingWorkloadFactory("Ping");
WorkloadFactory<PingWorkload> PingWorkloadFactory;

View File

@ -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<Void> start(Database const& cx) override { return _start(this, cx); }
Future<bool> check(Database const& cx) override { return success; }
void getMetrics(std::vector<PerfMetric>& 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<PrivateEndpoints> PrivateEndpointsFactory(PrivateEndpoints::WorkloadName, true);
WorkloadFactory<PrivateEndpoints> PrivateEndpointsFactory(true);

View File

@ -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<Void> start(Database const& cx) override { return _start(this, cx); }
@ -50,4 +50,4 @@ struct ProtocolVersionWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<ProtocolVersionWorkload> ProtocolVersionWorkloadFactory("ProtocolVersion");
WorkloadFactory<ProtocolVersionWorkload> ProtocolVersionWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return createNodes(this, cx); }
Future<Void> start(Database const& cx) override {
Future<Void> _ = startTests(this, cx);
@ -114,4 +115,4 @@ struct PubSubMultiplesWorkload : TestWorkload {
}
};
WorkloadFactory<PubSubMultiplesWorkload> PubSubMultiplesWorkloadFactory("PubSubMultiples");
WorkloadFactory<PubSubMultiplesWorkload> PubSubMultiplesWorkloadFactory;

View File

@ -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<Void> start(Database const& cx) override { return _start(cx, this); }
Future<bool> check(Database const& cx) override { return true; }
@ -149,4 +150,4 @@ struct QueuePushWorkload : TestWorkload {
}
};
WorkloadFactory<QueuePushWorkload> QueuePushWorkloadFactory("QueuePush");
WorkloadFactory<QueuePushWorkload> QueuePushWorkloadFactory;

View File

@ -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<Future<Void>> 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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
@ -122,4 +122,4 @@ struct RYWDisableWorkload : TestWorkload {
}
};
WorkloadFactory<RYWDisableWorkload> RYWDisableWorkloadFactory("RYWDisable");
WorkloadFactory<RYWDisableWorkload> RYWDisableWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (clientId == 0)
return _setup(cx, this);
@ -312,4 +312,4 @@ struct RYWPerformanceWorkload : TestWorkload {
}
};
WorkloadFactory<RYWPerformanceWorkload> RYWPerformanceWorkloadFactory("RYWPerformance");
WorkloadFactory<RYWPerformanceWorkload> RYWPerformanceWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
if (g_network->isSimulated() && enabled) {
@ -146,5 +142,5 @@ struct RandomCloggingWorkload : FailureInjectionWorkload {
}
};
WorkloadFactory<RandomCloggingWorkload> RandomCloggingWorkloadFactory("RandomClogging");
WorkloadFactory<RandomCloggingWorkload> RandomCloggingWorkloadFactory;
FailureInjectorFactory<RandomCloggingWorkload> RandomCloggingFailureInjectionFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override { return _start(cx, this); }
@ -243,5 +244,5 @@ struct MoveKeysWorkload : FailureInjectionWorkload {
}
};
WorkloadFactory<MoveKeysWorkload> MoveKeysWorkloadFactory("RandomMoveKeys");
WorkloadFactory<MoveKeysWorkload> MoveKeysWorkloadFactory;
FailureInjectorFactory<MoveKeysWorkload> MoveKeysFailureInjectionFactory;

View File

@ -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<Void> setup(Database const& cx) override { return randomSelectorSetup(cx->clone(), this); }
Future<Void> start(Database const& cx) override {
@ -571,4 +571,4 @@ struct RandomSelectorWorkload : TestWorkload {
}
};
WorkloadFactory<RandomSelectorWorkload> RandomSelectorWorkloadFactory("RandomSelector");
WorkloadFactory<RandomSelectorWorkload> RandomSelectorWorkloadFactory;

View File

@ -48,6 +48,7 @@ ACTOR Future<double> 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<double> propagationLatency;
@ -56,8 +57,6 @@ struct ReadAfterWriteWorkload : KVWorkload {
testDuration = getOption(options, "testDuration"_sr, 10.0);
}
std::string description() const override { return "ReadAfterWriteWorkload"; }
Future<Void> setup(Database const& cx) override { return Void(); }
ACTOR static Future<Void> benchmark(Database cx, ReadAfterWriteWorkload* self) {
@ -122,4 +121,4 @@ struct ReadAfterWriteWorkload : KVWorkload {
}
};
WorkloadFactory<ReadAfterWriteWorkload> ReadAfterWriteWorkloadFactory("ReadAfterWrite");
WorkloadFactory<ReadAfterWriteWorkload> ReadAfterWriteWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return _setup(cx, this); }
Future<Void> start(Database const& cx) override {
@ -162,4 +162,4 @@ struct ReadHotDetectionWorkload : TestWorkload {
}
};
WorkloadFactory<ReadHotDetectionWorkload> ReadHotDetectionWorkloadFactory("ReadHotDetection");
WorkloadFactory<ReadHotDetectionWorkload> ReadHotDetectionWorkloadFactory;

View File

@ -363,6 +363,7 @@ static Future<Version> 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<PerfMetric>& m) override {
ReadWriteCommon::getMetrics(m);
if (!rampUpLoad) {
@ -773,4 +772,4 @@ ACTOR Future<std::vector<std::pair<uint64_t, double>>> trackInsertionCount(Datab
return countInsertionRates;
}
WorkloadFactory<ReadWriteWorkload> ReadWriteWorkloadFactory("ReadWrite");
WorkloadFactory<ReadWriteWorkload> ReadWriteWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override {
if (!enabled)
return Void();
@ -807,4 +808,4 @@ struct RemoveServersSafelyWorkload : TestWorkload {
}
};
WorkloadFactory<RemoveServersSafelyWorkload> RemoveServersSafelyWorkloadFactory("RemoveServersSafely");
WorkloadFactory<RemoveServersSafelyWorkload> RemoveServersSafelyWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(const Database& cx) override { return _start(cx->clone(), this); }
@ -297,4 +296,4 @@ struct ReportConflictingKeysWorkload : TestWorkload {
}
};
WorkloadFactory<ReportConflictingKeysWorkload> ReportConflictingKeysWorkload("ReportConflictingKeys");
WorkloadFactory<ReportConflictingKeysWorkload> ReportConflictingKeysWorkload;

View File

@ -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<IBackupContainer> 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<Void> 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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override { return clientId ? Void() : _start(this, cx); }
Future<bool> check(Database const& cx) override { return true; }
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<RestoreBackupWorkload> RestoreBackupWorkloadFactory(RestoreBackupWorkload::DESCRIPTION);
WorkloadFactory<RestoreBackupWorkload> RestoreBackupWorkloadFactory;

View File

@ -32,7 +32,7 @@ struct RestoreFromBlobWorkload : TestWorkload {
Standalone<StringRef> 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<Void> setup(Database const& cx) override { return Void(); }
ACTOR static Future<Void> _start(Database cx, RestoreFromBlobWorkload* self) {
@ -71,4 +69,4 @@ struct RestoreFromBlobWorkload : TestWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<RestoreFromBlobWorkload> RestoreFromBlobWorkloadFactory(RestoreFromBlobWorkload::DESCRIPTION);
WorkloadFactory<RestoreFromBlobWorkload> RestoreFromBlobWorkloadFactory;

View File

@ -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<Void> setup(Database const& cx) override { return Void(); }
Future<Void> start(Database const& cx) override {
if (g_simulator == g_network && enabled)
@ -131,5 +132,5 @@ struct RollbackWorkload : FailureInjectionWorkload {
}
};
WorkloadFactory<RollbackWorkload> RollbackWorkloadFactory("Rollback");
WorkloadFactory<RollbackWorkload> RollbackWorkloadFactory;
FailureInjectorFactory<RollbackWorkload> RollbackFailureInjectorFactory;

View File

@ -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<Void> performSetup(Database cx, RyowCorrectnessWorkload* self) {
std::vector<TransactionType> types;
types.push_back(READ_YOUR_WRITES);
@ -358,4 +357,4 @@ struct RyowCorrectnessWorkload : ApiWorkload {
void getMetrics(std::vector<PerfMetric>& m) override {}
};
WorkloadFactory<RyowCorrectnessWorkload> RyowCorrectnessWorkloadFactory("RyowCorrectness");
WorkloadFactory<RyowCorrectnessWorkload> RyowCorrectnessWorkloadFactory;

Some files were not shown because too many files have changed in this diff Show More