├── asan.ignorelist ├── src ├── lamplib │ ├── src │ │ ├── genny │ │ │ ├── __init__.py │ │ │ ├── tasks │ │ │ │ ├── __init__.py │ │ │ │ ├── generate_uuid_tag.py │ │ │ │ ├── create_new_actor.py │ │ │ │ ├── generate-uuid-tag.sh │ │ │ │ ├── lint_python.py │ │ │ │ └── canaries_runner.py │ │ │ └── templates │ │ │ │ └── documentation.md.j2 │ │ └── tests │ │ │ ├── genny │ │ │ └── tasks │ │ │ │ ├── __init__.py │ │ │ │ └── test_mothra_service.py │ │ │ ├── __init__.py │ │ │ └── test_run_tests.py │ ├── .gitignore │ └── requirements.txt ├── workloads │ ├── datasets │ │ ├── empty_test.txt │ │ ├── airports_codes_short.txt │ │ └── README.md │ ├── contrib │ │ ├── qe_test_gen │ │ │ ├── guid.txt │ │ │ ├── qe_test_gen │ │ │ │ ├── __init__.py │ │ │ │ ├── qe_test_gen.py │ │ │ │ └── templates │ │ │ │ │ ├── sequence_distribution.jinja2 │ │ │ │ │ ├── explicit_distribution.jinja2 │ │ │ │ │ ├── create_index_phase.jinja2 │ │ │ │ │ ├── load_phase.jinja2 │ │ │ │ │ ├── update_query_mixed_phase.jinja2 │ │ │ │ │ ├── patch_config.jinja2 │ │ │ │ │ └── update_phase.jinja2 │ │ │ ├── status.txt │ │ │ ├── pyproject.toml │ │ │ ├── states.txt │ │ │ └── README.org │ │ ├── qe_range_testing │ │ │ ├── generated │ │ │ │ └── .hold │ │ │ ├── qe_range_testing.py │ │ │ ├── workloads │ │ │ │ ├── local │ │ │ │ │ └── .hold │ │ │ │ └── evergreen │ │ │ │ │ └── .hold │ │ │ ├── .gitignore │ │ │ ├── cleanup.sh │ │ │ ├── pyproject.toml │ │ │ ├── setup-encrypted-workloads.sh │ │ │ └── templates │ │ │ │ └── rc-perfconfig.yml.j2 │ │ └── analysis │ │ │ ├── requirements.txt │ │ │ └── README.md │ ├── tpch │ │ ├── normalized │ │ │ └── 10 │ │ │ │ ├── validate.yml │ │ │ │ ├── Q1.yml │ │ │ │ ├── Q14.yml │ │ │ │ ├── Q2.yml │ │ │ │ ├── Q3.yml │ │ │ │ ├── Q4.yml │ │ │ │ ├── Q6.yml │ │ │ │ ├── Q8.yml │ │ │ │ ├── Q10.yml │ │ │ │ ├── Q12.yml │ │ │ │ ├── Q13.yml │ │ │ │ ├── Q16.yml │ │ │ │ ├── Q17.yml │ │ │ │ ├── Q21.yml │ │ │ │ ├── Q5.yml │ │ │ │ ├── Q7.yml │ │ │ │ ├── Q9.yml │ │ │ │ ├── Q11.yml │ │ │ │ ├── Q18.yml │ │ │ │ ├── Q19.yml │ │ │ │ ├── Q20.yml │ │ │ │ ├── Q22.yml │ │ │ │ └── Q15.yml │ │ └── denormalized │ │ │ └── 10 │ │ │ ├── validate.yml │ │ │ ├── Q1.yml │ │ │ ├── Q14.yml │ │ │ ├── Q2.yml │ │ │ ├── Q3.yml │ │ │ ├── Q4.yml │ │ │ ├── Q5.yml │ │ │ ├── Q6.yml │ │ │ ├── Q8.yml │ │ │ ├── Q10.yml │ │ │ ├── Q11.yml │ │ │ ├── Q12.yml │ │ │ ├── Q13.yml │ │ │ ├── Q16.yml │ │ │ ├── Q18.yml │ │ │ ├── Q21.yml │ │ │ ├── AvgAcctBal.yml │ │ │ ├── AvgItemCost.yml │ │ │ ├── BiggestOrders.yml │ │ │ ├── TotalOrderRevenue.yml │ │ │ ├── TotalLineitemRevenue.yml │ │ │ ├── Q7.yml │ │ │ ├── Q9.yml │ │ │ ├── Q17.yml │ │ │ ├── Q19.yml │ │ │ ├── Q20.yml │ │ │ ├── Q22.yml │ │ │ └── Q15.yml │ ├── sharding │ │ └── multi_updates │ │ │ ├── MultiUpdates.yml │ │ │ ├── MultiUpdates-ShardCollection.yml │ │ │ ├── MultiUpdates-PauseMigrations.yml │ │ │ └── MultiUpdates-PauseMigrations-ShardCollection.yml │ ├── execution │ │ ├── ValidateCmd.yml │ │ ├── ValidateCmdFull.yml │ │ ├── UpdateWithSecondaryIndexes.yml │ │ ├── ClusteredCollection.yml │ │ ├── ClusteredCollectionLargeRecordIds.yml │ │ ├── MixedMultiDeletesDocByDoc.yml │ │ ├── MixedMultiDeletesBatched.yml │ │ ├── MixedMultiDeletesDocByDocWithSecondaryIndexes.yml │ │ └── MixedMultiDeletesBatchedWithSecondaryIndexes.yml │ ├── scale │ │ ├── MajorityWrites10KThreads.yml │ │ ├── InsertRemove.yml │ │ ├── InsertBigDocs.yml │ │ ├── MajorityReads10KThreads.yml │ │ ├── MixedWrites.yml │ │ └── CollScan.yml │ ├── docs │ │ ├── QuiesceActor.yml │ │ ├── MonotonicSingleLoader.yml │ │ ├── HelloWorld-LoadConfig.yml │ │ ├── RunCommand-Simple.yml │ │ ├── GeneratorsSeeded.yml │ │ ├── RandomSampler.yml │ │ ├── MoveRandomChunkToRandomShard.yml │ │ ├── HotCollectionWriter.yml │ │ ├── CrudActorAggregate.yml │ │ ├── HotDocumentWriter.yml │ │ ├── InsertWithNop.yml │ │ ├── Deleter.yml │ │ ├── LoggingActorExample.yml │ │ ├── LongLivedCreator.yml │ │ ├── RunCommand.yml │ │ └── ExternalScriptActor.yml │ ├── query │ │ ├── BooleanSimplifier.yml │ │ ├── BooleanSimplifierSmallDataset.yml │ │ ├── CollScanProjectionLarge.yml │ │ ├── CollScanProjectionSmall.yml │ │ ├── CollScanProjectionMedium.yml │ │ ├── CollScanOnMixedDataTypesLarge.yml │ │ ├── CollScanOnMixedDataTypesSmall.yml │ │ ├── CollScanOnMixedDataTypesMedium.yml │ │ ├── CollScanComplexPredicateLarge.yml │ │ ├── CollScanLargeNumberOfFieldsLarge.yml │ │ ├── CollScanComplexPredicateMedium.yml │ │ ├── CollScanComplexPredicateSmall.yml │ │ ├── CollScanLargeNumberOfFieldsSmall.yml │ │ ├── CollScanLargeNumberOfFieldsMedium.yml │ │ ├── CollScanPredicateSelectivityLarge.yml │ │ ├── CollScanPredicateSelectivityMedium.yml │ │ ├── CollScanPredicateSelectivitySmall.yml │ │ ├── RepeatedPathTraversalSmall.yml │ │ ├── RepeatedPathTraversalMedium.yml │ │ ├── CollScanSimplifiablePredicateLarge.yml │ │ ├── CollScanSimplifiablePredicateMedium.yml │ │ ├── CollScanSimplifiablePredicateSmall.yml │ │ ├── RepeatedPathTraversal.yml │ │ ├── MatchFilters.yml │ │ ├── MatchFiltersSmall.yml │ │ ├── MatchFiltersMedium.yml │ │ └── CPUCycleMetricsInsert.yml │ ├── CMakeLists.txt │ ├── networking │ │ └── TransportLayerConnectTiming.yml │ ├── transactions │ │ ├── templates │ │ │ └── README.md │ │ └── LLTMixedSmall.yml │ ├── encrypted │ │ ├── YCSBLikeQueryableEncrypt1Cf16.yml │ │ ├── YCSBLikeQueryableEncrypt1Cf32.yml │ │ ├── YCSBLikeQueryableEncrypt1Cfdefault.yml │ │ └── ExponentialCompact.yml │ └── replication │ │ └── startup │ │ └── 3_0_Reads.yml ├── testlib │ ├── configs │ │ ├── GoodNoRepeat.yml │ │ ├── MissingAllFields.yml │ │ ├── MissingDefault.yml │ │ ├── MissingName.yml │ │ ├── load_config │ │ │ ├── Eq.yml │ │ │ └── Gte.yml │ │ ├── MissingSchemaVersion.yml │ │ ├── Good.yml │ │ ├── WrongSchemaVersion.yml │ │ ├── GoodWithKey.yml │ │ ├── workload.yml │ │ └── LoadConfig.yml │ ├── src │ │ └── clocks.cpp │ ├── CMakeLists.txt │ ├── include │ │ └── testlib │ │ │ └── findRepoRoot.hpp │ └── test │ │ └── helpers_test.cpp ├── third_party │ ├── loki │ │ ├── include │ │ │ └── loki │ │ │ │ └── RefToValue.h │ │ ├── README.md │ │ └── CMakeLists.txt │ ├── poplar │ │ ├── README.md │ │ ├── poplarlib │ │ │ ├── poplar.grpc.pb.cc │ │ │ └── poplar.grpc.pb.h │ │ ├── metrics.proto │ │ ├── poplar.proto │ │ ├── CMakeLists.txt │ │ └── collector.proto │ └── CMakeLists.txt ├── phases │ ├── HelloWorld │ │ └── ExamplePhase2.yml │ ├── execution │ │ └── config │ │ │ └── MultiDeletes │ │ │ ├── Default.yml │ │ │ └── WithSecondaryIndexes.yml │ ├── sharding │ │ ├── SetClusterParameterTemplate.yml │ │ └── ShardCollectionTemplate.yml │ ├── query │ │ ├── GetBsonDate.yml │ │ ├── RunLargeArithmeticOp.yml │ │ ├── TimeSeriesSortCommands.yml │ │ ├── AggregateExpressions.yml │ │ └── Views.yml │ └── CMakeLists.txt ├── resmokeconfig │ ├── genny_three_node_replset.yml │ ├── genny_create_new_actor.yml │ ├── genny_single_node_replset.yml │ └── genny_sharded.yml ├── canaries │ ├── src │ │ └── tasks.cpp │ └── CMakeLists.txt ├── cast_core │ ├── CMakeLists.txt │ ├── include │ │ └── cast_core │ │ │ ├── helpers │ │ │ └── pipeline_helpers.hpp │ │ │ └── actors │ │ │ ├── LoggingActor.hpp │ │ │ ├── ExternalScriptRunner.hpp │ │ │ ├── Insert.hpp │ │ │ └── Deleter.hpp │ └── src │ │ └── pipeline_helpers.cpp ├── gennylib │ ├── test │ │ └── version_test.cpp │ ├── src │ │ ├── Actor.cpp │ │ ├── version.cpp │ │ └── ActorProducer.cpp │ ├── include │ │ └── gennylib │ │ │ ├── version.hpp │ │ │ ├── InvalidConfigurationException.hpp │ │ │ ├── ActorVector.hpp │ │ │ └── quiesce.hpp │ └── CMakeLists.txt ├── value_generators │ └── CMakeLists.txt ├── metrics │ └── CMakeLists.txt ├── driver │ ├── CMakeLists.txt │ ├── src │ │ └── main.cpp │ └── test │ │ └── ProgramOptions_test.cpp ├── cast_python │ └── src │ │ └── example_actor.py └── CMakeLists.txt ├── lsan.ignorelist ├── .genny-root ├── pyproject.toml ├── .gitignore ├── evergreen └── system_perf │ └── README.md ├── README.md ├── cmake ├── GetGRpc.cmake ├── Options.cmake ├── GetSsl.cmake └── FindMongoCxx.cmake ├── .yamllint ├── docs ├── streams.md └── start.md └── .github └── CODEOWNERS /asan.ignorelist: -------------------------------------------------------------------------------- 1 | src:*.h* 2 | -------------------------------------------------------------------------------- /src/lamplib/src/genny/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/workloads/datasets/empty_test.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/lamplib/src/genny/tasks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lsan.ignorelist: -------------------------------------------------------------------------------- 1 | leak:asan_malloc_linux.cpp 2 | -------------------------------------------------------------------------------- /src/lamplib/src/tests/genny/tasks/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/guid.txt: -------------------------------------------------------------------------------- 1 | () 2 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_range_testing/generated/.hold: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_range_testing/qe_range_testing.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/qe_test_gen/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/workloads/datasets/airports_codes_short.txt: -------------------------------------------------------------------------------- 1 | AAC 2 | AAE -------------------------------------------------------------------------------- /src/workloads/contrib/qe_range_testing/workloads/local/.hold: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/qe_test_gen/qe_test_gen.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_range_testing/workloads/evergreen/.hold: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/testlib/configs/GoodNoRepeat.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Mode: NoException 3 | -------------------------------------------------------------------------------- /src/testlib/configs/MissingAllFields.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | A: {^Parameter: {}} 3 | -------------------------------------------------------------------------------- /src/testlib/configs/MissingDefault.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | A: {^Parameter: {Name: "A"}} 3 | -------------------------------------------------------------------------------- /src/testlib/configs/MissingName.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | A: {^Parameter: {Default: 1}} 3 | -------------------------------------------------------------------------------- /src/lamplib/src/tests/__init__.py: -------------------------------------------------------------------------------- 1 | # Run tests in this directory with `python3 -m unittest` from lamplib. 2 | -------------------------------------------------------------------------------- /src/testlib/configs/load_config/Eq.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | LargeKeys: 3 | uuid: {$eq: 1} 4 | -------------------------------------------------------------------------------- /src/testlib/configs/load_config/Gte.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | LargeKeys: 3 | uuid: {$gte: 1} 4 | -------------------------------------------------------------------------------- /src/testlib/configs/MissingSchemaVersion.yml: -------------------------------------------------------------------------------- 1 | Repeat: {^Parameter: {Name: "Repeat", Default: 1}} 2 | Mode: NoException 3 | -------------------------------------------------------------------------------- /src/testlib/configs/Good.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Repeat: {^Parameter: {Name: "Repeat", Default: 1}} 3 | Mode: NoException 4 | -------------------------------------------------------------------------------- /src/lamplib/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | venv 3 | __pycache__ 4 | *.egg-info 5 | .eggs 6 | nosetests.xml 7 | build 8 | genny_venv 9 | 10 | -------------------------------------------------------------------------------- /src/third_party/loki/include/loki/RefToValue.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb/genny/HEAD/src/third_party/loki/include/loki/RefToValue.h -------------------------------------------------------------------------------- /src/testlib/configs/WrongSchemaVersion.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Repeat: {^Parameter: {Name: "Repeat", Default: 1}} 3 | Mode: NoException 4 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_range_testing/.gitignore: -------------------------------------------------------------------------------- 1 | data/*.txt 2 | generated/*.yml 3 | queries/*.txt 4 | workloads/evergreen/*.yml 5 | workloads/local/*.yml 6 | -------------------------------------------------------------------------------- /src/testlib/configs/GoodWithKey.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | ForSelfTest: 3 | Repeat: {^Parameter: {Name: "Repeat", Default: 1}} 4 | Mode: NoException 5 | -------------------------------------------------------------------------------- /.genny-root: -------------------------------------------------------------------------------- 1 | This is a "dummy" file used by `findRepoRoot` to find the "root" of the Genny 2 | repository by successively looking up the directory tree from cwd. 3 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_range_testing/cleanup.sh: -------------------------------------------------------------------------------- 1 | rm queries/*.txt 2 | rm data/*.txt 3 | rm workloads/evergreen/*.yml 4 | rm workloads/local/*.yml 5 | rm generated/*.yml 6 | -------------------------------------------------------------------------------- /src/workloads/contrib/analysis/requirements.txt: -------------------------------------------------------------------------------- 1 | # Based on genny's lamplib internal CLI tooling. 2 | -r ../../../../src/lamplib/requirements.txt 3 | 4 | # Then add anything extra only needed for `contrib` 5 | tqdm 6 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/status.txt: -------------------------------------------------------------------------------- 1 | A1 2 | A2 3 | A3 4 | A4 5 | A5 6 | A6 7 | A7 8 | A8 9 | A9 10 | A10 11 | A11 12 | A12 13 | A13 14 | A14 15 | A15 16 | A16 17 | A17 18 | A18 19 | A19 20 | A20 21 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line-length = 100 3 | target-version = ['py37'] 4 | 5 | [tool.pytest.ini_options] 6 | minversion = "7.0" 7 | testpaths = [ 8 | "src/lamplib", 9 | "src/cast_python", 10 | ] 11 | -------------------------------------------------------------------------------- /src/third_party/poplar/README.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | protoc --cpp_out=poplarlib \ 3 | --grpc_out=poplarlib \ 4 | --plugin=protoc-gen-grpc=/data/mci/gennytoolchain/installed/x64-osx-static/tools/grpc/grpc_cpp_plugin \ 5 | ./*.proto 6 | ``` 7 | -------------------------------------------------------------------------------- /src/phases/HelloWorld/ExamplePhase2.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Product Performance 3 | Description: | 4 | Example phase to illustrate how PhaseConfig composition works. 5 | 6 | UseMe: 7 | Message: Hello Phase 2 8 | Repeat: {^Parameter: {Name: "Repeat", Default: 1}} 9 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/qe_test_gen/templates/sequence_distribution.jinja2: -------------------------------------------------------------------------------- 1 | <>: &field_<> {^Join: {array: [ "<>", {^FormatString: {"format": "%|07d|", "withArgs": [{^Inc: {start: 1, multiplier: {^Parameter: {Name: "multiplier", Default: 0}}}}]}}]}} -------------------------------------------------------------------------------- /src/phases/execution/config/MultiDeletes/Default.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | Configuration for the MultiDeletes workload. 5 | 6 | InitializeDatabaseOps: 7 | - OperationName: RunCommand 8 | ReportMetrics: false 9 | OperationCommand: {dropDatabase: 1} 10 | -------------------------------------------------------------------------------- /src/third_party/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | add_subdirectory(loki) 3 | # 4 | 5 | # 6 | # Use our FindMongoCxx module to wrap the mongo-cxx-driver in a target 7 | find_package(MongoCxx) 8 | # 9 | 10 | # 11 | include(GetGRpc) 12 | # 13 | 14 | add_subdirectory(poplar) 15 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/qe_test_gen/templates/explicit_distribution.jinja2: -------------------------------------------------------------------------------- 1 | <>: &field_<> 2 | ^TakeRandomStringFromFrequencyMapSingleton: 3 | id: field_<>_exp 4 | from: 5 | {% for key, value in ctx.map.items() %} 6 | <>: <> 7 | {% endfor %} -------------------------------------------------------------------------------- /src/testlib/configs/workload.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Actors: 3 | - Type: Fails 4 | Name: {^Parameter: {Name: "Name", Default: "Fails"}} 5 | Threads: 1 6 | Phases: 7 | - LoadConfig: 8 | Path: src/testlib/configs/Good.yml 9 | Parameters: 10 | Repeat: {^Parameter: {Name: "Repeat", Default: 2}} 11 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/qe_test_gen/templates/create_index_phase.jinja2: -------------------------------------------------------------------------------- 1 | - Repeat: 1 2 | Collection: {^Parameter: {Name: "Collection", Default: "<>"}} 3 | MetricsName: "createIndex" 4 | Operations: 5 | - OperationName: createIndex 6 | OperationCommand: 7 | Keys: 8 | <>: 1 9 | IndexOptions: {} -------------------------------------------------------------------------------- /src/third_party/loki/README.md: -------------------------------------------------------------------------------- 1 | # Loki 2 | 3 | Loki is Andrei Alexandrescu's widget library. It is partially included verbatim in Genny for its 4 | featureful ScopeGuard implementation. See http://loki-lib.sourceforge.net/ for more details. 5 | 6 | ## Where do I get the souce? 7 | 8 | This implementation of Loki was retrieved from 9 | https://sourceforge.net/projects/loki-lib/files/Loki/Loki%200.1.7/. 10 | 11 | -------------------------------------------------------------------------------- /src/lamplib/requirements.txt: -------------------------------------------------------------------------------- 1 | wheel==0.40.0 2 | pymongo==4.3.3 3 | click==8.1.2 4 | click-option-group==0.5.5 5 | colorama==0.4.3 6 | structlog==20.1.0 7 | omegaconf==2.1.1 8 | pyyaml<=5.3.1 9 | requests==2.32.2 10 | yamllint==1.35.1 11 | shrub.py==3.0.7 12 | black==22.10.0 13 | setuptools==65.7.0 14 | pytest==7.2.0 15 | progressbar==2.5 16 | 17 | numpy==1.23.5 18 | 19 | numexpr==2.8.4 20 | 21 | jinja2==3.1.5 22 | 23 | gitpython==3.1.31 24 | -------------------------------------------------------------------------------- /src/lamplib/src/genny/tasks/generate_uuid_tag.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from genny import cmd_runner 4 | 5 | 6 | def run_generate_uuid_tag(genny_repo_root: str): 7 | path = os.path.join( 8 | genny_repo_root, "src", "lamplib", "src", "genny", "tasks", "generate-uuid-tag.sh" 9 | ) 10 | cmd_runner.run_command( 11 | cmd=[path], 12 | cwd=genny_repo_root, 13 | capture=False, 14 | check=True, 15 | ) 16 | -------------------------------------------------------------------------------- /src/lamplib/src/genny/tasks/create_new_actor.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from genny import cmd_runner 4 | 5 | 6 | def run_create_new_actor(genny_repo_root: str, actor_name: str): 7 | path = os.path.join( 8 | genny_repo_root, "src", "lamplib", "src", "genny", "tasks", "create-new-actor.sh" 9 | ) 10 | cmd_runner.run_command( 11 | cmd=[path, actor_name], 12 | cwd=genny_repo_root, 13 | capture=False, 14 | check=True, 15 | ) 16 | -------------------------------------------------------------------------------- /src/testlib/configs/LoadConfig.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | 3 | Parameters: 4 | - &RandomUUIDFilename {^Parameter: {Name: "MainRandomUUIDFilename", Default: src/testlib/configs/load_config/Eq.yml }} 5 | 6 | Queries: 7 | - OperationName: findOne 8 | OperationCommand: 9 | Filter: 10 | LoadConfig: 11 | Path: *RandomUUIDFilename 12 | Key: LargeKeys 13 | Options: 14 | Comment: {^Parameter: {Name: "Comment", Default: "Random UUID" }} -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/validate.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | The test control for TPC-H expects a validate.yml file to exist in all TPC-H scales. 5 | We don't need validation on scale 10, so this is just a Nop. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | socketTimeoutMS: -1 11 | 12 | Actors: 13 | - Name: TPCHNormalizedValidate 14 | Type: RunCommand 15 | Database: tpch 16 | Phases: 17 | - Nop: true 18 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/validate.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | The test control for TPC-H expects a validate.yml file to exist in all TPC-H scales. 5 | We don't need validation on scale 10, so this is just a Nop. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | socketTimeoutMS: -1 11 | 12 | Actors: 13 | - Name: TPCHDenormalizedValidate 14 | Type: RunCommand 15 | Database: tpch 16 | Phases: 17 | - Nop: true 18 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_range_testing/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "qe-range-testing" 3 | version = "0.1.0" 4 | description = "" 5 | authors = ["Gabriel Marks "] 6 | readme = "README.md" 7 | packages = [{include = "qe_range_testing"}] 8 | 9 | [tool.poetry.dependencies] 10 | python = "^3.10" 11 | Jinja2 = "^3.1.3" 12 | 13 | [tool.poetry.group.dev.dependencies] 14 | black = "^23.1.0" 15 | 16 | [build-system] 17 | requires = ["poetry-core"] 18 | build-backend = "poetry.core.masonry.api" 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q1.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 1 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery1Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q1.yml 18 | Key: TPCHNormalizedQuery1Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q14.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 14 against the normalized schema for scale 10. 5 | Clients: 6 | Default: 7 | QueryOptions: 8 | socketTimeoutMS: -1 9 | 10 | Actors: 11 | - Name: TPCHNormalizedQuery14Explain 12 | Type: RunCommand 13 | Database: tpch 14 | Phases: 15 | - LoadConfig: 16 | Path: ../../../../phases/tpch/normalized/Q14.yml 17 | Key: TPCHNormalizedQuery14Explain 18 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q2.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 2 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery2Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q2.yml 18 | Key: TPCHNormalizedQuery2Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q3.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 3 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery3Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q3.yml 18 | Key: TPCHNormalizedQuery3Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q4.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 4 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery4Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q4.yml 18 | Key: TPCHNormalizedQuery4Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q6.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 6 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery6Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q6.yml 18 | Key: TPCHNormalizedQuery6Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q8.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 8 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery8Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q8.yml 18 | Key: TPCHNormalizedQuery8Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q10.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 10 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery10Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q10.yml 18 | Key: TPCHNormalizedQuery10Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q12.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 12 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery12Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q12.yml 18 | Key: TPCHNormalizedQuery12Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q13.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 13 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery13Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q13.yml 18 | Key: TPCHNormalizedQuery13Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q16.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 16 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery16Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q16.yml 18 | Key: TPCHNormalizedQuery16Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q17.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 17 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery17Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q17.yml 18 | Key: TPCHNormalizedQuery17Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q21.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 21 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery21Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/normalized/Q21.yml 18 | Key: TPCHNormalizedQuery21Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q1.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 1 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery1Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q1.yml 18 | Key: TPCHDenormalizedQuery1Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q14.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 14 against the denormalized schema for scale 10. 5 | Clients: 6 | Default: 7 | QueryOptions: 8 | socketTimeoutMS: -1 9 | 10 | Actors: 11 | - Name: TPCHDenormalizedQuery14Explain 12 | Type: RunCommand 13 | Database: tpch 14 | Phases: 15 | - LoadConfig: 16 | Path: ../../../../phases/tpch/denormalized/Q14.yml 17 | Key: TPCHDenormalizedQuery14Explain 18 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q2.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 2 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery2Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q2.yml 18 | Key: TPCHDenormalizedQuery2Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q3.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 3 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery3Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q3.yml 18 | Key: TPCHDenormalizedQuery3Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q4.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 4 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery4Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q4.yml 18 | Key: TPCHDenormalizedQuery4Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q5.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 5 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery5Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q5.yml 18 | Key: TPCHDenormalizedQuery5Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q6.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 6 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery6Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q6.yml 18 | Key: TPCHDenormalizedQuery6Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q8.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 8 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery8Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q8.yml 18 | Key: TPCHDenormalizedQuery8Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q10.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 10 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery10Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q10.yml 18 | Key: TPCHDenormalizedQuery10Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q11.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 11 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery11Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q11.yml 18 | Key: TPCHDenormalizedQuery11Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q12.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 12 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery12Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q12.yml 18 | Key: TPCHDenormalizedQuery12Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q13.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 13 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery13Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q13.yml 18 | Key: TPCHDenormalizedQuery13Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q16.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 16 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery16Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q16.yml 18 | Key: TPCHDenormalizedQuery16Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q18.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 18 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery18Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q18.yml 18 | Key: TPCHDenormalizedQuery18Explain 19 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q21.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 21 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery21Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - LoadConfig: 17 | Path: ../../../../phases/tpch/denormalized/Q21.yml 18 | Key: TPCHDenormalizedQuery21Explain 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.DS_Store 3 | 4 | # clion 5 | .idea 6 | cmake-build-debug 7 | 8 | # vim 9 | [._]*.s[a-v][a-z] 10 | [._]*.sw[a-p] 11 | [._]s[a-rt-v][a-z] 12 | [._]ss[a-gi-z] 13 | [._]sw[a-p] 14 | tags 15 | 16 | # generated 17 | build 18 | dist 19 | expansions.yml 20 | **.plist 21 | 22 | # python 23 | __pycache__ 24 | venv 25 | genny_venv 26 | pip-requirements.txt 27 | .eggs/ 28 | genny.egg-info 29 | 30 | # tools 31 | curator 32 | .ccls-cache 33 | .vscode 34 | # clangd 35 | .cache 36 | 37 | # Mothra repo is cloned for use in the genny repo, but we don't want to track it. 38 | mothra -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/qe_test_gen/templates/load_phase.jinja2: -------------------------------------------------------------------------------- 1 | - Repeat: <> 2 | Collection: {^Parameter: {Name: "Collection", Default: "<>"}} 3 | MetricsName: "load" 4 | Operations: 5 | - OperationName: insertOne 6 | OperationMetricsName: inserts 7 | OperationCommand: 8 | Document: 9 | LoadConfig: 10 | Path: ../contrib/qe_test_gen/maps_<>.yml 11 | Key: document_insert_<> 12 | Parameters: 13 | Database: ignored 14 | multiplier: <> -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/AvgAcctBal.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run an artifical TPC-H query to get the average customer account balance against the denormalized 5 | schema for scale 10. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | socketTimeoutMS: -1 11 | 12 | Actors: 13 | - Name: TPCHDenormalizedAvgAcctBalExplain 14 | Type: RunCommand 15 | Database: tpch 16 | Phases: 17 | - LoadConfig: 18 | Path: ../../../../phases/tpch/denormalized/AvgAcctBal.yml 19 | Key: TPCHDenormalizedAvgAcctBalExplain 20 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/AvgItemCost.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run an artifical TPC-H query to get the average cost of item sold against the denormalized schema 5 | for scale 10. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | socketTimeoutMS: -1 11 | 12 | Actors: 13 | - Name: TPCHDenormalizedAvgItemCostExplain 14 | Type: RunCommand 15 | Database: tpch 16 | Phases: 17 | - LoadConfig: 18 | Path: ../../../../phases/tpch/denormalized/AvgItemCost.yml 19 | Key: TPCHDenormalizedAvgItemCostExplain 20 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/BiggestOrders.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run an artifical TPC-H query to get the biggest EUROPE orders against the denormalized schema for 5 | scale 10. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | socketTimeoutMS: -1 11 | 12 | Actors: 13 | - Name: TPCHDenormalizedBiggestOrdersExplain 14 | Type: RunCommand 15 | Database: tpch 16 | Phases: 17 | - LoadConfig: 18 | Path: ../../../../phases/tpch/denormalized/BiggestOrders.yml 19 | Key: TPCHDenormalizedBiggestOrdersExplain 20 | -------------------------------------------------------------------------------- /src/workloads/sharding/multi_updates/MultiUpdates.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Cluster Scalability 3 | Description: See phases/sharding/multi_updates/MultiUpdatesTemplate.yml. 4 | 5 | Clients: 6 | Default: 7 | QueryOptions: 8 | maxPoolSize: 1000 9 | 10 | LoadConfig: 11 | Path: "../../../phases/sharding/multi_updates/MultiUpdatesTemplate.yml" 12 | Parameters: 13 | ShardCollectionPhases: [] 14 | PauseMigrationsPhases: [] 15 | 16 | AutoRun: 17 | - When: 18 | mongodb_setup: 19 | $eq: 20 | - shard 21 | - shard-80-feature-flags 22 | - shard-all-feature-flags 23 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/TotalOrderRevenue.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run an artifical TPC-H query to sum up total price across all orders against the denormalized 5 | schema for scale 10. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | socketTimeoutMS: -1 11 | 12 | Actors: 13 | - Name: TPCHDenormalizedTotalOrderRevenueExplain 14 | Type: RunCommand 15 | Database: tpch 16 | Phases: 17 | - LoadConfig: 18 | Path: ../../../../phases/tpch/denormalized/TotalOrderRevenue.yml 19 | Key: TPCHDenormalizedTotalOrderRevenueExplain 20 | -------------------------------------------------------------------------------- /src/workloads/sharding/multi_updates/MultiUpdates-ShardCollection.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Cluster Scalability 3 | Description: See phases/sharding/multi_updates/MultiUpdatesTemplate.yml. 4 | 5 | Clients: 6 | Default: 7 | QueryOptions: 8 | maxPoolSize: 1000 9 | 10 | LoadConfig: 11 | Path: "../../../phases/sharding/multi_updates/MultiUpdatesTemplate.yml" 12 | Parameters: 13 | ShardCollectionPhases: [1] 14 | PauseMigrationsPhases: [] 15 | 16 | AutoRun: 17 | - When: 18 | mongodb_setup: 19 | $eq: 20 | - shard 21 | - shard-80-feature-flags 22 | - shard-all-feature-flags 23 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/TotalLineitemRevenue.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run an artifical TPC-H query to sum up total price across all lineitems against the denormalized 5 | schema for scale 10. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | socketTimeoutMS: -1 11 | 12 | Actors: 13 | - Name: TPCHDenormalizedTotalLineitemRevenueExplain 14 | Type: RunCommand 15 | Database: tpch 16 | Phases: 17 | - LoadConfig: 18 | Path: ../../../../phases/tpch/denormalized/TotalLineitemRevenue.yml 19 | Key: TPCHDenormalizedTotalLineitemRevenueExplain 20 | -------------------------------------------------------------------------------- /src/resmokeconfig/genny_three_node_replset.yml: -------------------------------------------------------------------------------- 1 | test_kind: gennylib_test 2 | 3 | executor: 4 | config: 5 | program_executable: ../../src/genny/build/src/cast_core/cast_core_test 6 | verbatim_arguments: 7 | - "--reporter" 8 | - "junit" 9 | - "--durations" 10 | - "yes" 11 | - "--rng-seed" 12 | - "12345" 13 | - "--success" 14 | - "--out" 15 | - "../../build/XUnitXML/cast_core_test.junit.xml" 16 | - "[three_node_replset]" 17 | fixture: 18 | class: ReplicaSetFixture 19 | mongod_options: 20 | set_parameters: 21 | enableTestCommands: 1 22 | num_nodes: 3 23 | all_nodes_electable: true 24 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q5.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 5 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery5Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHNormalizedQuery5Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/normalized/Q5.yml 25 | # Key: TPCHNormalizedQuery5Explain 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q7.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 7 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery7Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHNormalizedQuery7Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/normalized/Q7.yml 25 | # Key: TPCHNormalizedQuery7Explain 26 | -------------------------------------------------------------------------------- /src/workloads/execution/ValidateCmd.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | This workload inserts ~1GB of documents, creates various indexes on the data, and then runs the 5 | validate command. We created this workload to see the performance benefits of improvements 6 | to the validate command, including background validation. 7 | 8 | Keywords: 9 | - RunCommand 10 | - Loader 11 | - validate 12 | 13 | LoadConfig: 14 | Path: "../../phases/execution/ValidateCmd.yml" 15 | Parameters: 16 | FullValidation: false 17 | 18 | AutoRun: 19 | - When: 20 | mongodb_setup: 21 | $eq: 22 | - standalone 23 | - replica 24 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q9.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 9 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery9Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHNormalizedQuery9Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/normalized/Q19.yml 25 | # Key: TPCHNormalizedQuery9Explain 26 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.poetry] 2 | name = "qe_test_gen" 3 | version = "0.1.0" 4 | description = "Generates QE Genny test descriptions" 5 | authors = ["Your Name "] 6 | readme = "README.md" 7 | packages = [{include = "qe_test_gen"}] 8 | 9 | [tool.poetry.dependencies] 10 | python = "^3.10" 11 | pyyaml = "^6.0" 12 | numpy = "^1.24.1" 13 | jinja2 = "^3.1.2" 14 | pandas = "^1.5.3" 15 | faker = "^16.8.1" 16 | 17 | 18 | [tool.poetry.group.dev.dependencies] 19 | black = "^23.1.0" 20 | 21 | [build-system] 22 | requires = ["poetry-core"] 23 | build-backend = "poetry.core.masonry.api" 24 | 25 | [tool.black] 26 | line-length = 120 27 | include = 'qe_test_gen\/.*\.pyi?$' -------------------------------------------------------------------------------- /src/workloads/execution/ValidateCmdFull.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | This workload inserts ~1GB of documents, creates various indexes on the data, and then runs the 5 | validate command. We created this workload to see the performance benefits of improvements 6 | to the validate command, including background validation. 7 | 8 | Keywords: 9 | - RunCommand 10 | - Loader 11 | - validate 12 | 13 | LoadConfig: 14 | Path: "../../phases/execution/ValidateCmd.yml" 15 | Parameters: 16 | FullValidation: true 17 | 18 | AutoRun: 19 | - When: 20 | mongodb_setup: 21 | $eq: 22 | - standalone 23 | - replica 24 | -------------------------------------------------------------------------------- /src/workloads/scale/MajorityWrites10KThreads.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | This workload simulates a case of extreme overload with a majority of writes happening. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | maxPoolSize: 10100 10 | 11 | LoadConfig: 12 | Path: "./Mixed10KThreads.yml" 13 | Parameters: 14 | WritingName: WritingActor_10_90 15 | ReadingName: ReadingActor_10_90 16 | WritingThreads: 9000 17 | ReadingThreads: 1000 18 | 19 | AutoRun: 20 | - When: 21 | mongodb_setup: 22 | $eq: 23 | - replica 24 | - replica-80-feature-flags 25 | - replica-all-feature-flags 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q11.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 11 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery11Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHNormalizedQuery11Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/normalized/Q11.yml 25 | # Key: TPCHNormalizedQuery11Explain 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q18.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 18 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery18Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHNormalizedQuery18Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/normalized/Q18.yml 25 | # Key: TPCHNormalizedQuery18Explain 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q19.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 19 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery19Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHNormalizedQuery19Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/normalized/Q19.yml 25 | # Key: TPCHNormalizedQuery19Explain 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q20.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 20 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery20Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHNormalizedQuery20Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/normalized/Q20.yml 25 | # Key: TPCHNormalizedQuery20Explain 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q22.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 22 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHNormalizedQuery22Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHNormalizedQuery22Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/normalized/Q22.yml 25 | # Key: TPCHNormalizedQuery22Explain 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q7.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 7 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery7Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHDenormalizedQuery7Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/denormalized/Q7.yml 25 | # Key: TPCHDenormalizedQuery7Explain 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q9.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 9 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery9Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHDenormalizedQuery9Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/denormalized/Q9.yml 25 | # Key: TPCHDenormalizedQuery9Explain 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q17.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 17 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery17Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHDenormalizedQuery17Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/denormalized/Q17.yml 25 | # Key: TPCHDenormalizedQuery17Explain 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q19.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 19 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery19Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHDenormalizedQuery19Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/denormalized/Q19.yml 25 | # Key: TPCHDenormalizedQuery19Explain 26 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q20.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 20 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery20Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # - Name: TPCHDenormalizedQuery20Explain 20 | # Type: RunCommand 21 | # Database: tpch 22 | # Phases: 23 | # - LoadConfig: 24 | # Path: ../../../../phases/tpch/denormalized/Q20.yml 25 | # Key: TPCHDenormalizedQuery20Explain 26 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_range_testing/setup-encrypted-workloads.sh: -------------------------------------------------------------------------------- 1 | cp workloads/evergreen/qe_range_rc_age_t_read100_encrypted.yml ../../encrypted/qe-range-age-100-0.yml 2 | cp workloads/evergreen/qe_range_rc_age_t_read50_encrypted.yml ../../encrypted/qe-range-age-50-50.yml 3 | cp workloads/evergreen/qe_range_rc_balance_t3_read100_encrypted.yml ../../encrypted/qe-range-balance-100-0.yml 4 | cp workloads/evergreen/qe_range_rc_balance_t3_read50_encrypted.yml ../../encrypted/qe-range-balance-50-50.yml 5 | cp workloads/evergreen/qe_range_rc_timestamp_t3_read100_encrypted.yml ../../encrypted/qe-range-timestamp-100-0.yml 6 | cp workloads/evergreen/qe_range_rc_timestamp_t3_read50_encrypted.yml ../../encrypted/qe-range-timestamp-50-50.yml 7 | -------------------------------------------------------------------------------- /src/workloads/docs/QuiesceActor.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: DevProd Performance Infrastructure 3 | Description: | 4 | This workload demonstrates the quiesce actor, used to ensure stable 5 | database state and reduce noise. 6 | 7 | # Note: This actor is effectively in beta mode. We expect it to work, but 8 | # it hasn't been used extensively in production. Please let STM know of any 9 | # use so we can help monitor its effectiveness. 10 | Actors: 11 | - Name: QuiesceActor 12 | Type: QuiesceActor 13 | # Using multiple threads will result in an error. 14 | Threads: 1 15 | Database: test 16 | Phases: 17 | - Phase: 0 18 | Repeat: 1 19 | - Phase: 1 20 | Repeat: 1 21 | -------------------------------------------------------------------------------- /src/workloads/sharding/multi_updates/MultiUpdates-PauseMigrations.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Cluster Scalability 3 | Description: See phases/sharding/multi_updates/MultiUpdatesTemplate.yml. 4 | 5 | Clients: 6 | Default: 7 | QueryOptions: 8 | maxPoolSize: 1000 9 | 10 | LoadConfig: 11 | Path: "../../../phases/sharding/multi_updates/MultiUpdatesTemplate.yml" 12 | Parameters: 13 | ShardCollectionPhases: [] 14 | PauseMigrationsPhases: [1] 15 | 16 | AutoRun: 17 | - When: 18 | mongodb_setup: 19 | $eq: 20 | # TODO SERVER-73555: Run on all variants in MultiUpdates.yml, but only in branches where the feature flag is enabled. 21 | - shard-all-feature-flags 22 | -------------------------------------------------------------------------------- /src/workloads/datasets/README.md: -------------------------------------------------------------------------------- 1 | Some Value Generators, like `ChooseFromDataset`, can read a dataset from the disk that store the values to choose from. Some example datasets are stored in [./src/workloads/datasets](../src/workloads/datasets). Four are included in the repo: 2 | 3 | - **airport_codes.txt:** includes all airport codes 4 | - **names.txt:** includes a list of the top 2000 names in USA. This is a dataset has been taken from [SecLists](https://github.com/danielmiessler/SecLists). 5 | - **familynames.txt:** includes a list of the top 1000 family names in the USA. This is a dataset has been taken from [SecLists](https://github.com/danielmiessler/SecLists). 6 | - **empty_test.txt:** this is an empty file to be used during unit testing. -------------------------------------------------------------------------------- /src/workloads/query/BooleanSimplifier.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Query Optimization 3 | 4 | Description: | 5 | This workload measures performance of boolean expressions which can be simplified by 6 | the Boolean Simplifier. It is designed to track effectiveness of the simplifier. 7 | 8 | LoadConfig: 9 | Path: ../../phases/query/BooleanSimplifier.yml 10 | Parameters: 11 | Database: BooleanSimplifier 12 | DocumentCount: 1e5 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica 19 | - replica-all-feature-flags 20 | - replica-80-feature-flags 21 | - replica-query-engine-classic 22 | branch_name: 23 | $gte: v7.3 24 | -------------------------------------------------------------------------------- /src/workloads/scale/InsertRemove.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Product Performance 3 | Description: | 4 | Demonstrate the InsertRemove actor. The InsertRemove actor is a simple actor that inserts and then 5 | removes the same document from a collection in a loop. Each instance of the actor uses a different 6 | document, indexed by an integer _id field. The actor records the latency of each insert and each 7 | remove. 8 | 9 | Keywords: 10 | - docs 11 | - actorInsertRemove 12 | - insert 13 | - delete 14 | 15 | Actors: 16 | - Name: InsertRemoveTest 17 | Type: InsertRemove 18 | Threads: 100 19 | Phases: 20 | - Collection: inserts 21 | Duration: 3 minutes 22 | Database: test 23 | -------------------------------------------------------------------------------- /src/workloads/sharding/multi_updates/MultiUpdates-PauseMigrations-ShardCollection.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Cluster Scalability 3 | Description: See phases/sharding/multi_updates/MultiUpdatesTemplate.yml. 4 | 5 | Clients: 6 | Default: 7 | QueryOptions: 8 | maxPoolSize: 1000 9 | 10 | LoadConfig: 11 | Path: "../../../phases/sharding/multi_updates/MultiUpdatesTemplate.yml" 12 | Parameters: 13 | ShardCollectionPhases: [1] 14 | PauseMigrationsPhases: [1] 15 | 16 | AutoRun: 17 | - When: 18 | mongodb_setup: 19 | $eq: 20 | # TODO SERVER-73555: Run on all variants in MultiUpdates.yml, but only in branches where the feature flag is enabled. 21 | - shard-all-feature-flags 22 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/states.txt: -------------------------------------------------------------------------------- 1 | California 2 | Texas 3 | Florida 4 | New York 5 | Pennsylvania 6 | Illinois 7 | Ohio 8 | Georgia 9 | North Carolina 10 | Michigan 11 | New Jersey 12 | Virginia 13 | Washington 14 | Arizona 15 | Tennessee 16 | Massachusetts 17 | Indiana 18 | Missouri 19 | Maryland 20 | Wisconsin 21 | Colorado 22 | Minnesota 23 | South Carolina 24 | Alabama 25 | Louisiana 26 | Kentucky 27 | Oregon 28 | Oklahoma 29 | Connecticut 30 | Utah 31 | Iowa 32 | Nevada 33 | Arkansas 34 | Mississippi 35 | Kansas 36 | New Mexico 37 | Nebraska 38 | Idaho 39 | West Virginia 40 | Hawaii 41 | New Hampshire 42 | Maine 43 | Montana 44 | Rhode Island 45 | Delaware 46 | South Dakota 47 | North Dakota 48 | Alaska 49 | Vermont 50 | Wyoming 51 | -------------------------------------------------------------------------------- /src/workloads/docs/MonotonicSingleLoader.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Cluster Scalability 3 | Description: | 4 | Loads a large set of documents with a random value assinged to `field`. 5 | 6 | Keywords: 7 | - insert 8 | 9 | Actors: 10 | - Name: LoadInitialData 11 | Type: MonotonicSingleLoader 12 | Threads: 100 13 | # The MonotonicSingleLoader must only ever be active in a single phase of the workload. 14 | Phases: 15 | - Repeat: 1 16 | Database: test 17 | # The collection name is optional and defaults to "Collection0" if omitted. 18 | Collection: mycoll 19 | BatchSize: 1000 20 | DocumentCount: 100000 21 | Document: {field: {^RandomInt: {min: 0, max: 100}}} 22 | -------------------------------------------------------------------------------- /src/workloads/query/BooleanSimplifierSmallDataset.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Query Optimization 3 | 4 | Description: | 5 | This workload measures performance of boolean expressions which can be simplified by 6 | the Boolean Simplifier. It is designed to track effectiveness of the simplifier. 7 | 8 | LoadConfig: 9 | Path: ../../phases/query/BooleanSimplifier.yml 10 | Parameters: 11 | Database: BooleanSimplifierSmall 12 | DocumentCount: 500 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica 19 | - replica-all-feature-flags 20 | - replica-80-feature-flags 21 | - replica-query-engine-classic 22 | branch_name: 23 | $gte: v7.3 24 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanProjectionLarge.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload runs collscan queries with a large projection on around 20 fields against a 5 | collection of 1M documents. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanProjection.yml 9 | Parameters: 10 | Database: CollScanProjectionLarge 11 | DocumentCount: 1e6 12 | Repeat: 10 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.0 25 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanProjectionSmall.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload runs collscan queries with a large projection on around 20 fields against a 5 | collection of 100 documents. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanProjection.yml 9 | Parameters: 10 | Database: CollScanProjectionSmall 11 | DocumentCount: 100 12 | Repeat: 100 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.0 25 | -------------------------------------------------------------------------------- /src/third_party/loki/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # For more info on interface libraries, 2 | # see https://cmake.org/cmake/help/v3.5/command/add_library.html#interface-libraries 3 | add_library(loki INTERFACE) 4 | target_include_directories(loki 5 | INTERFACE 6 | $ 7 | $ 8 | ) 9 | 10 | install(DIRECTORY include/ 11 | DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} 12 | FILES_MATCHING PATTERN *.h) 13 | 14 | install(TARGETS loki 15 | EXPORT GennyLibraryConfig 16 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 17 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 18 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) # This is for Windows 19 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanProjectionMedium.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload runs collscan queries with a large projection on around 20 fields against a 5 | collection of 10,000 documents. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanProjection.yml 9 | Parameters: 10 | Database: CollScanProjectionMedium 11 | DocumentCount: 10000 12 | Repeat: 100 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.0 25 | -------------------------------------------------------------------------------- /evergreen/system_perf/README.md: -------------------------------------------------------------------------------- 1 | # Auto-generated Genny Tasks 2 | 3 | > [!WARNING] 4 | > These tests have been migrated to 5 | > [DSI](https://github.com/10gen/dsi/tree/master/evergreen/system_perf), 6 | > where they are no longer be generated by automatic task generation. 7 | > 8 | > This folder is maintained for backwards compatibility only, and any 9 | > changes regarding which Genny tasks are run should be made in DSI. 10 | 11 | This folder contains historical task defintions and buildvariant assignments 12 | for Genny workloads with `AutoRun` sections. They are maintained for 13 | backwards compatibility only. To update Genny task configurations, please 14 | update the Genny tasks in 15 | [DSI](https://github.com/10gen/dsi/tree/master/evergreen/system_perf). 16 | -------------------------------------------------------------------------------- /src/phases/sharding/SetClusterParameterTemplate.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Cluster Scalability 3 | Description: | 4 | Template for setting a cluster parameter. 5 | 6 | SetClusterParameter: 7 | Name: SetClusterParameter 8 | Type: AdminCommand 9 | Phases: 10 | OnlyActiveInPhases: 11 | Active: {^Parameter: {Name: "Active", Default: []}} 12 | NopInPhasesUpTo: {^Parameter: {Name: "MaxPhases", Default: -1}} 13 | PhaseConfig: 14 | Repeat: 1 15 | Database: admin 16 | Operations: 17 | - OperationMetricsName: SetClusterParameter 18 | OperationName: AdminCommand 19 | OperationCommand: 20 | setClusterParameter: {^Parameter: {Name: "ClusterParameter", Default: {}}} 21 | -------------------------------------------------------------------------------- /src/workloads/docs/HelloWorld-LoadConfig.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: DevProd Performance Infrastructure 3 | Description: | 4 | This workload demonstrates the general workload substitution utility. You can use "LoadConfig" 5 | to load anything, even other workloads. 6 | 7 | LoadConfig: 8 | Path: "./HelloWorld-ActorTemplate.yml" 9 | Parameters: 10 | # The non-templatized actor in the workload above has its name overridden, 11 | # but the parameters inside the actor template are NOT overridden, because 12 | # they are not evaluated until after the "ActorFromTemplate" is evaluated. 13 | # 14 | # You can always use `genny evaluate` on a workload yaml to see what it gets 15 | # preprocessed into. 16 | Name: Helloworld-Overridden 17 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanOnMixedDataTypesLarge.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload runs collscan queries on different data type alone. The queries are run against a 5 | collection of 1M documents. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanOnMixedDataTypes.yml 9 | Parameters: 10 | Database: CollScanOnMixedDataTypesMedium 11 | DocumentCount: 1e6 12 | Repeat: 10 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.0 25 | -------------------------------------------------------------------------------- /src/phases/query/GetBsonDate.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Query Execution 3 | Description: | 4 | This file defines a parameterized configuration 'GetBsonDate' to work around the issue of 5 | ISODate. 6 | 7 | TODO PERF-3132 Use the date generator instead of this workaround. 8 | 9 | # Get a BSON-compatible date from a date in a string format 10 | # The 'date' argument must be specified up to seconds. 11 | GetBsonDate: &GetBsonDate 12 | ^RandomDate: 13 | min: 14 | ^FormatString: 15 | format: "%s.000Z" 16 | withArgs: [{^Parameter: {Name: "date", Default: "1970-01-01T00:00:00"}}] 17 | max: 18 | ^FormatString: 19 | format: "%s.001Z" 20 | withArgs: [{^Parameter: {Name: "date", Default: "1970-01-01T00:00:00"}}] 21 | -------------------------------------------------------------------------------- /src/phases/query/RunLargeArithmeticOp.yml: -------------------------------------------------------------------------------- 1 | 2 | SchemaVersion: 2018-07-01 3 | Owner: "@mongodb/query" 4 | Description: | 5 | This phase template constructs an aggregation pipeline that multiplies together 6 | the provided arguments. 7 | 8 | Multiply: 9 | Repeat: 10 10 | Database: {^Parameter: {Name: "Database", Default: "test"}} 11 | Collection: {^Parameter: {Name: "Collection", Default: "Collection0"}} 12 | Operations: 13 | - OperationMetricsName: {^Parameter: {Name: "Name", Default: "RunMultiply"}} 14 | OperationName: aggregate 15 | OperationCommand: 16 | Pipeline: [{$group: {_id: {$multiply: {^Parameter: {Name: "Expression", Default: []}}}}}] 17 | Options: 18 | BatchSize: {^Parameter: {Name: "BatchSize", Default: 3000}} 19 | -------------------------------------------------------------------------------- /src/resmokeconfig/genny_create_new_actor.yml: -------------------------------------------------------------------------------- 1 | # Test the create-new-actor script by running the generated test 2 | # against a standalone mongod. The resmoke invocation is expected 3 | # to fail. 4 | 5 | test_kind: gennylib_test 6 | 7 | executor: 8 | config: 9 | program_executable: ../../src/genny/build/src/cast_core/cast_core_test 10 | verbatim_arguments: 11 | - "--reporter" 12 | - "junit" 13 | - "--durations" 14 | - "yes" 15 | - "--rng-seed" 16 | - "12345" 17 | - "--success" 18 | - "--out" 19 | - "../../build/XUnitXML/create_new_actor_test.junit.xml" 20 | - "[SelfTestActor]" 21 | fixture: 22 | class: MongoDFixture 23 | mongod_options: 24 | set_parameters: 25 | enableTestCommands: 1 26 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanOnMixedDataTypesSmall.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload runs collscan queries on different data type alone. The queries are run against a 5 | collection of 100 documents. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanOnMixedDataTypes.yml 9 | Parameters: 10 | Database: CollScanOnMixedDataTypesSmall 11 | DocumentCount: 100 12 | Repeat: 100 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.0 25 | -------------------------------------------------------------------------------- /src/lamplib/src/genny/tasks/generate-uuid-tag.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019-present MongoDB Inc. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | UUID=$(uuidgen | sed s/-/_/g | tr a-z A-Z) 18 | echo "HEADER_${UUID}_INCLUDED" 19 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanOnMixedDataTypesMedium.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload runs collscan queries on different data type alone. The queries are run against a 5 | collection of 10,000 documents. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanOnMixedDataTypes.yml 9 | Parameters: 10 | Database: CollScanOnMixedDataTypesMedium 11 | DocumentCount: 10000 12 | Repeat: 100 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.0 25 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanComplexPredicateLarge.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of collection scan queries with complex predicates of 5 | various shapes against a collection of 1M items. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanComplexPredicate.yml 9 | Parameters: 10 | Database: CollScanComplexPredicateLarge 11 | DocumentCount: 1e6 12 | Repeat: 10 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanLargeNumberOfFieldsLarge.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of collection scan queries against a collection of 1M 5 | documents with a large number of fields. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanLargeNumberOfFields.yml 9 | Parameters: 10 | Database: CollScanLargeNumberOfFieldsLarge 11 | DocumentCount: 1e6 12 | Repeat: 10 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/phases/query/TimeSeriesSortCommands.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | These are the phases used to measure performance of the bounded sorter for timeseries collections. 5 | 6 | SortCmdTemplate: 7 | aggregate: {^Parameter: {Name: "coll", Default: Collection0}} 8 | pipeline: [{$sort: {t: 1}}, {$_internalInhibitOptimization: {}}, {$skip: 1e10}] 9 | cursor: {batchSize: {^Parameter: {Name: "batchSize", Default: 30000}}} 10 | allowDiskUse: true 11 | 12 | SortFirstResultCmdTemplate: 13 | aggregate: {^Parameter: {Name: "coll", Default: Collection0}} 14 | pipeline: [{$sort: {t: 1}}, {$_internalInhibitOptimization: {}}, {$limit: 1}] 15 | cursor: {batchSize: {^Parameter: {Name: "batchSize", Default: 30000}}} 16 | allowDiskUse: true 17 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanComplexPredicateMedium.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of collection scan queries with complex predicates of 5 | various shapes against a collection of 10K items. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanComplexPredicate.yml 9 | Parameters: 10 | Database: CollScanComplexPredicateMedium 11 | DocumentCount: 1e4 12 | Repeat: 100 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanComplexPredicateSmall.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of collection scan queries with complex predicates of 5 | various shapes against a collection of 100 items. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanComplexPredicate.yml 9 | Parameters: 10 | Database: CollScanComplexPredicateSmall 11 | DocumentCount: 100 12 | Repeat: 100 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanLargeNumberOfFieldsSmall.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of collection scan queries against a collection of 100 5 | documents with a large number of fields. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanLargeNumberOfFields.yml 9 | Parameters: 10 | Database: CollScanLargeNumberOfFieldsSmall 11 | DocumentCount: 100 12 | Repeat: 10000 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanLargeNumberOfFieldsMedium.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of collection scan queries against a collection of 10K 5 | documents with a large number of fields. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanLargeNumberOfFields.yml 9 | Parameters: 10 | Database: CollScanLargeNumberOfFieldsMedium 11 | DocumentCount: 10000 12 | Repeat: 100 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/phases/sharding/ShardCollectionTemplate.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Cluster Scalability 3 | Description: | 4 | Template for sharding a collection. 5 | 6 | ShardCollection: 7 | Name: ShardCollection 8 | Type: AdminCommand 9 | Phases: 10 | OnlyActiveInPhases: 11 | Active: {^Parameter: {Name: "Active", Default: []}} 12 | NopInPhasesUpTo: {^Parameter: {Name: "MaxPhases", Default: -1}} 13 | PhaseConfig: 14 | Repeat: 1 15 | Database: admin 16 | Operations: 17 | - OperationMetricsName: ShardCollection 18 | OperationName: AdminCommand 19 | OperationCommand: 20 | shardCollection: {^Parameter: {Name: "Namespace", Default: ""}} 21 | key: {^Parameter: {Name: "ShardKey", Default: {}}} 22 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanPredicateSelectivityLarge.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of conjunctive collection scan queries where the order of 5 | predicates matters due to selectivity of the predicates. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanPredicateSelectivity.yml 9 | Parameters: 10 | Database: CollScanPredicateSelectivityLarge 11 | DocumentCount: 1e6 12 | Repeat: 10 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanPredicateSelectivityMedium.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of conjunctive collection scan queries where the order of 5 | predicates matters due to selectivity of the predicates. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanPredicateSelectivity.yml 9 | Parameters: 10 | Database: CollScanPredicateSelectivityMedium 11 | DocumentCount: 1e4 12 | Repeat: 1000 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanPredicateSelectivitySmall.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of conjunctive collection scan queries where the order of 5 | predicates matters due to selectivity of the predicates. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanPredicateSelectivity.yml 9 | Parameters: 10 | Database: CollScanPredicateSelectivitySmall 11 | DocumentCount: 100 12 | Repeat: 20000 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/workloads/query/RepeatedPathTraversalSmall.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload stresses the query execution engine by running queries over a set of paths which 5 | share a common prefix. Crucially, these queries never match a document in the collection. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/RepeatedPathTraversal.yml 9 | Parameters: 10 | Database: RepeatedPathTraversalSmall 11 | DocumentCount: 100 12 | Repeat: 10000 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v5.0 25 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q22.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 22 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | - Name: TPCHDenormalizedQuery22Explain 13 | Type: RunCommand 14 | Database: tpch 15 | Phases: 16 | - Nop: true 17 | 18 | # TODO: PERF-2995 uncomment 19 | # Error message: document constructed by $facet is 104857668 bytes, which exceeds the limit of 104857600 bytes 20 | # - Name: TPCHDenormalizedQuery22Explain 21 | # Type: RunCommand 22 | # Database: tpch 23 | # Phases: 24 | # - LoadConfig: 25 | # Path: ../../../../phases/tpch/normalized/Q22.yml 26 | # Key: TPCHDenormalizedQuery22Explain 27 | -------------------------------------------------------------------------------- /src/testlib/src/clocks.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | namespace genny::testing { 18 | 19 | RegistryClockSourceStub::time_point RegistryClockSourceStub::_now; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/workloads/query/RepeatedPathTraversalMedium.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload stresses the query execution engine by running queries over a set of paths which 5 | share a common prefix. Crucially, these queries never match a document in the collection. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/RepeatedPathTraversal.yml 9 | Parameters: 10 | Database: RepeatedPathTraversalMedium 11 | DocumentCount: 10000 12 | Repeat: 1000 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v5.0 25 | -------------------------------------------------------------------------------- /src/resmokeconfig/genny_single_node_replset.yml: -------------------------------------------------------------------------------- 1 | test_kind: gennylib_test 2 | 3 | ## 4 | # When debugging resmoke test failures, comment out the --reporter and --out params 5 | # to see the raw stdout output which has helpful error messaging from catch2. 6 | ## 7 | 8 | executor: 9 | config: 10 | program_executable: ../../src/genny/build/src/cast_core/cast_core_test 11 | verbatim_arguments: 12 | - "--reporter" 13 | - "junit" 14 | - "--durations" 15 | - "yes" 16 | - "--rng-seed" 17 | - "12345" 18 | - "--success" 19 | - "--out" 20 | - "../../build/XUnitXML/cast_core_test.junit.xml" 21 | - "[single_node_replset]" 22 | fixture: 23 | class: ReplicaSetFixture 24 | mongod_options: 25 | set_parameters: 26 | enableTestCommands: 1 27 | num_nodes: 1 28 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanSimplifiablePredicateLarge.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of collection scan queries with complex predicates 5 | that can be simplified by the optimizer against a large collection (1M documents). 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanSimplifiablePredicate.yml 9 | Parameters: 10 | Database: CollScanWithSimplifiablePredicateLarge 11 | DocumentCount: 1e6 12 | Repeat: 10 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanSimplifiablePredicateMedium.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of collection scan queries with complex predicates 5 | that can be simplified by the optimizer against a collection of 10K documents. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanSimplifiablePredicate.yml 9 | Parameters: 10 | Database: CollScanWithSimplifiablePredicateMedium 11 | DocumentCount: 1e4 12 | Repeat: 100 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/workloads/query/CollScanSimplifiablePredicateSmall.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests the performance of collection scan queries with complex predicates 5 | that can be simplified by the optimizer against a small collection (100 documents). 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/CollScanSimplifiablePredicate.yml 9 | Parameters: 10 | Database: CollScanWithSimplifiablePredicateSmall 11 | DocumentCount: 100 12 | Repeat: 100 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $gte: v7.3 25 | -------------------------------------------------------------------------------- /src/canaries/src/tasks.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace genny::canaries::ping_task { 4 | Singleton* Singleton::instance = nullptr; 5 | 6 | Singleton* Singleton::getInstance(const std::string& mongoUri) { 7 | if (instance == nullptr) { 8 | // "new" is OK because the lifetime of this singleton object 9 | // is the same as the program. 10 | instance = new Singleton(mongoUri); 11 | } 12 | return instance; 13 | } 14 | 15 | Singleton::Singleton(std::string mongoUri) 16 | : _poolManager{{}}, 17 | ns{ 18 | R"( 19 | Clients: 20 | PingTask: 21 | URI: )" + mongoUri, "" 22 | }, 23 | client{_poolManager.createClient("PingTask", 1, ns.root())}, 24 | pingCmd{make_document(kvp("ping", 1))} {}; 25 | } // namespace genny::canaries::ping_task 26 | -------------------------------------------------------------------------------- /src/phases/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Install all the phase config snippets. 16 | install(DIRECTORY . 17 | DESTINATION etc/genny/phases 18 | COMPONENT PhaseConfigs 19 | FILES_MATCHING 20 | PATTERN "*.yml" 21 | ) 22 | -------------------------------------------------------------------------------- /src/phases/execution/config/MultiDeletes/WithSecondaryIndexes.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | Configuration for MultiDeletes workload. This configuration introduces secondary indexes. 5 | 6 | InitializeDatabaseOps: 7 | - OperationName: RunCommand 8 | OperationCommand: {dropDatabase: 1} 9 | - OperationName: RunCommand 10 | OperationCommand: 11 | createIndexes: {^Parameter: {Name: "Collection", Default: Collection0}} 12 | indexes: 13 | - key: {a: 1} 14 | name: a 15 | - key: {b: 1} 16 | name: b 17 | - key: {c: 1} 18 | name: c 19 | - key: {d: 1} 20 | name: d 21 | - key: {e: 1} 22 | name: e 23 | - key: {f: 1} 24 | name: f 25 | - key: {g: 1} 26 | name: g 27 | 28 | -------------------------------------------------------------------------------- /src/cast_core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | project(cast_core VERSION 0.0.1 LANGUAGES CXX) 16 | 17 | CreateGennyTargets( 18 | NAME cast_core 19 | TYPE SHARED 20 | DEPENDS 21 | gennylib 22 | TEST_DEPENDS testlib 23 | ) 24 | -------------------------------------------------------------------------------- /src/workloads/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Install all the workload documents 16 | install(DIRECTORY . 17 | DESTINATION etc/genny/workloads 18 | COMPONENT Workloads 19 | FILES_MATCHING 20 | PATTERN "*.yml" 21 | ) 22 | -------------------------------------------------------------------------------- /src/gennylib/test/version_test.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | 20 | TEST_CASE("We have the right version") { 21 | REQUIRE(genny::getVersion() == "0.0.1"); 22 | } 23 | -------------------------------------------------------------------------------- /src/workloads/docs/RunCommand-Simple.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: DevProd Performance Infrastructure 3 | Description: | 4 | This workload demonstrates the RunCommand actor, which can be used 5 | to execute a command against the server. 6 | 7 | Actors: 8 | - Name: ServerStatusInsert 9 | Type: RunCommand 10 | Threads: 1 11 | Phases: 12 | - Repeat: 100 13 | Database: test 14 | Operations: 15 | - OperationMetricsName: ServerStatus 16 | OperationName: RunCommand 17 | OperationCommand: 18 | serverStatus: 1 19 | - OperationName: RunCommand 20 | ReportMetrics: false 21 | OperationCommand: 22 | insert: myCollection 23 | documents: [{name: {^RandomString: {length: {^RandomInt: {min: 2, max: 5}}}}, rating: 10, address: someAddress, cuisine: italian}] 24 | -------------------------------------------------------------------------------- /src/workloads/query/RepeatedPathTraversal.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload stresses the query execution engine by running queries over a set of paths which 5 | share a common prefix. Crucially, these queries never match a document in the collection. 6 | 7 | LoadConfig: 8 | Path: ../../phases/query/RepeatedPathTraversal.yml 9 | Parameters: 10 | Database: RepeatedPathTraversalLarge 11 | DocumentCount: 1e6 12 | Repeat: 50 13 | 14 | AutoRun: 15 | - When: 16 | mongodb_setup: 17 | $eq: 18 | - replica-80-feature-flags 19 | - replica-query-engine-classic 20 | - replica-query-engine-sbe 21 | - replica 22 | - replica-all-feature-flags 23 | branch_name: 24 | $neq: 25 | - v4.0 26 | - v4.2 27 | - v4.4 28 | - v5.0 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | Genny 4 | ===== 5 | 6 | > [!WARNING] 7 | > Adding new workloads in Genny is deprecated. If you would like 8 | > to create or modify a workload, please consider using 9 | > [locust](https://docs.devprod.prod.corp.mongodb.com/weta/getting_started). 10 | > 11 | > If you need to modify or create a Genny workload, please reach out 12 | > in the [#ask-devprod-performance](https://mongodb.enterprise.slack.com/archives/C01VD0LQZED) 13 | > Slack channel for advice 14 | 15 | Genny is a workload-generator with first-class support for 16 | time-series data-collection of operations running against MongoDB. 17 | 18 | `./run-genny --help` 19 | 20 | For details on using Genny or contributing to the project, please see the [docs](./docs/start.md)! 21 | -------------------------------------------------------------------------------- /src/resmokeconfig/genny_sharded.yml: -------------------------------------------------------------------------------- 1 | test_kind: gennylib_test 2 | 3 | executor: 4 | config: 5 | program_executable: ../../src/genny/build/src/cast_core/cast_core_test 6 | verbatim_arguments: 7 | - "--reporter" 8 | - "junit" 9 | - "--durations" 10 | - "yes" 11 | - "--rng-seed" 12 | - "12345" 13 | - "--success" 14 | - "--out" 15 | - "../../build/XUnitXML/cast_core_test.junit.xml" 16 | - "[sharded]" 17 | fixture: 18 | class: ShardedClusterFixture 19 | mongos_options: 20 | set_parameters: 21 | enableTestCommands: 1 22 | mongod_options: 23 | set_parameters: 24 | enableTestCommands: 1 25 | num_rs_nodes_per_shard: 3 26 | num_shards: 3 27 | num_mongos: 3 28 | configsvr_options: 29 | num_nodes: 3 30 | all_nodes_electable: true 31 | shard_options: 32 | all_nodes_electable: true 33 | -------------------------------------------------------------------------------- /src/workloads/networking/TransportLayerConnectTiming.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Server Security 3 | Description: |- 4 | Invoke replSetTestEgress command on replica set members. 5 | Command synchronously establishes temporary connections between cluster nodes. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | maxPoolSize: 10 11 | socketTimeoutMS: 5000 12 | connectTimeoutMS: 5000 13 | Actors: 14 | - Name: TestEgress 15 | Type: RunCommand 16 | Threads: 1 17 | Phases: 18 | - Phase: 0 19 | Duration: 5 minutes 20 | Database: admin 21 | ThrowOnFailure: false 22 | Operation: 23 | OperationMetricsName: Connection 24 | OperationName: RunCommand 25 | OperationCommand: 26 | replSetTestEgress: 1 27 | 28 | AutoRun: 29 | - When: 30 | mongodb_setup: 31 | $eq: replica-auth-cluster-delay 32 | -------------------------------------------------------------------------------- /src/gennylib/src/Actor.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | #include 18 | 19 | #include 20 | 21 | namespace genny { 22 | Actor::Actor(ActorContext& context) 23 | : _id{context.nextActorId()}, _actorInfo{context.actorInfo(_id)} {} 24 | } // namespace genny 25 | -------------------------------------------------------------------------------- /src/workloads/docs/GeneratorsSeeded.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: DevProd Performance Infrastructure 3 | Description: | 4 | This workload demonstrates the usage of RandomSeed. Genny uses a PRNG and defaults to the 5 | same seed (see RNG_SEED_BASE from context.cpp). As a result every execution of the same workload 6 | file will generate the same random number stream and by extension the same stream of documents. 7 | 8 | To generate a different stream of documents, set the RandomSeed attribute. This example shares 9 | the same base workload Generators.yml and varies the RandomSeed and database name. 10 | 11 | Clients: 12 | Default: 13 | QueryOptions: 14 | maxPoolSize: 10 15 | SomeOtherPool: 16 | QueryOptions: 17 | maxPoolSize: 400 18 | 19 | # Use a different seed. 20 | RandomSeed: 314159265358979323 21 | 22 | LoadConfig: 23 | Path: ./Generators.yml 24 | Parameters: 25 | DatabaseName: seededDb 26 | -------------------------------------------------------------------------------- /src/workloads/execution/UpdateWithSecondaryIndexes.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | Updates a large range of documents in the collection. 5 | Multiple secondary indexes are present. 6 | Update performed with and without a hint. 7 | 8 | Keywords: 9 | - RunCommand 10 | - Loader 11 | - LoggingActor 12 | - CrudActor 13 | - insert 14 | - update 15 | - latency 16 | - secondary indexes 17 | 18 | Clients: 19 | Default: 20 | QueryOptions: 21 | socketTimeoutMS: 3_600_000 # = 1 hour 22 | 23 | LoadConfig: 24 | Path: "../../phases/execution/UpdateWithSecondaryIndexes.yml" 25 | 26 | AutoRun: 27 | - When: 28 | mongodb_setup: 29 | $eq: 30 | - replica 31 | - replica-80-feature-flags 32 | - replica-all-feature-flags 33 | - standalone 34 | - standalone-80-feature-flags 35 | - standalone-all-feature-flags 36 | -------------------------------------------------------------------------------- /cmake/GetGRpc.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | find_package(gRPC REQUIRED) 16 | 17 | find_package(Protobuf REQUIRED) 18 | 19 | add_library(protobuf INTERFACE IMPORTED) 20 | target_link_libraries(protobuf INTERFACE 21 | protobuf::libprotobuf 22 | ) 23 | 24 | target_include_directories(protobuf INTERFACE 25 | ${PROTOBUF_INCLUDE_DIRS} 26 | ) 27 | -------------------------------------------------------------------------------- /src/workloads/scale/InsertBigDocs.yml: -------------------------------------------------------------------------------- 1 | # This workload loads 500 rows into a collection, each of which is approximately 15MB in size. 2 | 3 | SchemaVersion: 2018-07-01 4 | Owner: Replication 5 | Description: | 6 | TODO: TIG-3321 7 | 8 | Actors: 9 | 10 | - Name: Loader 11 | Type: Loader 12 | Threads: 1 13 | Phases: 14 | - Repeat: 1 15 | Database: &DB test 16 | Threads: 1 17 | CollectionCount: 1 18 | DocumentCount: 500 19 | BatchSize: 1 20 | Document: 21 | x: {^RandomInt: {min: 0, max: 2147483647}} 22 | string0: {^FastRandomString: {length: 15000000}} 23 | 24 | AutoRun: 25 | - When: 26 | mongodb_setup: 27 | $eq: 28 | - atlas 29 | - atlas-like-replica.2022-10 30 | - replica 31 | - replica-80-feature-flags 32 | - replica-all-feature-flags 33 | atlas_setup: 34 | $neq: 35 | - M30-repl 36 | -------------------------------------------------------------------------------- /src/gennylib/src/version.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | #include 18 | 19 | std::string genny::getVersion() { 20 | // NB: this version number is duplicated in 21 | // src/CMakeList.txt, src/gennylib/CMakeLists.txt and src/gennylib/src/version.cpp 22 | return "0.0.1"; 23 | } 24 | -------------------------------------------------------------------------------- /src/value_generators/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | project(value_generators VERSION 0.0.1 LANGUAGES CXX) 16 | 17 | CreateGennyTargets( 18 | NAME value_generators 19 | TYPE STATIC 20 | DEPENDS 21 | gennylib 22 | MongoCxx::bsoncxx 23 | Boost::boost 24 | Boost::log 25 | TEST_DEPENDS testlib 26 | ) 27 | -------------------------------------------------------------------------------- /src/lamplib/src/genny/tasks/lint_python.py: -------------------------------------------------------------------------------- 1 | import black 2 | import os 3 | import structlog 4 | 5 | SLOG = structlog.get_logger(__name__) 6 | 7 | 8 | def lint_python(genny_repo_root: str, fix: bool = False): 9 | path = os.path.join(genny_repo_root, "src", "lamplib") 10 | actor_path = os.path.join(genny_repo_root, "src", "cast_python") 11 | if not fix: 12 | cmd = ["--check"] 13 | else: 14 | cmd = [] 15 | cmd.append(path) 16 | cmd.append(actor_path) 17 | SLOG.debug("Running black", black_args=cmd) 18 | 19 | try: 20 | black.main(cmd) 21 | except SystemExit as e: 22 | if e.code == 0: 23 | return 24 | msg = "There were python formatting errors." 25 | if not fix: 26 | msg += " Run the command with the --fix option to fix." 27 | else: 28 | msg += " Some errors may have been fixed. Re-run to verify." 29 | SLOG.critical(msg) 30 | raise 31 | -------------------------------------------------------------------------------- /src/workloads/execution/ClusteredCollection.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | Run basic workload on a collection clustered by {_id: 1}. 5 | 6 | Keywords: 7 | - indexes 8 | - clustered 9 | 10 | GlobalDefaults: 11 | RecordIdExtraPaddingParam: &RecordIdExtraPaddingParam 0 12 | 13 | LoadConfig: 14 | Path: "../../phases/execution/ClusteredCollection.yml" 15 | Parameters: 16 | RecordIdExtraPadding: *RecordIdExtraPaddingParam 17 | 18 | AutoRun: 19 | - When: 20 | mongodb_setup: 21 | $eq: 22 | - standalone 23 | - standalone-80-feature-flags 24 | - standalone-all-feature-flags 25 | - replica 26 | - replica-80-feature-flags 27 | - replica-all-feature-flags 28 | - atlas-like-replica.2022-10 29 | - shard 30 | - shard-80-feature-flags 31 | - shard-all-feature-flags 32 | branch_name: 33 | $gte: v5.3 34 | -------------------------------------------------------------------------------- /src/canaries/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | project(canaries VERSION 0.0.1 LANGUAGES CXX) 16 | 17 | CreateGennyTargets( 18 | NAME canaries 19 | TYPE STATIC 20 | DEPENDS 21 | gennylib 22 | metrics 23 | Boost::program_options 24 | Boost::filesystem 25 | TEST_DEPENDS testlib 26 | EXECUTABLE genny-canaries 27 | ) 28 | -------------------------------------------------------------------------------- /src/metrics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | project(metrics VERSION 0.0.1 LANGUAGES CXX) 16 | 17 | CreateGennyTargets( 18 | NAME metrics 19 | TYPE INTERFACE 20 | DEPENDS 21 | yaml-cpp::yaml-cpp 22 | Boost::boost 23 | Boost::log 24 | poplarlib 25 | MongoCxx::bsoncxx 26 | TEST_DEPENDS 27 | testlib 28 | ) 29 | -------------------------------------------------------------------------------- /src/workloads/query/MatchFilters.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests a set of filters in the match language. The actors below offer basic 5 | performance coverage for said filters. 6 | 7 | Keywords: 8 | - Loader 9 | - CrudActor 10 | - QuiesceActor 11 | - insert 12 | - find 13 | 14 | LoadConfig: 15 | Path: ../../phases/query/MatchFilters.yml 16 | Parameters: 17 | Database: MatchFiltersLarge 18 | DocumentCount: 1e6 19 | 20 | AutoRun: 21 | - When: 22 | mongodb_setup: 23 | $eq: 24 | - atlas 25 | - replica 26 | - replica-all-feature-flags 27 | - replica-80-feature-flags 28 | - replica-query-engine-classic 29 | - replica-query-engine-sbe 30 | atlas_setup: 31 | $neq: 32 | - M30-repl 33 | branch_name: 34 | $neq: 35 | - v4.0 36 | - v4.2 37 | - v4.4 38 | - v5.0 39 | -------------------------------------------------------------------------------- /src/workloads/query/MatchFiltersSmall.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests a set of filters in the match language. The actors below offer basic 5 | performance coverage for said filters. 6 | 7 | Keywords: 8 | - Loader 9 | - CrudActor 10 | - QuiesceActor 11 | - insert 12 | - find 13 | 14 | LoadConfig: 15 | Path: ../../phases/query/MatchFilters.yml 16 | Parameters: 17 | Database: MatchFiltersSmall 18 | DocumentCount: 100 19 | 20 | AutoRun: 21 | - When: 22 | mongodb_setup: 23 | $eq: 24 | - atlas 25 | - replica 26 | - replica-all-feature-flags 27 | - replica-80-feature-flags 28 | - replica-query-engine-classic 29 | - replica-query-engine-sbe 30 | atlas_setup: 31 | $neq: 32 | - M30-repl 33 | branch_name: 34 | $neq: 35 | - v4.0 36 | - v4.2 37 | - v4.4 38 | - v5.0 39 | -------------------------------------------------------------------------------- /src/workloads/query/MatchFiltersMedium.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload tests a set of filters in the match language. The actors below offer basic 5 | performance coverage for said filters. 6 | 7 | Keywords: 8 | - Loader 9 | - CrudActor 10 | - QuiesceActor 11 | - insert 12 | - find 13 | 14 | LoadConfig: 15 | Path: ../../phases/query/MatchFilters.yml 16 | Parameters: 17 | Database: MatchFiltersMedium 18 | DocumentCount: 1e4 19 | 20 | AutoRun: 21 | - When: 22 | mongodb_setup: 23 | $eq: 24 | - atlas 25 | - replica 26 | - replica-all-feature-flags 27 | - replica-80-feature-flags 28 | - replica-query-engine-classic 29 | - replica-query-engine-sbe 30 | atlas_setup: 31 | $neq: 32 | - M30-repl 33 | branch_name: 34 | $neq: 35 | - v4.0 36 | - v4.2 37 | - v4.4 38 | - v5.0 39 | -------------------------------------------------------------------------------- /src/workloads/scale/MajorityReads10KThreads.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | This workload simulates a case of extreme overload with a majority of reads happening. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | maxPoolSize: 10100 10 | 11 | LoadConfig: 12 | Path: "./Mixed10KThreads.yml" 13 | Parameters: 14 | WritingName: WritingActor_90_10 15 | ReadingName: ReadingActor_90_10 16 | WritingThreads: 1000 17 | ReadingThreads: 9000 18 | 19 | 20 | # The workload pushes the system to it's limits and is expected to fail a portion of the time. 21 | # To prevent noise, disable this from AutoRun. Uncomment the lines below to run the workload. 22 | # AutoRun: 23 | # - When: 24 | # mongodb_setup: 25 | # $eq: 26 | # - replica 27 | # - replica-80-feature-flags 28 | # - replica-all-feature-flags 29 | # - replica-query-engine-classic 30 | # - replica-query-engine-sbe 31 | -------------------------------------------------------------------------------- /src/gennylib/include/gennylib/version.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef HEADER_92D78FE6_A97C_4F86_A282_3A27352A24F6_INCLUDED 16 | #define HEADER_92D78FE6_A97C_4F86_A282_3A27352A24F6_INCLUDED 17 | 18 | #include 19 | 20 | namespace genny { 21 | 22 | std::string getVersion(); 23 | 24 | } // namespace genny 25 | 26 | #endif // HEADER_92D78FE6_A97C_4F86_A282_3A27352A24F6_INCLUDED 27 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | # -*-mode: yaml-*- 2 | 3 | extends: default 4 | 5 | ignore: 6 | - evergreen 7 | 8 | rules: 9 | anchors: 10 | forbid-undeclared-aliases: true 11 | forbid-duplicated-anchors: true 12 | forbid-unused-anchors: false 13 | braces: 14 | max-spaces-inside: 1 15 | colons: 16 | max-spaces-before: 0 17 | max-spaces-after: 1 18 | line-length: 19 | max: 160 20 | indentation: 21 | spaces: 2 22 | indent-sequences: true 23 | check-multi-line-strings: false 24 | comments: 25 | level: error 26 | require-starting-space: true 27 | # Default is 2, use 1 to align with prettier-yaml 28 | min-spaces-from-content: 1 29 | comments-indentation: 30 | level: error 31 | document-start: 32 | level: error 33 | present: false 34 | new-line-at-end-of-file: enable 35 | empty-lines: disable 36 | trailing-spaces: enable 37 | octal-values: 38 | forbid-implicit-octal: true 39 | forbid-explicit-octal: true 40 | truthy: 41 | level: error 42 | -------------------------------------------------------------------------------- /src/third_party/poplar/poplarlib/poplar.grpc.pb.cc: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: poplar.proto 4 | 5 | #include "poplar.pb.h" 6 | #include "poplar.grpc.pb.h" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | namespace poplar { 23 | 24 | } // namespace poplar 25 | 26 | -------------------------------------------------------------------------------- /src/workloads/execution/ClusteredCollectionLargeRecordIds.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | Run basic workload on a collection clustered by {_id: 1} with large RecordId's (~130 bytes). 5 | 6 | Keywords: 7 | - indexes 8 | - clustered 9 | 10 | GlobalDefaults: 11 | RecordIdExtraPaddingParam: &RecordIdExtraPaddingParam 128 12 | 13 | LoadConfig: 14 | Path: "../../phases/execution/ClusteredCollection.yml" 15 | Parameters: 16 | RecordIdExtraPadding: *RecordIdExtraPaddingParam 17 | 18 | AutoRun: 19 | - When: 20 | mongodb_setup: 21 | $eq: 22 | - standalone 23 | - standalone-80-feature-flags 24 | - standalone-all-feature-flags 25 | - replica 26 | - replica-80-feature-flags 27 | - replica-all-feature-flags 28 | - atlas-like-replica.2022-10 29 | - shard 30 | - shard-80-feature-flags 31 | - shard-all-feature-flags 32 | branch_name: 33 | $gte: v5.3 34 | -------------------------------------------------------------------------------- /src/workloads/contrib/analysis/README.md: -------------------------------------------------------------------------------- 1 | # Summary 2 | This directory is meant to house analysis tools/sripts to inspect the 3 | results of your local genny runs. 4 | 5 | ## Installation 6 | It is recommended to use a virtual environment, but to run the script from the root of the genny repository to make the paths to the workload output more sane. 7 | ```sh 8 | # Setup a python venv with the right reqs. 9 | python3 -mvenv venv 10 | ./venv/bin/python3 -mpip install -r ./src/workloads/contrib/analysis/requirements.txt 11 | 12 | # Run the script. 13 | ./venv/bin/python3 ./src/workloads/contrib/analysis/test_result_summary.py 14 | ``` 15 | 16 | Once you've tested that out and got it working, I would recommend adding it to your invocation to run the test, like so: 17 | ```sh 18 | ./run-genny workload src/workloads/query/DensifyNumeric.yml && ./venv/bin/python3 src/workloads/contrib/analysis/test_result_summary.py 19 | ``` 20 | 21 | That should save you some waiting time by starting the (potentially intensive) analysis process automatically. 22 | -------------------------------------------------------------------------------- /cmake/Options.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | ## Define boolean options and cache variables 16 | 17 | set(GENNY_INSTALL_DIR 18 | "" 19 | CACHE PATH "Default install path for genny" 20 | ) 21 | 22 | set(GENNY_STATIC_BOOST_PATH 23 | "" 24 | CACHE PATH "Use a specific static boost install" 25 | ) 26 | 27 | # See http://www.pathname.com/fhs/ 28 | option(GENNY_BUILD_FLAT 29 | "Use FHS-like build directories." 30 | OFF 31 | ) 32 | -------------------------------------------------------------------------------- /docs/streams.md: -------------------------------------------------------------------------------- 1 | # Streams Workload Documentation 2 | 3 | The Streams workload consists of several Genny workloads that run in waterfall fashion. Please find more information about each workload below: 4 | 5 | - [Passthrough](./generated/workloads.md#passthrough) 6 | - [Passthrough Change Stream Source](./generated/workloads.md#passthrough_changestreamsource) 7 | - [Passthrough Mongo Sink](./generated/workloads.md#passthrough_mongosink) 8 | - [Search](./generated/workloads.md#search) 9 | - [Streams Lookup](./generated/workloads.md#streamslookup) 10 | - [Top K per View](./generated/workloads.md#topkperwindow) 11 | - [Large Window Mixed](./generated/workloads.md#largewindowmixed) 12 | - [Large Window Unique and Existing Keys](./generated/workloads.md#largewindowuniqueandexistingkeys) 13 | - [Large Tumbling Window](./generated/workloads.md#largetumblingwindow) 14 | - [Large Hopping Window](./generated/workloads.md#largehoppingwindow) 15 | - [Add Fields](./generated/workloads.md#addfields) 16 | 17 | _Note that the linked docs are auto-generated and these links may break_ -------------------------------------------------------------------------------- /src/workloads/docs/RandomSampler.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | A workload to test/document the random sampler actor which reads random records in a database. 5 | It chooses collections and then documents from that collection using id based lookup. It has a 6 | ependency on the documents in the collections having monotonically increasing _id's 7 | 8 | Clients: 9 | Default: 10 | QueryOptions: 11 | maxPoolSize: 400 12 | 13 | Actors: 14 | - Name: Loader 15 | Type: Loader 16 | Threads: 50 17 | Phases: 18 | - Repeat: 1 19 | Database: test 20 | CollectionCount: 1 21 | Threads: 1 22 | DocumentCount: 100 23 | BatchSize: 100 24 | Document: 25 | a: {^RandomString: {length: 100}} 26 | - {Nop: true} 27 | 28 | - Name: DbHotSampler 29 | Type: RandomSampler 30 | Threads: 50 31 | CollectionCount: 50 32 | DocumentCount: 100 33 | Database: hot 34 | Phases: 35 | - {Nop: true} 36 | - Duration: 30 minutes 37 | -------------------------------------------------------------------------------- /src/phases/query/AggregateExpressions.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This file defines a template to use in aggregation expression performance tests. 5 | 6 | ExpressionTemplate: 7 | Name: {^Parameter: {Name: "name", Default: ""}} 8 | Type: CrudActor 9 | Database: &db {^Parameter: {Name: "database", Default: test}} 10 | Threads: {^Parameter: {Name: "threads", Default: 1}} 11 | Phases: 12 | OnlyActiveInPhases: 13 | Active: {^Parameter: {Name: "active", Default: [0]}} 14 | NopInPhasesUpTo: {^Parameter: {Name: "nopInPhasesUpTo", Default: 99}} 15 | PhaseConfig: 16 | Repeat: {^Parameter: {Name: "repeat", Default: 10}} 17 | Database: *db 18 | Collection: &coll {^Parameter: {Name: "collection", Default: Collection0}} 19 | Operations: 20 | - OperationMetricsName: {^Parameter: {Name: "operationMetricsName", Default: OperationMetric}} 21 | OperationName: aggregate 22 | OperationCommand: 23 | Pipeline: {^Parameter: {Name: "Pipeline", Default: []}} 24 | -------------------------------------------------------------------------------- /src/workloads/docs/MoveRandomChunkToRandomShard.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Cluster Scalability 3 | Description: | 4 | Shards a test collection and does a random move chunk. 5 | 6 | Keywords: 7 | - sharding 8 | - moveChunk 9 | 10 | Actors: 11 | - Name: CreateShardedCollection 12 | Type: AdminCommand 13 | Threads: 1 14 | Phases: 15 | - Repeat: 1 16 | Database: admin 17 | Operations: 18 | - OperationMetricsName: EnableSharding 19 | OperationName: AdminCommand 20 | OperationCommand: 21 | enableSharding: test 22 | - OperationMetricsName: ShardCollection 23 | OperationName: AdminCommand 24 | OperationCommand: 25 | shardCollection: test.collection0 26 | key: {Key: 1} 27 | - {Nop: true} 28 | 29 | - Name: MoveRandomChunkToRandomShard 30 | Type: MoveRandomChunkToRandomShard 31 | Thread: 1 32 | Phases: 33 | - {Nop: true} 34 | - Phase: 1 35 | Duration: 5 seconds 36 | Namespace: test.collection0 37 | -------------------------------------------------------------------------------- /src/workloads/tpch/normalized/10/Q15.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 15 against the normalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | # This query creates a view before running any workloads, and then destroys the view afterwards. 13 | - Name: TPCHNormalizedQuery15SetupAndCleanup 14 | Type: RunCommand 15 | Database: &db tpch 16 | Phases: 17 | - LoadConfig: 18 | Path: ../../../../phases/tpch/normalized/Q15.yml 19 | Key: TPCHNormalizedQuery15CreateView 20 | - &Nop { Nop: true } 21 | - LoadConfig: 22 | Path: ../../../../phases/tpch/normalized/Q15.yml 23 | Key: TPCHNormalizedQuery15DropView 24 | 25 | - Name: TPCHNormalizedQuery15Explain 26 | Type: RunCommand 27 | Database: *db 28 | Phases: 29 | - *Nop 30 | - LoadConfig: 31 | Path: ../../../../phases/tpch/normalized/Q15.yml 32 | Key: TPCHNormalizedQuery15Explain 33 | - *Nop 34 | -------------------------------------------------------------------------------- /src/workloads/tpch/denormalized/10/Q15.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/product-query" 3 | Description: | 4 | Run TPC-H query 15 against the denormalized schema for scale 10. 5 | 6 | Clients: 7 | Default: 8 | QueryOptions: 9 | socketTimeoutMS: -1 10 | 11 | Actors: 12 | # This query creates a view before running any workloads, and then destroys the view afterwards. 13 | - Name: TPCHDenormalizedQuery15SetupAndCleanup 14 | Type: RunCommand 15 | Database: &db tpch 16 | Phases: 17 | - LoadConfig: 18 | Path: ../../../../phases/tpch/denormalized/Q15.yml 19 | Key: TPCHDenormalizedQuery15CreateView 20 | - &Nop { Nop: true } 21 | - LoadConfig: 22 | Path: ../../../../phases/tpch/denormalized/Q15.yml 23 | Key: TPCHDenormalizedQuery15DropView 24 | 25 | - Name: TPCHDenormalizedQuery15Explain 26 | Type: RunCommand 27 | Database: *db 28 | Phases: 29 | - *Nop 30 | - LoadConfig: 31 | Path: ../../../../phases/tpch/denormalized/Q15.yml 32 | Key: TPCHDenormalizedQuery15Explain 33 | - *Nop 34 | -------------------------------------------------------------------------------- /src/driver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | project(driver VERSION 0.0.1 LANGUAGES CXX) 16 | 17 | CreateGennyTargets( 18 | NAME driver 19 | TYPE STATIC 20 | DEPENDS 21 | cast_core 22 | gennylib 23 | Boost::program_options 24 | TEST_DEPENDS testlib 25 | EXECUTABLE genny_core 26 | ) 27 | 28 | # For boost::stacktrace 29 | # Reference: https://github.com/boostorg/stacktrace/issues/88 30 | if(UNIX OR APPLE OR MINGW) 31 | add_compile_definitions(_GNU_SOURCE) 32 | endif() 33 | -------------------------------------------------------------------------------- /src/gennylib/src/ActorProducer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | #include 18 | 19 | namespace genny { 20 | 21 | ActorVector ParallelizedActorProducer::produce(ActorContext& context) { 22 | ActorVector out; 23 | 24 | auto threads = context["Threads"].maybe().value_or(1); 25 | for (decltype(threads) i = 0; i < threads; ++i) { 26 | produceInto(out, context); 27 | } 28 | return out; 29 | } 30 | 31 | } // namespace genny 32 | -------------------------------------------------------------------------------- /src/lamplib/src/genny/tasks/canaries_runner.py: -------------------------------------------------------------------------------- 1 | import os 2 | import structlog 3 | from typing import List 4 | 5 | from genny.cmd_runner import run_command 6 | from genny.curator import poplar_grpc 7 | 8 | SLOG = structlog.get_logger(__name__) 9 | 10 | 11 | def main_canaries_runner( 12 | canary_args: List[str], cleanup_metrics: bool, workspace_root: str, genny_repo_root: str 13 | ): 14 | """ 15 | Intended to be the main entry point for running canaries. 16 | """ 17 | with poplar_grpc( 18 | cleanup_metrics=cleanup_metrics, 19 | workspace_root=workspace_root, 20 | genny_repo_root=genny_repo_root, 21 | ): 22 | path = os.path.join(genny_repo_root, "dist", "bin", "genny-canaries") 23 | if not os.path.exists(path): 24 | SLOG.error("genny-canaries not found. Run install first.", path=path) 25 | raise Exception(f"genny-canaries not found at {path}.") 26 | cmd = [path, *canary_args] 27 | 28 | run_command( 29 | cmd=cmd, 30 | capture=False, 31 | check=True, 32 | cwd=workspace_root, 33 | ) 34 | -------------------------------------------------------------------------------- /src/testlib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | project(testlib VERSION 0.0.1 LANGUAGES CXX) 16 | 17 | CreateGennyTargets( 18 | NAME testlib 19 | TYPE STATIC 20 | DEPENDS 21 | gennylib 22 | cast_core 23 | MongoCxx::mongocxx 24 | MongoCxx::bsoncxx 25 | Boost::boost 26 | Boost::filesystem 27 | Boost::log 28 | Boost::regex 29 | Catch2::Catch2WithMain 30 | yaml-cpp::yaml-cpp 31 | TEST_DEPENDS 32 | Catch2::Catch2WithMain 33 | ) 34 | -------------------------------------------------------------------------------- /src/third_party/poplar/metrics.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package poplar; 4 | option go_package = "internal"; 5 | 6 | import "poplar.proto"; 7 | 8 | message IntervalSummary { 9 | string collector = 1; 10 | oneof value { 11 | SummaryInteger number = 2; 12 | SummaryIntegerSlice number_values = 3; 13 | SummaryDouble point = 4; 14 | SummaryDoubleSlice point_values = 5; 15 | } 16 | } 17 | 18 | message SummaryIntegerSlice { 19 | string name = 1; 20 | repeated int64 value = 2; 21 | } 22 | 23 | message SummaryInteger { 24 | string name = 1; 25 | int64 value = 2; 26 | } 27 | 28 | message SummaryDoubleSlice { 29 | string name = 1; 30 | repeated double value = 2; 31 | } 32 | 33 | message SummaryDouble { 34 | string name = 1; 35 | double value = 2; 36 | } 37 | 38 | service PoplarMetricsCollector { 39 | rpc CreateCollector(CreateOptions) returns (PoplarResponse); 40 | rpc CloseCollector(PoplarID) returns (PoplarResponse); 41 | rpc ResetSample(PoplarID) returns (PoplarResponse); 42 | rpc FlushSample(PoplarID) returns (PoplarResponse); 43 | rpc Add(IntervalSummary) returns (PoplarResponse); 44 | } -------------------------------------------------------------------------------- /src/gennylib/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # NB: this version number is duplicated in 16 | # src/CMakeList.txt, src/gennylib/CMakeLists.txt and src/gennylib/src/version.cpp 17 | project(gennylib VERSION 0.0.1 LANGUAGES CXX) 18 | 19 | CreateGennyTargets( 20 | NAME gennylib 21 | TYPE STATIC 22 | DEPENDS 23 | yaml-cpp::yaml-cpp 24 | loki 25 | metrics 26 | value_generators 27 | Boost::boost 28 | Boost::log 29 | MongoCxx::mongocxx 30 | TEST_DEPENDS testlib 31 | ) 32 | -------------------------------------------------------------------------------- /src/workloads/query/CPUCycleMetricsInsert.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Product Performance 3 | Description: | 4 | This workload is designed to insert a document, update it and then immediately delete it 5 | (this is repeated 10k times). This is designed to help us calculate CPU cycle metrics when 6 | utilizing the Linux 3-Node ReplSet CPU Cycle Metrics 2023-06 variant for a mixed workload 7 | 8 | dbname: &dbname 10kDocs 9 | CollectionCount: &NumColls 1 10 | 11 | Document: &doc 12 | a: {^Inc: {}} 13 | b: {^RandomString: {length: 16}} 14 | 15 | Actors: 16 | - Name: InsertActor 17 | Type: CrudActor 18 | Threads: 1 19 | Database: *dbname 20 | Phases: 21 | - Repeat: 10000 22 | RecordFailure: true 23 | ThrowOnFailure: true 24 | CollectionCount: *NumColls 25 | MetricsName: "load" 26 | Operations: 27 | - OperationName: insertOne 28 | OperationMetricsName: inserts 29 | OperationCommand: 30 | Document: *doc 31 | 32 | AutoRun: 33 | - When: 34 | mongodb_setup: 35 | $eq: 36 | - replica-ipc-counters.2023-06 37 | -------------------------------------------------------------------------------- /src/workloads/execution/MixedMultiDeletesDocByDoc.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | Deletes a range of documents using the DELETE query exec stage both in isolation and while 5 | performing writes on another collection. Tests deletes on documents of size ~1KB then deletes on 6 | documents of ~10MB. 7 | 8 | Keywords: 9 | - RunCommand 10 | - Loader 11 | - LoggingActor 12 | - CrudActor 13 | - insert 14 | - delete 15 | - batch 16 | - deleteMany 17 | - latency 18 | 19 | Clients: 20 | Default: 21 | QueryOptions: 22 | # Allow for longer duration since the loading of the data may take a while. 23 | socketTimeoutMS: 3_600_000 # = 1 hour 24 | 25 | LoadConfig: 26 | Path: "../../phases/execution/MixedMultiDeletes.yml" 27 | Parameters: 28 | UseBatchedDeleteStage: 0 29 | 30 | AutoRun: 31 | - When: 32 | mongodb_setup: 33 | $eq: 34 | - replica 35 | branch_name: 36 | $neq: 37 | - v4.2 38 | - v4.4 39 | - v5.0 40 | # 6.0 Does not have the 'batchUserMultiDeletes' server parameter. 41 | - v6.0 42 | -------------------------------------------------------------------------------- /src/workloads/execution/MixedMultiDeletesBatched.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | Deletes a range of documents using the BATCHED_DELETE query exec stage both in isolation and while 5 | performing writes on another collection. Tests deletes on documents of size ~1KB then deletes on 6 | documents of ~10MB. 7 | 8 | Keywords: 9 | - RunCommand 10 | - Loader 11 | - LoggingActor 12 | - CrudActor 13 | - insert 14 | - delete 15 | - batch 16 | - deleteMany 17 | - latency 18 | 19 | Clients: 20 | Default: 21 | QueryOptions: 22 | # Allow for longer duration since the loading of the data may take a while. 23 | socketTimeoutMS: 3_600_000 # = 1 hour 24 | 25 | LoadConfig: 26 | Path: "../../phases/execution/MixedMultiDeletes.yml" 27 | Parameters: 28 | UseBatchedDeleteStage: 1 29 | 30 | AutoRun: 31 | - When: 32 | mongodb_setup: 33 | $eq: 34 | - replica 35 | branch_name: 36 | $neq: 37 | - v4.2 38 | - v4.4 39 | - v5.0 40 | # 6.0 Does not have the 'batchUserMultiDeletes' server parameter. 41 | - v6.0 42 | -------------------------------------------------------------------------------- /src/cast_python/src/example_actor.py: -------------------------------------------------------------------------------- 1 | """This is an example of how to use the python actor support. You can write a CLI using click 2 | and expect the first argument passed will be a path to the workload yaml file. For example, 3 | given the following actor config: 4 | 5 | - Name: HelloWorld 6 | Type: Python 7 | Threads: 1 8 | Phases: 9 | - Repeat: 1 10 | Module: example_actor 11 | Endpoint: hello_world 12 | 13 | 14 | genny would invoke the following command to run this actor: 15 | 16 | python -m example_actor hello_world 2>&1 17 | 18 | 19 | Note - support for python actors is very experimental. Please reach out 20 | to the perf team if you have a use-case you would like to try this support for 21 | """ 22 | import click 23 | 24 | 25 | @click.group(name="ExamplePythonActor", context_settings=dict(help_option_names=["-h", "--help"])) 26 | def cli(): 27 | pass 28 | 29 | 30 | @cli.command("hello_world", help=("Prints Hello World")) 31 | @click.argument("workload_yaml", nargs=1) 32 | def hello_world(workload_yaml: str): 33 | print(f"Hello world from {workload_yaml}") 34 | 35 | 36 | if __name__ == "__main__": 37 | cli() 38 | -------------------------------------------------------------------------------- /src/third_party/poplar/poplar.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package poplar; 4 | option go_package = "internal"; 5 | 6 | message PoplarID { 7 | string name = 1; 8 | } 9 | 10 | message CreateOptions { 11 | string name = 1; 12 | string path = 2; 13 | int32 chunkSize = 3; 14 | bool streaming = 4; 15 | bool dynamic = 5; 16 | enum RecorderType { 17 | UNKNOWN_RECORDER = 0; 18 | PERF = 1; 19 | PERF_SINGLE = 2; 20 | PERF_100MS = 3; 21 | PERF_1S = 4; 22 | HISTOGRAM_SINGLE = 6; 23 | HISTOGRAM_100MS = 7; 24 | HISTOGRAM_1S = 8; 25 | INTERVAL_SUMMARIZATION = 9; 26 | }; 27 | RecorderType recorder = 6; 28 | enum EventsCollectorType { 29 | UNKNOWN_COLLECTOR = 0; 30 | BASIC = 1; 31 | PASSTHROUGH = 2; 32 | SAMPLING_100 = 3; 33 | SAMPLING_1K = 4; 34 | SAMPLING_10K = 5; 35 | SAMPLING_100K = 6; 36 | RAND_SAMPLING_50 = 7; 37 | RAND_SAMPLING_25 = 8; 38 | RAND_SAMPLING_10 = 9; 39 | INTERVAL_100MS = 10; 40 | INTERVAL_1S = 11; 41 | } 42 | EventsCollectorType events = 7; 43 | bool buffered = 8; 44 | } 45 | 46 | message PoplarResponse { 47 | string name = 1; 48 | bool status = 2; 49 | } 50 | -------------------------------------------------------------------------------- /src/testlib/include/testlib/findRepoRoot.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef HEADER_00E808D9_C909_4A88_99A5_C0B5E8596E84_INCLUDED 16 | #define HEADER_00E808D9_C909_4A88_99A5_C0B5E8596E84_INCLUDED 17 | 18 | #include 19 | 20 | namespace genny { 21 | 22 | /** 23 | * @return the path to the Genny repository's root directory by looking 'up' the directory tree. 24 | * @throws invalid_argument if not inside the genny repository 25 | */ 26 | std::string findRepoRoot(); 27 | 28 | } // namespace genny 29 | 30 | #endif // HEADER_00E808D9_C909_4A88_99A5_C0B5E8596E84_INCLUDED 31 | -------------------------------------------------------------------------------- /src/workloads/docs/HotCollectionWriter.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | A basic workload to test/document the HotCollectionUpdater actor type, which adds documents to a 5 | designated "hot" collection. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | maxPoolSize: 400 11 | 12 | Actors: 13 | - Name: Loader 14 | Type: Loader 15 | Threads: 1 16 | Phases: 17 | - Repeat: 1 18 | Database: hot 19 | CollectionCount: 1 20 | Threads: 1 21 | DocumentCount: 1 22 | BatchSize: 1 23 | Document: 24 | first: first 25 | second: {^RandomInt: {min: 0, max: 1000}} 26 | - {Nop: true} 27 | 28 | - Name: HotCollectionUpdater 29 | Type: CrudActor 30 | Threads: 40 31 | Database: hot 32 | Phases: 33 | - {Nop: true} 34 | - Duration: 1 minute 35 | Collection: Collection0 36 | Operations: 37 | - OperationName: bulkWrite 38 | OperationCommand: 39 | WriteOperations: 40 | - WriteCommand: insertOne 41 | Document: {a: {^RandomInt: {min: 0, max: 1000}}} 42 | GlobalRate: 1000 per 1 second 43 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/qe_test_gen/templates/update_query_mixed_phase.jinja2: -------------------------------------------------------------------------------- 1 | - Repeat: <> 2 | Collection: {^Parameter: {Name: "Collection", Default: "<>"}} 3 | MetricsName: "FSM" 4 | InitialStates: 5 | - State: Query 6 | Weight: <> 7 | - State: Update 8 | Weight: <> 9 | StateTransitions: &transitions 10 | - To: Query 11 | Weight: <> 12 | SleepBefore: {^TimeSpec: {value: 0, unit: seconds}} 13 | - To: Update 14 | Weight: <> 15 | SleepBefore: {^TimeSpec: {value: 0, unit: seconds}} 16 | States: 17 | - Name: Query 18 | Operations: 19 | - OperationName: find 20 | OperationMetricsName: query 21 | OperationCommand: 22 | Filter: {<>: <>} 23 | Transitions: *transitions 24 | - Name: Update 25 | Operations: 26 | - OperationName: updateOne 27 | OperationMetricsName: update 28 | OperationCommand: 29 | Filter: {<>: <>} 30 | Update: {$set: {<>: <>}} 31 | Transitions: *transitions -------------------------------------------------------------------------------- /src/gennylib/include/gennylib/InvalidConfigurationException.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef HEADER_E4B4F388_CF15_44CC_8782_EA61F79FC2A0_INCLUDED 16 | #define HEADER_E4B4F388_CF15_44CC_8782_EA61F79FC2A0_INCLUDED 17 | 18 | #include 19 | #include 20 | 21 | namespace genny { 22 | 23 | /** 24 | * Throw this to indicate bad configuration. 25 | */ 26 | class InvalidConfigurationException : public std::invalid_argument { 27 | public: 28 | using std::invalid_argument::invalid_argument; 29 | }; 30 | 31 | } // namespace genny 32 | 33 | 34 | #endif // HEADER_E4B4F388_CF15_44CC_8782_EA61F79FC2A0_INCLUDED 35 | -------------------------------------------------------------------------------- /src/workloads/docs/CrudActorAggregate.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload demonstrates using the CrudActor to run an aggregate command. Like find operations, 5 | genny will exhaust the cursor, measuring the initial aggregate command and all subsequent getMore 6 | operations. 7 | 8 | Actors: 9 | - Name: CrudActorAggregateExample 10 | Type: CrudActor 11 | Threads: 1 12 | Phases: 13 | - Repeat: 1 14 | Database: test 15 | Collection: crud_actor_aggregate 16 | Operations: 17 | - OperationMetricsName: PipelineWithoutOptions 18 | OperationName: aggregate 19 | OperationCommand: 20 | Pipeline: [{$match: {x: 42}}, {$group: {_id: "$y", sum: {$sum: "$z"}}}] 21 | - OperationMetricsName: PipelineWithOptions 22 | OperationName: aggregate 23 | OperationCommand: 24 | Pipeline: [{$match: {x: 42}}, {$group: {_id: "$y", sum: {$sum: "$z"}}}] 25 | # For a complete list of available options, see OptionsConversion.hpp. 26 | Options: 27 | AllowDiskUse: true 28 | BatchSize: 1000 29 | MaxTime: 5 minute 30 | -------------------------------------------------------------------------------- /src/workloads/docs/HotDocumentWriter.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | A workload to test/document the HotDocumentUpdater actor which updates a specified document in a 5 | specified collection. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | maxPoolSize: 400 11 | 12 | Actors: 13 | - Name: Loader 14 | Type: Loader 15 | Threads: 1 16 | Phases: 17 | - Repeat: 1 18 | Database: hot 19 | CollectionCount: 1 20 | Threads: 1 21 | DocumentCount: 1 22 | BatchSize: 1 23 | Document: 24 | first: first 25 | second: {^RandomInt: {min: 0, max: 1000}} 26 | - {Nop: true} 27 | 28 | - Name: HotDocumentUpdater 29 | Type: CrudActor 30 | Threads: 40 31 | Database: hot 32 | Phases: 33 | - {Nop: true} 34 | - Duration: 1 minutes 35 | Collection: Collection0 36 | Operations: 37 | - OperationName: bulkWrite 38 | OperationCommand: 39 | WriteOperations: 40 | - WriteCommand: updateOne 41 | Filter: {first: first} 42 | Update: {$set: {second: {^RandomInt: {min: 0, max: 1000}}}} 43 | GlobalRate: 1000 per 1 second 44 | -------------------------------------------------------------------------------- /docs/start.md: -------------------------------------------------------------------------------- 1 | 2 | > [!WARNING] 3 | > Adding new workloads in Genny is deprecated. If you would like 4 | > to create or modify a workload, please consider using 5 | > [locust](https://docs.devprod.prod.corp.mongodb.com/performance/workloads/locust_tests). 6 | > 7 | > If you need to modify or create a Genny workload, please reach out 8 | > in the [#ask-devprod-performance](https://mongodb.enterprise.slack.com/archives/C01VD0LQZED) 9 | > Slack channel for advice 10 | 11 | These are the docs for Genny specifically! For an overall view of MongoDB's performance testing infrastructure, please 12 | look at the [Performance Tooling Docs](https://github.com/10gen/performance-tooling-docs). 13 | 14 | If you have any questions, please reach out to the DEVPROD team in our dedicated slack channel: `#ask-devprod-performance`. 15 | If you feel like these docs can be improved in any way, feel free to open a PR and assign someone from DEVPROD. No ticket necessary. 16 | 17 | # Index 18 | * [Using Genny (Start here!)](./using.md) 19 | * [Developing in Genny](./developing.md) 20 | * [Hitchhiker's Guide (Internals)](./HitchhikersGuide.md) 21 | * [Contribution Guidelines](../CONTRIBUTING.md) 22 | * [Workload Documentation](./generated/workloads.md) 23 | * [Phase Documentation](./generated/phases.md) 24 | -------------------------------------------------------------------------------- /src/gennylib/include/gennylib/ActorVector.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef HEADER_728E42F5_3C88_4288_9D4A_945FA85DD895_INCLUDED 16 | #define HEADER_728E42F5_3C88_4288_9D4A_945FA85DD895_INCLUDED 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | namespace genny { 24 | 25 | struct Actor; 26 | 27 | /** 28 | * A convenience typedef for the return value from ActorProducer. 29 | */ 30 | using ActorVector = std::vector>; 31 | 32 | using ActorBucket = ParallelBucket>; 33 | 34 | 35 | } // namespace genny 36 | 37 | #endif // HEADER_728E42F5_3C88_4288_9D4A_945FA85DD895_INCLUDED 38 | -------------------------------------------------------------------------------- /src/third_party/poplar/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(poplarlib VERSION 0.0.1 LANGUAGES CXX) 2 | 3 | if(NOT gRPC_FOUND) 4 | message(FATAL "gRPC not found. Cannot build poplarlib...") 5 | endif() 6 | 7 | add_library(poplarlib STATIC 8 | poplarlib/collector.grpc.pb.cc 9 | poplarlib/collector.grpc.pb.h 10 | poplarlib/collector.pb.cc 11 | poplarlib/collector.pb.h 12 | 13 | poplarlib/metrics.grpc.pb.cc 14 | poplarlib/metrics.grpc.pb.h 15 | poplarlib/metrics.pb.cc 16 | poplarlib/metrics.pb.h 17 | 18 | poplarlib/poplar.grpc.pb.cc 19 | poplarlib/poplar.grpc.pb.h 20 | poplarlib/poplar.pb.cc 21 | poplarlib/poplar.pb.h 22 | 23 | poplarlib/recorder.grpc.pb.cc 24 | poplarlib/recorder.grpc.pb.h 25 | poplarlib/recorder.pb.cc 26 | poplarlib/recorder.pb.h 27 | ) 28 | 29 | target_link_libraries(poplarlib 30 | PUBLIC 31 | gRPC::grpc++ 32 | protobuf 33 | ) 34 | 35 | target_include_directories(poplarlib PUBLIC 36 | $ 37 | ) 38 | 39 | install(TARGETS poplarlib 40 | EXPORT GennyLibraryConfig 41 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 42 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 43 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) # This is for Windows 44 | -------------------------------------------------------------------------------- /src/third_party/poplar/collector.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package poplar; 4 | option go_package = "internal"; 5 | 6 | import "poplar.proto"; 7 | import "google/protobuf/timestamp.proto"; 8 | import "google/protobuf/duration.proto"; 9 | 10 | message CollectorName { 11 | string name = 1; 12 | } 13 | 14 | message EventMetrics { 15 | string name = 1; 16 | google.protobuf.Timestamp time = 2; 17 | int64 id = 3; 18 | EventMetricsCounters counters = 4; 19 | EventMetricsTimers timers = 5; 20 | EventMetricsGauges gauges = 6; 21 | } 22 | 23 | message EventMetricsCounters { 24 | int64 number = 1; 25 | int64 ops = 2; 26 | int64 size = 3; 27 | int64 errors = 4; 28 | } 29 | 30 | message EventMetricsTimers { 31 | google.protobuf.Duration total = 1; 32 | google.protobuf.Duration duration = 2; 33 | } 34 | 35 | message EventMetricsGauges { 36 | int64 state = 1; 37 | int64 workers = 2; 38 | bool failed = 3; 39 | } 40 | 41 | service PoplarEventCollector { 42 | rpc CreateCollector(CreateOptions) returns (PoplarResponse); 43 | rpc SendEvent(EventMetrics) returns (PoplarResponse); 44 | rpc RegisterStream(CollectorName) returns (PoplarResponse); 45 | rpc StreamEvents(stream EventMetrics) returns (PoplarResponse); 46 | rpc CloseCollector(PoplarID) returns (PoplarResponse); 47 | } 48 | -------------------------------------------------------------------------------- /src/workloads/docs/InsertWithNop.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Product Performance 3 | Description: | 4 | Demonstrate the InsertRemove actor. The InsertRemove actor is a simple actor that inserts and then 5 | removes the same document from a collection in a loop. Each instance of the actor uses a different 6 | document, indexed by an integer _id field. The actor records the latency of each insert and each 7 | remove. 8 | 9 | Keywords: 10 | - InsertRemove 11 | - docs 12 | 13 | Actors: 14 | - Name: InsertWithNopTest 15 | Type: Insert 16 | Threads: 100 17 | Database: "test2" 18 | Phases: 19 | - {Nop: true} 20 | - Collection: "inserts" 21 | Document: {"a": {^RandomInt: {min: 50, max: 60}}} 22 | Repeat: 1 23 | - {Nop: true} 24 | - {Nop: true} 25 | - Collection: "inserts" 26 | Document: {"b": {^RandomString: {length: {^RandomInt: {min: 5, max: 15}}, alphabet: abcde}}} 27 | Repeat: 1 28 | - Collection: "inserts" 29 | Document: {"a": {^RandomInt: {min: 63, max: 70}}} 30 | Repeat: 1 31 | - {Nop: true} 32 | - Collection: "inserts" 33 | Document: {"b": {^RandomString: {length: {^RandomInt: {min: 15, max: 25}}, alphabet: abcde}}} 34 | Repeat: 1 35 | - {Nop: true} 36 | -------------------------------------------------------------------------------- /src/workloads/scale/MixedWrites.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: DevProd Performance Infrastructure 3 | Description: | 4 | Does w:2 writes for a Phase followed 5 | by w:3 writes for a second Phase. 6 | 7 | Requires at least 3-node replset. 8 | 9 | Actors: 10 | - Name: MixedWrites 11 | Type: CrudActor 12 | Database: db 13 | Threads: 100 14 | Phases: 15 | - Phase: 0 16 | Duration: 10 minutes 17 | Collection: coll 18 | MetricsName: W2InsertOne 19 | Operation: 20 | OperationName: insertOne 21 | OperationCommand: 22 | Document: {a: 1} 23 | OperationOptions: 24 | WriteConcern: {Level: 2} 25 | Timeout: 6000 milliseconds 26 | - Phase: 1 27 | Duration: 10 minutes 28 | Collection: coll 29 | MetricsName: W3InsertOne 30 | Operation: 31 | OperationName: insertOne 32 | OperationCommand: 33 | Document: {a: 1} 34 | OperationOptions: 35 | WriteConcern: {Level: 3} 36 | Timeout: 6000 milliseconds 37 | 38 | AutoRun: 39 | - When: 40 | mongodb_setup: 41 | $eq: replica 42 | ThenRun: 43 | - mongodb_setup: replica-delay-mixed 44 | - mongodb_setup: replica 45 | -------------------------------------------------------------------------------- /src/third_party/poplar/poplarlib/poplar.grpc.pb.h: -------------------------------------------------------------------------------- 1 | // Generated by the gRPC C++ plugin. 2 | // If you make any local change, they will be lost. 3 | // source: poplar.proto 4 | #ifndef GRPC_poplar_2eproto__INCLUDED 5 | #define GRPC_poplar_2eproto__INCLUDED 6 | 7 | #include "poplar.pb.h" 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace poplar { 29 | 30 | } // namespace poplar 31 | 32 | 33 | #endif // GRPC_poplar_2eproto__INCLUDED 34 | -------------------------------------------------------------------------------- /src/workloads/docs/Deleter.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | A workload to test/document the HotDeleter actor which performs a find_one_and_delete per 5 | iteration. 6 | 7 | Actors: 8 | - Name: Loader 9 | Type: Loader 10 | Threads: 1 11 | Phases: 12 | - Repeat: 1 13 | Database: hot 14 | CollectionCount: 1 15 | Threads: 1 16 | DocumentCount: 1000 17 | BatchSize: 1000 18 | Document: 19 | a: {^RandomInt: {min: 0, max: 1000}} 20 | - {Nop: true} 21 | 22 | - Name: HotCollectionUpdater 23 | Type: CrudActor 24 | Threads: 40 25 | Database: hot 26 | Phases: 27 | - {Nop: true} 28 | - Duration: 3 minutes 29 | Collection: Collection0 30 | Operations: 31 | - OperationName: bulkWrite 32 | OperationCommand: 33 | WriteOperations: 34 | - WriteCommand: insertOne 35 | Document: {a: {^RandomInt: {min: 0, max: 1000}}} 36 | GlobalRate: 1000 per 1 second 37 | 38 | - Name: HotDeleter 39 | Type: Deleter 40 | Threads: 40 41 | Database: hot 42 | Phases: 43 | - {Nop: true} 44 | - Duration: 3 minutes 45 | Collection: Collection0 46 | GlobalRate: 1000 per 1 second 47 | -------------------------------------------------------------------------------- /cmake/GetSsl.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | ## Find OpenSSL for both mongo-cxx-driver linking and jasper 16 | 17 | # See https://cmake.org/cmake/help/v3.11/module/FindOpenSSL.html 18 | # OPENSSL_ROOT_DIR and OPENSSL_USE_STATIC_LIBS are often important 19 | find_package(OpenSSL 1.1 REQUIRED) 20 | 21 | get_filename_component(OPENSSL_CRYPTO_LIBRARY_REALPATH 22 | "${OPENSSL_CRYPTO_LIBRARY}" REALPATH CACHE 23 | ) 24 | get_filename_component(OPENSSL_SSL_LIBRARY_REALPATH 25 | "${OPENSSL_SSL_LIBRARY}" REALPATH CACHE 26 | ) 27 | install(FILES 28 | "${OPENSSL_CRYPTO_LIBRARY_REALPATH}" 29 | "${OPENSSL_SSL_LIBRARY_REALPATH}" 30 | DESTINATION ${CMAKE_INSTALL_LIBDIR}) 31 | 32 | -------------------------------------------------------------------------------- /src/lamplib/src/genny/templates/documentation.md.j2: -------------------------------------------------------------------------------- 1 | # {{documentation_type|capitalize}} Documentation 2 | 3 | This documentation is generated from the yaml files in the `src/{{documentation_type}}s` directory. The {{documentation_type}}s listed here are limited in scope to the Genny repo. 4 | 5 | We parse the `keywords`, `owner`, `description`, and the {{documentation_type}} name from each yaml file to generate this documentation. Clicking on the header of each {{documentation_type}} will take you to its yaml file in the repo. 6 | 7 | If you want to update the documentation please update the {{documentation_type}}'s respective yaml file, run `./run-genny generate-docs`, and commit the changes. 8 | 9 | {% for workload in workloads %} 10 | ## [{{ workload.name }}]({{workload.github_link}}) 11 | ### Owner 12 | {{ workload.owner }} 13 | 14 | {% if workload.support_channel_id and workload.support_channel_name %} 15 | ### Support Channel 16 | [{{ workload.support_channel_name }}](https://mongodb.enterprise.slack.com/archives/{{ workload.support_channel_id }}) 17 | {% endif %} 18 | 19 | ### Description 20 | {{ workload.description }} 21 | {% if workload.task_page %} 22 | [Task Page]({{workload.task_page}}) 23 | {% endif %} 24 | 25 | {% if workload.keywords %} 26 | ### Keywords 27 | {{ workload.keywords|join(", ") }} 28 | {% endif %} 29 | {% endfor %} -------------------------------------------------------------------------------- /src/lamplib/src/tests/genny/tasks/test_mothra_service.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pytest 3 | from unittest.mock import call, patch 4 | from genny.tasks.mothra_service import MothraService, TEAMS_FILES_PATHS 5 | 6 | 7 | @pytest.fixture 8 | def data(): 9 | return { 10 | "teams": [ 11 | { 12 | "name": "team1", 13 | "support_slack_channel_name": "team1_support", 14 | "support_slack_channel_id": "team1_id", 15 | }, 16 | { 17 | "name": "team2", 18 | "support_slack_channel_name": "team2_support", 19 | "support_slack_channel_id": "team2_id", 20 | }, 21 | ] 22 | } 23 | 24 | 25 | class TestMothraService: 26 | @patch("genny.tasks.mothra_service.open") 27 | @patch("genny.tasks.mothra_service.yaml.safe_load") 28 | def test_get_team(self, mock_safe_load, mock_open, data): 29 | mock_safe_load.return_value = data 30 | 31 | genny_repo_root = os.environ.get("GENNY_REPO_ROOT", ".") 32 | service = MothraService(genny_repo_root) 33 | 34 | mock_open.assert_has_calls( 35 | [call(f"{genny_repo_root}/mothra/{file}") for file in TEAMS_FILES_PATHS], 36 | any_order=True, 37 | ) 38 | assert service.get_team("team1") is not None 39 | assert service.get_team("team2") is not None 40 | -------------------------------------------------------------------------------- /src/workloads/docs/LoggingActorExample.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: DevProd Performance Infrastructure 3 | Description: | 4 | The LoggingActor exists so DSI and Evergreen don't quit 5 | your workload for not outputting anything to stdout. 6 | (They do this in case your workload has timed-out.) If 7 | you don't want to add periodic logging to your Actor 8 | (you probably don't because logging would be done by 9 | every thread and would probably make your workload super 10 | verbose), then you can drop this Actor at the end of 11 | your Workload YAML and configure this Actor to log 12 | something periodically in Phases that are likely to run 13 | longer than a few minutes. 14 | 15 | This workload "works", but it basically just exits right 16 | away without actually logging anything because the 17 | LoggingActor insists on being a "background" Actor that 18 | can never block a Phase from completing, and it only 19 | actually logs every 10000 iterations. 20 | 21 | To use this Actor, copy/paste the below block into 22 | your workload YAML and create a Phase block for 23 | every Phase that may last longer than a few minutes. 24 | 25 | Actors: 26 | - Name: LoggingActor 27 | Type: LoggingActor 28 | Threads: 1 # must be 1 29 | Phases: 30 | - Phase: 0 31 | LogEvery: 15 minutes # TimeSpec 32 | Blocking: None # must be Blocking:None 33 | -------------------------------------------------------------------------------- /src/gennylib/include/gennylib/quiesce.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2021-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | 18 | #include 19 | 20 | namespace genny { 21 | 22 | /** 23 | * Helper function to quiesce the system and reduce noise. 24 | * The appropriate actions will be taken whether the target 25 | * is a standalone, replica set, or sharded cluster. 26 | * 27 | * Note: This function is effectively in beta mode. We expect it to work, but 28 | * it hasn't been used extensively in production. Please let STM know of any 29 | * use so we can help monitor its effectiveness. 30 | */ 31 | bool quiesce(mongocxx::pool::entry& client, 32 | const std::string& dbName, 33 | const SleepContext& sleepContext); 34 | 35 | } // namespace genny 36 | -------------------------------------------------------------------------------- /src/phases/query/Views.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | Defines common configurations for workloads that operate on views. 5 | 6 | # Creates an identity view (view with an empty pipeline that acts as a no-op) over the given collection. 7 | CreateIdentityView: 8 | Name: { ^Parameter: { Name: "Name", Default: "CreateIdentityView" } } 9 | Type: RunCommand 10 | Threads: 1 11 | Phases: 12 | OnlyActiveInPhases: 13 | Active: 14 | [ 15 | { 16 | ^Parameter: 17 | { 18 | Name: "OnlyActiveInPhase", 19 | Default: 20 | { 21 | unused: "please specify in which phases this actor should be active.", 22 | }, 23 | }, 24 | }, 25 | ] 26 | NopInPhasesUpTo: { ^Parameter: { Name: "NopInPhasesUpTo", Default: 99 } } 27 | PhaseConfig: 28 | Repeat: 1 29 | Database: { ^Parameter: { Name: "Database", Default: test } } 30 | Operations: 31 | - OperationName: RunCommand 32 | ReportMetrics: false 33 | OperationCommand: 34 | { 35 | create: { ^Parameter: { Name: "View", Default: Collection0 } }, 36 | viewOn: 37 | { ^Parameter: { Name: "Collection", Default: Collection0 } }, 38 | pipeline: [], 39 | } 40 | -------------------------------------------------------------------------------- /src/workloads/transactions/templates/README.md: -------------------------------------------------------------------------------- 1 | Long Lived Transactions 2 | ===== 3 | 4 | Currently, genny does not support parameterization, but the LLT workloads are highly repetitive. 5 | 6 | For the moment, the __LLT*LowLtc.tmpl__ files can be considered the source files for the other configurations. 7 | 8 | To generate the other configurations, run the following commands from the root directory: 9 | 10 | ```bash 11 | out_dir=src/workloads/transactions/templates/out 12 | mkdir -pv $out_dir 13 | for file in src/workloads/transactions/templates/LLT*LowLtc.tmpl; do 14 | cp $file $out_dir/$(basename ${file/tmpl/yml}) 15 | done 16 | for file in $out_dir/LLT*LowLtc.yml; do 17 | sed -e 's/^ GlobalRateValue: .*$/ GlobalRateValue: \&GlobalRateValue 1 per 1250 microsecond/' \ 18 | -e 's/^ ThreadsValue: .*$/ ThreadsValue: \&ThreadsValue 16/' ${file} > ${file/Low/High} 19 | done 20 | for file in $out_dir/LLT*Ltc.yml; do 21 | sed -e 's/^ InitialDocumentCount: .*$/ InitialDocumentCount: \&InitialNumDocs 49000000/' \ 22 | -e 's/^ SecondaryDocumentCount: .*$/ SecondaryDocumentCount: \&SecondaryNumDocs 10000000/' \ 23 | -e 's/^ # In-memory: Database size works out about 12GB.$/ # Not In-memory: Database size works out about 30GB./' \ 24 | ${file} > ${file/Ltc/Gtc} 25 | done 26 | ``` 27 | 28 | Copy them to the desired location, but for the moment we are only deploying the equivalent of the Mixed High and Low Ltc. -------------------------------------------------------------------------------- /src/workloads/execution/MixedMultiDeletesDocByDocWithSecondaryIndexes.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | Deletes a range of documents using the DELETE query exec stage both in isolation and while 5 | performing writes on another collection. Introduces secondary indexes on the collection where the 6 | mass deletion is issued to measure the impact of additional work per document deletion on 7 | concurrent write latency. Tests deletes on documents of size ~1KB then deletes on documents of 8 | ~10MB. 9 | 10 | Keywords: 11 | - RunCommand 12 | - Loader 13 | - LoggingActor 14 | - CrudActor 15 | - insert 16 | - delete 17 | - batch 18 | - deleteMany 19 | - latency 20 | 21 | Clients: 22 | Default: 23 | QueryOptions: 24 | # Allow for longer duration since the loading of the data may take a while. 25 | socketTimeoutMS: 3_600_000 # = 1 hour 26 | 27 | LoadConfig: 28 | Path: "../../phases/execution/MixedMultiDeletes.yml" 29 | Parameters: 30 | UseBatchedDeleteStage: 0 31 | ConfigurationFile: "../../phases/execution/config/MultiDeletes/WithSecondaryIndexes.yml" 32 | 33 | AutoRun: 34 | - When: 35 | mongodb_setup: 36 | $eq: 37 | - replica 38 | branch_name: 39 | $neq: 40 | - v4.2 41 | - v4.4 42 | - v5.0 43 | # 6.0 Does not have the 'batchUserMultiDeletes' server parameter. 44 | - v6.0 45 | -------------------------------------------------------------------------------- /src/workloads/execution/MixedMultiDeletesBatchedWithSecondaryIndexes.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | Deletes a range of documents using the BATCHED_DELETE query exec stage both in isolation and while 5 | performing writes on another collection. Introduces secondary indexes on the collection where the 6 | mass deletion is issued to measure the impact of additional work per document deletion on 7 | concurrent write latency. Tests deletes on documents of size ~1KB then deletes on documents of 8 | ~10MB. 9 | 10 | Keywords: 11 | - RunCommand 12 | - Loader 13 | - LoggingActor 14 | - CrudActor 15 | - insert 16 | - delete 17 | - batch 18 | - deleteMany 19 | - latency 20 | 21 | Clients: 22 | Default: 23 | QueryOptions: 24 | # Allow for longer duration since the loading of the data may take a while. 25 | socketTimeoutMS: 3_600_000 # = 1 hour 26 | 27 | LoadConfig: 28 | Path: "../../phases/execution/MixedMultiDeletes.yml" 29 | Parameters: 30 | UseBatchedDeleteStage: 1 31 | ConfigurationFile: "../../phases/execution/config/MultiDeletes/WithSecondaryIndexes.yml" 32 | 33 | AutoRun: 34 | - When: 35 | mongodb_setup: 36 | $eq: 37 | - replica 38 | branch_name: 39 | $neq: 40 | - v4.2 41 | - v4.4 42 | - v5.0 43 | # 6.0 Does not have the 'batchUserMultiDeletes' server parameter. 44 | - v6.0 45 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/README.org: -------------------------------------------------------------------------------- 1 | qe_test_gen is a python program which generates Genny workloads for Queryable Encryption. 2 | 3 | * Prerequisites 4 | Install Poetry, following by [[https://python-poetry.org/docs/#installation][their documentation]] for one of the supported installation methods. 5 | 6 | Then, using this directory as your current working directory, invoke Poetry to install the required dependencies into your local virtual environment, using the specific versions enumerated in =poetry.lock=. 7 | #+BEGIN_SRC sh 8 | poetry install 9 | #+END_SRC 10 | 11 | * Usage 12 | Generate tests and runtime requirements by invoking qe_test_gen as follows: 13 | 14 | #+BEGIN_SRC sh 15 | poetry run python qe_test_gen/medical.py 16 | #+END_SRC 17 | 18 | This command will create: 19 | - maps_medical.yml :: This file describes the data distributions for all fields. Genny will use this file to load data into the database. 20 | - .txt :: These files contain all the possible values which a particular field may contain. Workloads will use these files to issue queries which are guaranteed to return a matching document. 21 | - workload/*.yml :: Each of these files represent a workload. They must be copied from this directory, into a path which Genny will scan in Evergreen. 22 | - patchConfig.yml :: *Most* of a YAML file which perf_tooling can use to download performance metrics. At a minimum, you'll need to edit in the Patch ID from an Evergreen patch you put up. 23 | -------------------------------------------------------------------------------- /src/driver/src/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | #include 20 | 21 | #include 22 | 23 | 24 | int main(int argc, char** argv) { 25 | auto opts = genny::driver::DefaultDriver::ProgramOptions(argc, argv); 26 | if (opts.runMode == genny::driver::DefaultDriver::RunMode::kHelp) { 27 | auto v = std::make_optional(genny::getVersion()); 28 | // basically just a test that we're using c++17 29 | std::cout << u8"\n🧞 Genny" << " Version " << v.value_or("ERROR") << u8" 💝🐹🌇⛔\n"; 30 | std::cout << opts.description << std::endl; 31 | return static_cast(opts.parseOutcome); 32 | } 33 | 34 | genny::driver::DefaultDriver d; 35 | 36 | auto code = d.run(opts); 37 | return static_cast(code); 38 | } 39 | -------------------------------------------------------------------------------- /src/workloads/docs/LongLivedCreator.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Storage Execution 3 | Description: | 4 | Basic workload to test/document the long lived creator actor which utilizes the loader actor to 5 | create and populate a set of long lived collections. 6 | 7 | Clients: 8 | Default: 9 | QueryOptions: 10 | maxPoolSize: 400 11 | 12 | Actors: 13 | - Name: LongLivedCreator 14 | Type: Loader 15 | Threads: 10 16 | Phases: 17 | - Repeat: 1 18 | Database: &DB longlived 19 | CollectionCount: &CollectionCount 1000 20 | Threads: 10 21 | DocumentCount: &DocumentCount 1000 22 | BatchSize: 1000 23 | Document: 24 | # Each document ranges in size from about 90 to 150 bytes (average 120) 25 | x0: &rand_10k_int {^RandomInt: {min: 0, max: 10000}} 26 | x1: &rand4int {^RandomInt: {min: 0, max: 2147483647}} 27 | x2: *rand4int 28 | x3: *rand4int 29 | x4: *rand4int 30 | x5: *rand4int 31 | x6: *rand4int 32 | x7: *rand4int 33 | x8: *rand4int 34 | s0: {^RandomString: {length: {^RandomInt: {min: 20, max: 80}}}} 35 | Indexes: 36 | - keys: {x0: 1} 37 | - keys: {x1: 1} 38 | - keys: {x2: 1} 39 | - keys: {x3: 1} 40 | - keys: {x4: 1} 41 | - keys: {x5: 1} 42 | - keys: {x6: 1} 43 | - keys: {x7: 1} 44 | - keys: {x8: 1} 45 | - {Nop: true} 46 | -------------------------------------------------------------------------------- /src/workloads/docs/RunCommand.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: DevProd Performance Infrastructure 3 | Description: | 4 | This workload demonstrates the RunCommand and AdminCommand actors, which can be used to 5 | run commands against a target server. 6 | 7 | Actors: 8 | - Name: ServerStatusInsert 9 | Type: RunCommand 10 | Threads: 1 11 | Phases: 12 | - Duration: 5 minutes 13 | Database: test 14 | Operations: 15 | - OperationMetricsName: ServerStatus 16 | OperationName: RunCommand 17 | OperationCommand: 18 | serverStatus: 1 19 | - OperationName: RunCommand 20 | OperationCommand: 21 | insert: myCollection 22 | documents: [{name: {^RandomString: {length: {^RandomInt: {min: 2, max: 5}}}}, rating: 10, address: someAddress, cuisine: italian}] 23 | - Name: CurrentOp 24 | Type: AdminCommand 25 | Threads: 1 26 | Phases: 27 | - Repeat: 5 28 | Operation: 29 | OperationMetricsName: CurrentOp 30 | OperationName: RunCommand 31 | OperationCommand: 32 | currentOp: 1 33 | - Name: Stepdown 34 | Type: AdminCommand 35 | Threads: 1 36 | Phases: 37 | - Phase: 0 38 | Repeat: 1 39 | Operation: 40 | OperationMetricsName: Stepdown 41 | OperationName: RunCommand 42 | OperationCommand: 43 | replSetStepDown: 60 44 | OperationAwaitStepdown: true 45 | 46 | -------------------------------------------------------------------------------- /src/workloads/scale/CollScan.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Product Performance 3 | Description: | 4 | This workload loads 10M rows into a collection, then executes collection scans in a single thread. 5 | 6 | Keywords: 7 | - collection scan 8 | 9 | Actors: 10 | 11 | - Name: Loader 12 | Type: Loader 13 | Threads: 1 # TODO: Loader doesn't support multiple threads for a single collection 14 | Phases: 15 | - Repeat: 1 16 | Database: &DB test 17 | Threads: 1 18 | CollectionCount: 1 19 | # Collection name will be Collection0, this is not configurable. 20 | DocumentCount: 10000000 # 10M 21 | BatchSize: 1000 22 | Document: # Documents are approximately 18 - 108 bytes in size 23 | x: {^RandomInt: {distribution: geometric, p: 0.1}} 24 | string0: {^RandomString: {length: {^RandomInt: {min: 5, max: 50}}}} 25 | y: {^RandomInt: {min: 0, max: 2147483647}} 26 | string1: {^RandomString: {length: {^RandomInt: {min: 5, max: 50}}}} 27 | z: {^RandomInt: {min: 0, max: 2147483647}} 28 | Indexes: 29 | - keys: {y: 1} 30 | - &Nop {Nop: true} 31 | 32 | - Name: CollScan 33 | Type: RunCommand 34 | Threads: 1 35 | Phases: 36 | - *Nop 37 | - Repeat: 10 38 | Database: *DB 39 | Operations: 40 | - OperationName: RunCommand 41 | OperationCommand: 42 | find: Collection0 43 | filter: {x: "never true"} 44 | -------------------------------------------------------------------------------- /src/cast_core/include/cast_core/helpers/pipeline_helpers.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef HEADER_608EA64E_00F3_461F_9013_CF60AE6E2602_INCLUDE 16 | #define HEADER_608EA64E_00F3_461F_9013_CF60AE6E2602_INCLUDE 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | namespace genny::pipeline_helpers { 24 | /** 25 | * Converts the given 'pipeline' to an object with numerical property names. 26 | */ 27 | bsoncxx::document::value copyPipelineToDocument(const mongocxx::pipeline& pipeline); 28 | 29 | /** 30 | * Instantiates a pipeline from 'pipelineGenerator' and returns a mongocxx::pipeline from the 31 | * result. 32 | */ 33 | mongocxx::pipeline makePipeline(PipelineGenerator& pipelineGenerator); 34 | 35 | } // namespace genny::pipeline_helpers 36 | 37 | #endif // HEADER_608EA64E_00F3_461F_9013_CF60AE6E2602_INCLUDE 38 | -------------------------------------------------------------------------------- /src/workloads/transactions/LLTMixedSmall.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Product Performance 3 | Description: | 4 | Workload to Benchmark the effect of LongLivedTransactions on a Mixed workload. 5 | The intent here is to test multiple transactions contained within a singular transaction (long lived). 6 | The transactions are setup such that they cover a mixed set of operations (insert, query, update, remove). 7 | The operations are also divided in the length of their run (short, medium, long) and whether they contain scans or not. 8 | The workload has the following configuration: 9 | ~7GB dataset 10 | 6,000,000 documnets in total 11 | Warm up phase, then operation phase followed by a quiesce phase 12 | Naming Conventions: 13 | Duration.Load_level.Operation.Type_of_test 14 | Operation: Insert|Query|Update|Remove|Mixed 15 | Duration: Short|Medium|Long 16 | Type of test: Baseline|Benchmark 17 | Baseline without scans, benchmark with scans 18 | Clients: 19 | Default: 20 | QueryOptions: 21 | socketTimeoutMS: -1 22 | maxPoolSize: 2000 23 | 24 | LoadConfig: 25 | Path: ./LLTMixed.yml 26 | Parameters: 27 | InitialNumDocs: 6000000 28 | SecondaryNumDocs: 6000000 29 | 30 | AutoRun: 31 | - When: 32 | mongodb_setup: 33 | $eq: 34 | - atlas-like-replica.2022-10 35 | - replica 36 | - replica-80-feature-flags 37 | - replica-all-feature-flags 38 | branch_name: 39 | $neq: 40 | - v4.0 41 | - v4.2 42 | 43 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_range_testing/templates/rc-perfconfig.yml.j2: -------------------------------------------------------------------------------- 1 | workload_name: rc_experiment 2 | patches: 3 | {{ patch_id }}: 4 | perf-3-shard-fle.arm.aws.2023-11: {% for exp_name in experiments %} 5 | - "qe_range_testing_workloads_evergreen_{{ exp_name }}"{% endfor %} 6 | genny_metrics: 7 | tests: 8 | {% for i in range(n_threads) %} 9 | - "InsertActor_Thread{{i}}.load.inserts" 10 | - "FSMActor_Thread{{i}}.FSM.range_query" 11 | - "FSMActor_Thread{{i}}.FSM.update"{%endfor%} 12 | metrics: 13 | - "OperationsTotal" 14 | - "DocumentsTotal" 15 | - "SizeTotal" 16 | - "DurationTotal" 17 | - "OverheadTotal" 18 | - "ErrorsTotal" 19 | - "AverageLatency" 20 | - "AverageSize" 21 | - "OperationThroughput" 22 | - "DocumentThroughput" 23 | - "SizeThroughput" 24 | - "LatencyMin" 25 | - "LatencyMax" 26 | - "Latency50thPercentile" 27 | - "Latency80thPercentile" 28 | - "Latency90thPercentile" 29 | - "Latency95thPercentile" 30 | - "Latency99thPercentile" 31 | - "WorkersMin" 32 | - "WorkersMax" 33 | - "ErrorRate" 34 | storage_metrics: 35 | tests: {% for exp_name in experiments %} 36 | - "qe_range_testing_workloads_evergreen_{{ exp_name }} Storage Metrics"{% endfor %} 37 | metrics: 38 | - "Average Growth in /data/dbs/ (bytes/s)" 39 | - "End size of /data/dbs/ (bytes)" 40 | timing_metrics: 41 | tests: {% for exp_name in experiments %} 42 | - "qe_range_testing_workloads_evergreen_{{ exp_name }} Timing Metrics"{% endfor %} 43 | metrics: 44 | - "Total Duration (s)" 45 | curator: "/home/ubuntu/genny/build/curator/curator" 46 | -------------------------------------------------------------------------------- /src/cast_core/src/pipeline_helpers.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | namespace genny::pipeline_helpers { 18 | /** 19 | * Converts the given 'pipeline' to an object with numerical property names. 20 | */ 21 | bsoncxx::document::value copyPipelineToDocument(const mongocxx::pipeline& pipeline) { 22 | auto arrayView = pipeline.view_array(); 23 | bsoncxx::document::view docView{arrayView.data(), arrayView.length()}; 24 | return bsoncxx::document::value{docView}; 25 | } 26 | 27 | /** 28 | * Instantiates a pipeline from 'pipelineGenerator' and returns a mongocxx::pipeline from the 29 | * result. 30 | */ 31 | mongocxx::pipeline makePipeline(PipelineGenerator& pipelineGenerator) { 32 | mongocxx::pipeline pipeline; 33 | for (auto&& stageGen : pipelineGenerator.stageGenerators) { 34 | pipeline.append_stage(stageGen()); 35 | } 36 | 37 | return pipeline; 38 | } 39 | 40 | } // namespace genny::pipeline_helpers 41 | -------------------------------------------------------------------------------- /cmake/FindMongoCxx.cmake: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | find_package(libmongocxx REQUIRED) 16 | find_package(libbsoncxx REQUIRED) 17 | include_directories(${LIBMONGOCXX_INCLUDE_DIR}) 18 | include_directories(${LIBBSONCXX_INCLUDE_DIR}) 19 | 20 | # Make a target for bsoncxx 21 | add_library(MongoCxx::bsoncxx SHARED IMPORTED GLOBAL) 22 | set_target_properties(MongoCxx::bsoncxx 23 | PROPERTIES 24 | IMPORTED_LOCATION "${LIBBSONCXX_LIBRARY_PATH}" 25 | ) 26 | target_include_directories(MongoCxx::bsoncxx 27 | INTERFACE 28 | ${LIBBSONCXX_INCLUDE_DIRS} 29 | ) 30 | 31 | # Make a target for mongocxx 32 | add_library(MongoCxx::mongocxx SHARED IMPORTED GLOBAL) 33 | set_target_properties(MongoCxx::mongocxx 34 | PROPERTIES 35 | IMPORTED_LOCATION "${LIBMONGOCXX_LIBRARY_PATH}" 36 | ) 37 | target_include_directories(MongoCxx::mongocxx 38 | INTERFACE 39 | ${LIBMONGOCXX_INCLUDE_DIRS} 40 | ) 41 | target_link_libraries(MongoCxx::mongocxx 42 | INTERFACE 43 | MongoCxx::bsoncxx 44 | ) 45 | -------------------------------------------------------------------------------- /src/workloads/docs/ExternalScriptActor.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: "@mongodb/query" 3 | Description: | 4 | This workload was created to test an external script runner as per PERF-3198. 5 | The execution stats of the script will be collected with metrics name "ExternalScript" 6 | If the script writes and only writes an integer to stdout as result, the result will be 7 | collected to the specified metrics name (DefaultMetricsName as default) 8 | 9 | Actors: 10 | # Run JS script without connecting to a mongo db server 11 | - Name: MongoshScriptRunner 12 | Type: ExternalScriptRunner 13 | Threads: 5 14 | Phases: 15 | - Repeat: 5 16 | # script command 17 | Command: "mongosh" 18 | MetricsName: MyMetrics 19 | Script: "console.log(1)" 20 | # Connect to mongodb server and run JS script 21 | - Name: MongoshScriptRunnerWithDB 22 | Type: ExternalScriptRunner 23 | Threads: 5 24 | Phases: 25 | - Repeat: 5 26 | # script command 27 | Command: "mongosh" 28 | MongoServerURI: "localhost:27017" 29 | MetricsName: MyMetrics 30 | Script: "db.collection.countDocuments({})" 31 | # Run shell script 32 | - Name: ShellScriptRunner 33 | Type: ExternalScriptRunner 34 | Threads: 5 35 | Phases: 36 | - Repeat: 5 37 | # script command 38 | Command: "sh" 39 | MetricsName: MyMetrics 40 | Script: "echo 1" 41 | - Name: PythonRunner 42 | Type: Python 43 | Threads: 5 44 | Phases: 45 | - Repeat: 5 46 | Module: example_actor 47 | Endpoint: hello_world 48 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/qe_test_gen/templates/patch_config.jinja2: -------------------------------------------------------------------------------- 1 | # This workload file describes the evergreen patches and tasks that produced 2 | # reliable data for 3 | workload_name: qe_test_insert 4 | patches: 5 | # This patch excludes the sharded test results 6 | ReplaceMeWithPatchID: 7 | linux-1-node-replSet-fle.2022-11: 8 | {% for test in testNames %} 9 | - << test >> 10 | {% endfor %} 11 | perf-3-shard-fle.arm.aws.2023-11 12 | {% for test in testNames %} 13 | - << test >> 14 | {% endfor %} 15 | genny_metrics: 16 | tests: 17 | - "InsertActor.load.inserts" 18 | - "InsertActor.FSM.update" 19 | - "InsertActor.FSM.query" 20 | metrics: 21 | - "OperationsTotal" 22 | - "DocumentsTotal" 23 | - "SizeTotal" 24 | - "DurationTotal" 25 | - "OverheadTotal" 26 | - "ErrorsTotal" 27 | - "AverageLatency" 28 | - "AverageSize" 29 | - "OperationThroughput" 30 | - "DocumentThroughput" 31 | - "SizeThroughput" 32 | - "LatencyMin" 33 | - "LatencyMax" 34 | - "Latency50thPercentile" 35 | - "Latency80thPercentile" 36 | - "Latency90thPercentile" 37 | - "Latency95thPercentile" 38 | - "Latency99thPercentile" 39 | - "WorkersMin" 40 | - "WorkersMax" 41 | - "ErrorRate" 42 | storage_metrics: 43 | tests: 44 | - "crud_actor_qe Storage Metrics" 45 | metrics: 46 | - "Average Growth in /data/dbs/ (bytes/s)" 47 | - "End size of /data/dbs/ (bytes)" 48 | timing_metrics: 49 | tests: 50 | {% for test in testNames %} 51 | - "<< test >> Timing Metrics" 52 | {% endfor %} 53 | metrics: 54 | - "Total Duration (s)" 55 | curator: "/perftooling/curator" 56 | -------------------------------------------------------------------------------- /src/workloads/encrypted/YCSBLikeQueryableEncrypt1Cf16.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Server Security 3 | Description: | 4 | Mimics a YCSB workload, with queryable encryption enabled. Performs queries on an encrypted 5 | field, instead of _id, during the read/update phase. This workload was originally two separate 6 | files, YCSBLikeQueryableEncrypt1Cf16.yml and YCSBLikeQueryableEncrypt1Cf16Sharded.yml. It was 7 | merged into a single file when "OnlyRunInInstance: sharded" became an option. 8 | 9 | Encryption: 10 | UseCryptSharedLib: true 11 | CryptSharedLibPath: /data/workdir/mongocrypt/lib/mongo_crypt_v1.so 12 | EncryptedCollections: 13 | - Database: genny_qebench 14 | Collection: testcoll 15 | EncryptionType: queryable 16 | QueryableEncryptedFields: 17 | field0: {type: "string", queries: [{queryType: "equality", contention: 16}]} 18 | 19 | Clients: 20 | EncryptedPool: 21 | QueryOptions: 22 | maxPoolSize: 400 23 | # Comment this section out to disable encryption 24 | EncryptionOptions: 25 | KeyVaultDatabase: "keyvault" 26 | KeyVaultCollection: "datakeys" 27 | EncryptedCollections: 28 | - genny_qebench.testcoll 29 | 30 | LoadConfig: 31 | Path: ../../phases/encrypted/YCSBLikeEncryptedTemplate.yml 32 | Parameters: 33 | Database: genny_qebench 34 | Collection: testcoll 35 | Namespace: genny_qebench.testcoll 36 | ClientName: EncryptedPool 37 | 38 | AutoRun: 39 | - When: 40 | mongodb_setup: 41 | $eq: 42 | - single-replica-fle 43 | - shard-fle 44 | branch_name: 45 | $gte: v7.0 46 | -------------------------------------------------------------------------------- /src/workloads/encrypted/YCSBLikeQueryableEncrypt1Cf32.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Server Security 3 | Description: | 4 | Mimics a YCSB workload, with queryable encryption enabled. Performs queries on an encrypted 5 | field, instead of _id, during the read/update phase. This workload was originally two separate 6 | files, YCSBLikeQueryableEncrypt1Cf32.yml and YCSBLikeQueryableEncrypt1Cf32Sharded.yml. It was 7 | merged into a single file when "OnlyRunInInstance: sharded" became an option. 8 | 9 | Encryption: 10 | UseCryptSharedLib: true 11 | CryptSharedLibPath: /data/workdir/mongocrypt/lib/mongo_crypt_v1.so 12 | EncryptedCollections: 13 | - Database: genny_qebench 14 | Collection: testcoll 15 | EncryptionType: queryable 16 | QueryableEncryptedFields: 17 | field0: {type: "string", queries: [{queryType: "equality", contention: 32}]} 18 | 19 | Clients: 20 | EncryptedPool: 21 | QueryOptions: 22 | maxPoolSize: 400 23 | # Comment this section out to disable encryption 24 | EncryptionOptions: 25 | KeyVaultDatabase: "keyvault" 26 | KeyVaultCollection: "datakeys" 27 | EncryptedCollections: 28 | - genny_qebench.testcoll 29 | 30 | LoadConfig: 31 | Path: ../../phases/encrypted/YCSBLikeEncryptedTemplate.yml 32 | Parameters: 33 | Database: genny_qebench 34 | Collection: testcoll 35 | Namespace: genny_qebench.testcoll 36 | ClientName: EncryptedPool 37 | 38 | AutoRun: 39 | - When: 40 | mongodb_setup: 41 | $eq: 42 | - single-replica-fle 43 | - shard-fle 44 | branch_name: 45 | $gte: v7.0 46 | -------------------------------------------------------------------------------- /src/workloads/encrypted/YCSBLikeQueryableEncrypt1Cfdefault.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Server Security 3 | Description: | 4 | Mimics a YCSB workload, with queryable encryption enabled. Performs queries on an encrypted 5 | field, instead of _id, during the read/update phase. This workload was originally two separate 6 | files, YCSBLikeQueryableEncrypt1Cfdefault.yml and YCSBLikeQueryableEncrypt1CfdefaultSharded.yml. 7 | It was merged into a single file when "OnlyRunInInstance: sharded" became an option. 8 | 9 | Encryption: 10 | UseCryptSharedLib: true 11 | CryptSharedLibPath: /data/workdir/mongocrypt/lib/mongo_crypt_v1.so 12 | EncryptedCollections: 13 | - Database: genny_qebench 14 | Collection: testcoll 15 | EncryptionType: queryable 16 | QueryableEncryptedFields: 17 | field0: {type: "string", queries: [{queryType: "equality"}]} 18 | 19 | Clients: 20 | EncryptedPool: 21 | QueryOptions: 22 | maxPoolSize: 400 23 | # Comment this section out to disable encryption 24 | EncryptionOptions: 25 | KeyVaultDatabase: "keyvault" 26 | KeyVaultCollection: "datakeys" 27 | EncryptedCollections: 28 | - genny_qebench.testcoll 29 | 30 | LoadConfig: 31 | Path: ../../phases/encrypted/YCSBLikeEncryptedTemplate.yml 32 | Parameters: 33 | Database: genny_qebench 34 | Collection: testcoll 35 | Namespace: genny_qebench.testcoll 36 | ClientName: EncryptedPool 37 | 38 | AutoRun: 39 | - When: 40 | mongodb_setup: 41 | $eq: 42 | - single-replica-fle 43 | - shard-fle 44 | branch_name: 45 | $gte: v7.0 46 | -------------------------------------------------------------------------------- /src/cast_core/include/cast_core/actors/LoggingActor.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef HEADER_F11FE181_61A3_460F_859D_ED9D60954E50_INCLUDED 16 | #define HEADER_F11FE181_61A3_460F_859D_ED9D60954E50_INCLUDED 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace genny::actor { 25 | 26 | /** 27 | * Refer to workloads/docs/LoggingActorExample.yml for configuration examples. 28 | * Owner: STM Team 29 | */ 30 | class LoggingActor : public Actor { 31 | public: 32 | explicit LoggingActor(ActorContext& context); 33 | ~LoggingActor() override = default; 34 | void run() override; 35 | static std::string_view defaultName() { 36 | return "LoggingActor"; 37 | } 38 | 39 | private: 40 | /** @private */ 41 | struct PhaseConfig; 42 | PhaseLoop _loop; 43 | }; 44 | 45 | } // namespace genny::actor 46 | 47 | #endif // HEADER_F11FE181_61A3_460F_859D_ED9D60954E50_INCLUDED 48 | -------------------------------------------------------------------------------- /src/workloads/encrypted/ExponentialCompact.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Server Security 3 | Description: | 4 | With queryable encryption enabled, this workload runs alternating CRUD and compact phases, 5 | where the total number of inserts & updates is increased on every CRUD+Compact cycle in order 6 | to grow the ECOC collection to a size that is at least twice its pre-compaction size in 7 | the previous cycle. This is meant to test how long compaction takes relative to ECOC size. 8 | 9 | Encryption: 10 | UseCryptSharedLib: true 11 | CryptSharedLibPath: /data/workdir/mongocrypt/lib/mongo_crypt_v1.so 12 | EncryptedCollections: 13 | - Database: genny_qebench 14 | Collection: testcoll 15 | EncryptionType: queryable 16 | QueryableEncryptedFields: 17 | field0: {type: "string", queries: [{queryType: "equality"}]} 18 | 19 | Clients: 20 | EncryptedPool: 21 | QueryOptions: 22 | maxPoolSize: 400 23 | socketTimeoutMS: -1 24 | # Comment this section out to disable encryption 25 | EncryptionOptions: 26 | KeyVaultDatabase: "keyvault" 27 | KeyVaultCollection: "datakeys" 28 | EncryptedCollections: 29 | - genny_qebench.testcoll 30 | 31 | LoadConfig: 32 | Path: ../../phases/encrypted/ContinuousWritesWithExponentialCompactTemplate.yml 33 | Parameters: 34 | Database: genny_qebench 35 | Collection: testcoll 36 | Namespace: genny_qebench.testcoll 37 | ClientName: EncryptedPool 38 | 39 | AutoRun: 40 | - When: 41 | mongodb_setup: 42 | $eq: 43 | - single-replica-fle 44 | branch_name: 45 | $gte: v7.0 46 | -------------------------------------------------------------------------------- /src/lamplib/src/tests/test_run_tests.py: -------------------------------------------------------------------------------- 1 | import os 2 | import tempfile 3 | import shutil 4 | import unittest 5 | from unittest.mock import patch 6 | 7 | from genny.tasks import run_tests 8 | from genny import curator, cmd_runner, toolchain 9 | 10 | 11 | class TestRunTests(unittest.TestCase): 12 | def setUp(self): 13 | self.workspace_root = tempfile.mkdtemp() 14 | 15 | def cleanUp(self): 16 | shutil.rmtree(self.workspace_root) 17 | 18 | @patch.object(curator, "poplar_grpc", spec=curator.poplar_grpc, name="poplar") 19 | @patch.object(toolchain, "toolchain_info", spec=toolchain.toolchain_info, name="toolchain") 20 | @patch.object(cmd_runner, "run_command", spec=cmd_runner.run_command, name="cmd_runner") 21 | def test_cmake_test(self, mock_run_command, mock_toolchain, mock_poplar_grpc): 22 | expected_file = os.path.join(self.workspace_root, "build", "XUnitXML", "sentinel.junit.xml") 23 | 24 | def fail(cmd, cwd, env, capture, check): 25 | return cmd_runner.RunCommandOutput(returncode=1, stdout=[], stderr=[]) 26 | 27 | def succeed(cmd, cwd, env, capture, check): 28 | return cmd_runner.RunCommandOutput(returncode=0, stdout=[], stderr=[]) 29 | 30 | mock_run_command.side_effect = fail 31 | run_tests.cmake_test(genny_repo_root=".", workspace_root=self.workspace_root) 32 | assert os.path.isfile(expected_file), f"{expected_file} must exist" 33 | 34 | mock_run_command.side_effect = succeed 35 | run_tests.cmake_test(genny_repo_root=".", workspace_root=self.workspace_root) 36 | self.assertFalse(os.path.isfile(expected_file)) 37 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # DevProd Performance Infrastructure Team 2 | # Operates through the DEVPROD Jira board. 3 | # @mongodb/devprod-performance-infrastructure 4 | 5 | # Product Performance Team 6 | # Operates through the PERF Jira board. 7 | # @mongodb/performance 8 | 9 | # DevProd Performance Infrastructure owns unowned files. Files that are 10 | # explicitly owned by Performance Infrastructure should be added to this file 11 | # too. 12 | * @mongodb/devprod-performance-infrastructure 13 | 14 | 15 | # Repository Configuration 16 | /.gitignore @mongodb/devprod-performance-infrastructure james.littlejohn@mongodb.com 17 | /.github @mongodb/devprod-performance-infrastructure james.littlejohn@mongodb.com 18 | /.vscode @mongodb/devprod-performance-infrastructure james.littlejohn@mongodb.com 19 | 20 | # Workload Configuration 21 | /src/workloads @mongodb/performance 22 | /src/phases @mongodb/performance 23 | # There is a list of workloads in this file that needs to be kept up to date 24 | src/lamplib/src/genny/tasks/dry_run.py @mongodb/performance 25 | 26 | 27 | # Genny Core Components 28 | /cmake @mongodb/devprod-performance-infrastructure 29 | /poetry.lock @mongodb/devprod-performance-infrastructure 30 | /pyproject.toml @mongodb/devprod-performance-infrastructure 31 | 32 | # Workload-related C++ Components 33 | /src/value_generators @mongodb/performance @mongodb/devprod-performance-infrastructure 34 | 35 | # Generated files owned by nobody that don't require review. These files are 36 | # modifiable without review by anybody with write access to the repository. 37 | /docs/generated/**.md -------------------------------------------------------------------------------- /src/driver/test/ProgramOptions_test.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | #include 18 | 19 | TEST_CASE("ProgramOptions behavior") { 20 | SECTION("missing subcommand") { 21 | const char* argv[] = {"run-genny"}; 22 | auto opts = genny::driver::DefaultDriver::ProgramOptions(1, (char**)argv); 23 | REQUIRE(opts.parseOutcome == genny::driver::DefaultDriver::OutcomeCode::kUserException); 24 | } 25 | 26 | SECTION("invalid subcommand") { 27 | const char* argv[] = {"run-genny", "use-postgresql"}; 28 | auto opts = genny::driver::DefaultDriver::ProgramOptions(2, (char**)argv); 29 | REQUIRE(opts.parseOutcome == genny::driver::DefaultDriver::OutcomeCode::kUserException); 30 | } 31 | 32 | SECTION("valid subcommand") { 33 | const char* argv[] = {"run-genny", "dry-run"}; 34 | auto opts = genny::driver::DefaultDriver::ProgramOptions(2, (char**)argv); 35 | REQUIRE(opts.parseOutcome == genny::driver::DefaultDriver::OutcomeCode::kSuccess); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/testlib/test/helpers_test.cpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | namespace { 18 | 19 | TEST_CASE("MultiLineRegexMatch") { 20 | std::string actual = R"( 21 | /Users/rtimmons/Projects/genny/src/cast_core/src/CrudActor.cpp(244): Throw in function void (anonymous namespace)::BaseOperation::doBlock(metrics::Operation &, F &&) [F = (lambda at /Users/rtimmons/Projects/genny/src/cast_core/src/CrudActor.cpp:346:35)] 22 | Dynamic exception type: boost::exception_detail::clone_impl 23 | std::exception::what: std::exception 24 | [genny::InfoObject*] = { } 25 | [genny::ServerResponse*] = { "nInserted" : 0, "nMatched" : 0, "nModified" : 0, "nRemoved" : 0, "nUpserted" : 0, "writeErrors" : [ { "index" : 0, "code" : 11000, "errmsg" : "E11000 duplicate key error collection: mydb.test index: a_1 dup key: { : 100 }" } ] } 26 | [genny::Message*] = 27 | )"; 28 | SECTION("Simple match") { 29 | std::string rex = ".*duplicate key error.*"; 30 | REQUIRE_THAT(actual, genny::MultiLineRegexMatch(rex)); 31 | } 32 | } 33 | 34 | } // namespace 35 | -------------------------------------------------------------------------------- /src/workloads/contrib/qe_test_gen/qe_test_gen/templates/update_phase.jinja2: -------------------------------------------------------------------------------- 1 | - Repeat: <> 2 | Collection: {^Parameter: {Name: "Collection", Default: "<>"}} 3 | MetricsName: "update" 4 | InitialStates: 5 | {% for query in ctx.queries %} 6 | {% set outer_loop = loop %} 7 | {% for update in ctx.updates %} 8 | - State: State_<>_<> 9 | Weight: 1 10 | {% endfor %} 11 | {% endfor %} 12 | StateTransitions: &transitions 13 | {% for query in ctx.queries %} 14 | {% set outer_loop = loop %} 15 | {% for update in ctx.updates %} 16 | - To: "State_<>_<>" 17 | Weight: 1 18 | SleepBefore: {^TimeSpec: {value: 0}} 19 | {% endfor %} 20 | {% endfor %} 21 | States: 22 | {% for query in ctx.queries %} 23 | {% set outer_loop = loop %} 24 | {% for update in ctx.updates %} 25 | - Name: State_<>_<> 26 | Operations: 27 | - OperationName: updateOne 28 | OperationMetricsName: updates 29 | OperationCommand: 30 | Filter: 31 | {% if query[1] is string %} 32 | <> : <> 33 | {% else %} 34 | <> : { ^Choose: { from: <> } } 35 | {% endif %} 36 | Update: 37 | $set: 38 | {% if update[1] is string %} 39 | <> : <> 40 | {% else %} 41 | <> : { ^Choose: { from: <> } } 42 | {% endif %} 43 | Transitions: *transitions 44 | {% endfor %} 45 | {% endfor %} -------------------------------------------------------------------------------- /src/workloads/replication/startup/3_0_Reads.yml: -------------------------------------------------------------------------------- 1 | SchemaVersion: 2018-07-01 2 | Owner: Replication 3 | Description: | 4 | Issues dummy reads against both databases used in the light and the heavy phases. 5 | To know more about the test phases please refer to 'src/workloads/replication/startup/README.md'. 6 | 7 | Keywords: 8 | - startup 9 | - reads 10 | 11 | Clients: 12 | Default: 13 | QueryOptions: 14 | maxPoolSize: 300 15 | 16 | GlobalDefaults: 17 | - NumPhases: &max_phase 1 18 | # Should match values in 'src/workloads/replication/startup/1_0_5GB.yml' 19 | - Database1: &database1 "startup_5GB" 20 | - CollectionCount1: &collectionCount1 5 21 | # Should match values in 'src/workloads/replication/startup/2_0_50GB.yml' 22 | - Database2: &database2 "startup_50GB" 23 | - CollectionCount2: &collectionCount2 10000 24 | 25 | Actors: 26 | - ReadOperationsDB1: 27 | LoadConfig: 28 | Path: "../../../phases/replication/startup/StartupPhasesTemplate.yml" 29 | Key: ReadOperationsTemplate 30 | Parameters: 31 | active: [0] 32 | nopInPhasesUpTo: *max_phase 33 | database: *database1 34 | collectionCount: *collectionCount1 35 | numOfCollectionsTargeted: *collectionCount1 36 | numOfReadOpsPerCollection: 1000 37 | 38 | - ReadOperationsDB2: 39 | LoadConfig: 40 | Path: "../../../phases/replication/startup/StartupPhasesTemplate.yml" 41 | Key: ReadOperationsTemplate 42 | Parameters: 43 | active: [1] 44 | nopInPhasesUpTo: *max_phase 45 | database: *database2 46 | collectionCount: *collectionCount2 47 | numOfCollectionsTargeted: 50 48 | numOfReadOpsPerCollection: 1000 49 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2019-present MongoDB Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | add_subdirectory(third_party) 16 | 17 | # keep in alpha order 18 | add_subdirectory(canaries) 19 | add_subdirectory(cast_core) 20 | add_subdirectory(driver) 21 | add_subdirectory(gennylib) 22 | add_subdirectory(metrics) 23 | add_subdirectory(phases) 24 | add_subdirectory(testlib) 25 | add_subdirectory(value_generators) 26 | add_subdirectory(workloads) 27 | 28 | # This makes the project importable from the build directory 29 | export(TARGETS value_generators metrics gennylib loki cast_core poplarlib 30 | FILE GennyLibraryConfig.cmake) 31 | 32 | # Below generates a cmake module so if you make install from this 33 | # project you can find_package(GennyLib) in another cmake project. 34 | # 35 | # Please don't build any projects that link against gennylib outside of 36 | # this repository please. Not yet. We need to think of a good ABI. 37 | # We're only exposing external cmake bindings because it encourages 38 | # best-practices and helps keep the codebase honest about what it 39 | # exports and how it's used. 40 | install(EXPORT GennyLibraryConfig DESTINATION share/GennyLibrary/cmake) 41 | -------------------------------------------------------------------------------- /src/cast_core/include/cast_core/actors/ExternalScriptRunner.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2022-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef HEADER_25AE844D_6E55_42EB_9E93_56C7CB727F54_INCLUDED 16 | #define HEADER_25AE844D_6E55_42EB_9E93_56C7CB727F54_INCLUDED 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | namespace genny::actor { 30 | 31 | /** 32 | * 33 | * Owner: 10gen/query 34 | */ 35 | class ExternalScriptRunner : public Actor { 36 | 37 | 38 | public: 39 | 40 | explicit ExternalScriptRunner(ActorContext& context); 41 | ~ExternalScriptRunner() = default; 42 | 43 | void run() override; 44 | 45 | static std::string_view defaultName() { 46 | return "ExternalScriptRunner"; 47 | } 48 | 49 | private: 50 | 51 | /** @private */ 52 | struct PhaseConfig; 53 | PhaseLoop _loop; 54 | std::string _command; 55 | }; 56 | 57 | } // namespace genny::actor 58 | 59 | #endif // HEADER_25AE844D_6E55_42EB_9E93_56C7CB727F54_INCLUDED 60 | -------------------------------------------------------------------------------- /src/cast_core/include/cast_core/actors/Insert.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef HEADER_C7F4E568_590C_4D4D_B46F_766447E6AE31_INCLUDED 16 | #define HEADER_C7F4E568_590C_4D4D_B46F_766447E6AE31_INCLUDED 17 | 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | namespace genny::actor { 30 | 31 | /** 32 | * Owner: product-perf 33 | */ 34 | class Insert : public genny::Actor { 35 | 36 | public: 37 | explicit Insert(ActorContext& context); 38 | ~Insert() override = default; 39 | 40 | static std::string_view defaultName() { 41 | return "Insert"; 42 | } 43 | void run() override; 44 | 45 | private: 46 | mongocxx::pool::entry _client; 47 | metrics::Operation _insert; 48 | 49 | /** @private */ 50 | struct PhaseConfig; 51 | PhaseLoop _loop; 52 | }; 53 | 54 | } // namespace genny::actor 55 | 56 | #endif // HEADER_C7F4E568_590C_4D4D_B46F_766447E6AE31_INCLUDED 57 | -------------------------------------------------------------------------------- /src/cast_core/include/cast_core/actors/Deleter.hpp: -------------------------------------------------------------------------------- 1 | // Copyright 2019-present MongoDB Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef HEADER_988DA49D_0805_48D9_BEE8_AC72016F9E4D_INCLUDED 16 | #define HEADER_988DA49D_0805_48D9_BEE8_AC72016F9E4D_INCLUDED 17 | 18 | #include 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace genny::actor { 29 | 30 | /** 31 | * This actor will delete documents from the collection it 32 | * it tasked with. 33 | * 34 | * Example yaml can be found at src/workloads/docs/Deleter.yml 35 | * 36 | * Owner: Storage Engines 37 | */ 38 | class Deleter : public Actor { 39 | public: 40 | explicit Deleter(ActorContext& context); 41 | ~Deleter() = default; 42 | void run() override; 43 | 44 | static std::string_view defaultName() { 45 | return "Deleter"; 46 | } 47 | 48 | private: 49 | mongocxx::pool::entry _client; 50 | /** @private */ 51 | struct PhaseConfig; 52 | PhaseLoop _loop; 53 | }; 54 | 55 | } // namespace genny::actor 56 | 57 | #endif // HEADER_988DA49D_0805_48D9_BEE8_AC72016F9E4D_INCLUDED 58 | --------------------------------------------------------------------------------