Search in sources :

Example 11 with PerfTestLoadSettings

use of com.hedera.services.bdd.suites.perf.PerfTestLoadSettings in project hedera-services by hashgraph.

the class CreateTopicsBeforeReconnect method runCreateTopics.

private HapiApiSpec runCreateTopics() {
    PerfTestLoadSettings settings = new PerfTestLoadSettings(TOPIC_CREATION_RECONNECT_TPS, DEFAULT_MINS_FOR_RECONNECT_TESTS, DEFAULT_THREADS_FOR_RECONNECT_TESTS);
    Supplier<HapiSpecOperation[]> createBurst = () -> new HapiSpecOperation[] { generateTopicCreateOperation() };
    return defaultHapiSpec("RunCreateTopics").given(logIt(ignore -> settings.toString())).when().then(defaultLoadTest(createBurst, settings));
}
Also used : UtilVerbs.logIt(com.hedera.services.bdd.spec.utilops.UtilVerbs.logIt) TxnVerbs.createTopic(com.hedera.services.bdd.spec.transactions.TxnVerbs.createTopic) PerfTestLoadSettings(com.hedera.services.bdd.suites.perf.PerfTestLoadSettings) Supplier(java.util.function.Supplier) DEFAULT_THREADS_FOR_RECONNECT_TESTS(com.hedera.services.bdd.suites.reconnect.CreateAccountsBeforeReconnect.DEFAULT_THREADS_FOR_RECONNECT_TESTS) LoadTest.defaultLoadTest(com.hedera.services.bdd.spec.utilops.LoadTest.defaultLoadTest) UtilVerbs.noOp(com.hedera.services.bdd.spec.utilops.UtilVerbs.noOp) List(java.util.List) Logger(org.apache.logging.log4j.Logger) DUPLICATE_TRANSACTION(com.hederahashgraph.api.proto.java.ResponseCodeEnum.DUPLICATE_TRANSACTION) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) DEFAULT_MINS_FOR_RECONNECT_TESTS(com.hedera.services.bdd.suites.reconnect.CreateAccountsBeforeReconnect.DEFAULT_MINS_FOR_RECONNECT_TESTS) HapiApiSpec.defaultHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) BUSY(com.hederahashgraph.api.proto.java.ResponseCodeEnum.BUSY) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) LogManager(org.apache.logging.log4j.LogManager) PLATFORM_TRANSACTION_NOT_CREATED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.PLATFORM_TRANSACTION_NOT_CREATED) PerfTestLoadSettings(com.hedera.services.bdd.suites.perf.PerfTestLoadSettings) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation)

Example 12 with PerfTestLoadSettings

use of com.hedera.services.bdd.suites.perf.PerfTestLoadSettings in project hedera-services by hashgraph.

the class SubmitMessagesForReconnect method runSubmitMessages.

private HapiApiSpec runSubmitMessages() {
    PerfTestLoadSettings settings = new PerfTestLoadSettings();
    Supplier<HapiSpecOperation[]> submitBurst = () -> new HapiSpecOperation[] { submitToTestTopic(settings) };
    return defaultHapiSpec("RunSubmitMessages").given(withOpContext((spec, ignore) -> settings.setFrom(spec.setup().ciPropertiesMap())), logIt(ignore -> settings.toString())).when().then(defaultLoadTest(submitBurst, settings));
}
Also used : UtilVerbs.withOpContext(com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext) UtilVerbs.logIt(com.hedera.services.bdd.spec.utilops.UtilVerbs.logIt) TxnVerbs.submitMessageTo(com.hedera.services.bdd.spec.transactions.TxnVerbs.submitMessageTo) PerfTestLoadSettings(com.hedera.services.bdd.suites.perf.PerfTestLoadSettings) Supplier(java.util.function.Supplier) TxnUtils.randomUtf8Bytes(com.hedera.services.bdd.spec.transactions.TxnUtils.randomUtf8Bytes) LoadTest.defaultLoadTest(com.hedera.services.bdd.spec.utilops.LoadTest.defaultLoadTest) List(java.util.List) Logger(org.apache.logging.log4j.Logger) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) HapiApiSpec.defaultHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) BUSY(com.hederahashgraph.api.proto.java.ResponseCodeEnum.BUSY) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) LogManager(org.apache.logging.log4j.LogManager) PLATFORM_TRANSACTION_NOT_CREATED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.PLATFORM_TRANSACTION_NOT_CREATED) PerfTestLoadSettings(com.hedera.services.bdd.suites.perf.PerfTestLoadSettings) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation)

Example 13 with PerfTestLoadSettings

use of com.hedera.services.bdd.suites.perf.PerfTestLoadSettings in project hedera-services by hashgraph.

the class SubmitMessageLoadTest method runSubmitMessages.

private static HapiApiSpec runSubmitMessages() {
    PerfTestLoadSettings settings = new PerfTestLoadSettings();
    final AtomicInteger submittedSoFar = new AtomicInteger(0);
    Supplier<HapiSpecOperation[]> submitBurst = () -> new HapiSpecOperation[] { opSupplier(settings).get() };
    return defaultHapiSpec("RunSubmitMessages").given(withOpContext((spec, ignore) -> settings.setFrom(spec.setup().ciPropertiesMap())), // if no pem file defined then create a new submitKey
    pemFile == null ? newKeyNamed("submitKey") : keyFromPem(pemFile).name("submitKey").simpleWacl().passphrase(KeyFactory.PEM_PASSPHRASE), // if just created a new key then export spec for later reuse
    pemFile == null ? withOpContext((spec, ignore) -> spec.keys().exportSimpleKey("topicSubmitKey.pem", "submitKey")) : sleepFor(100), logIt(ignore -> settings.toString())).when(fileUpdate(APP_PROPERTIES).payingWith(GENESIS).overridingProps(Map.of("hapi.throttling.buckets.fastOpBucket.capacity", "4000", "hapi.throttling.ops.consensusSubmitMessage.capacityRequired", "1.0")), cryptoCreate("sender").balance(ignore -> settings.getInitialBalance()).withRecharging().rechargeWindow(3).hasRetryPrecheckFrom(BUSY, DUPLICATE_TRANSACTION, PLATFORM_TRANSACTION_NOT_CREATED), topicID == null ? createTopic("topic").submitKeyName("submitKey").hasRetryPrecheckFrom(BUSY, DUPLICATE_TRANSACTION, PLATFORM_TRANSACTION_NOT_CREATED) : sleepFor(100), // wait all other thread ready
    sleepFor(10000)).then(defaultLoadTest(submitBurst, settings), getAccountBalance("sender").logged());
}
Also used : INSUFFICIENT_PAYER_BALANCE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INSUFFICIENT_PAYER_BALANCE) OK(com.hederahashgraph.api.proto.java.ResponseCodeEnum.OK) TxnVerbs.cryptoCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate) UtilVerbs.withOpContext(com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext) ArrayUtils(org.apache.commons.lang3.ArrayUtils) Random(java.util.Random) TRANSACTION_EXPIRED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.TRANSACTION_EXPIRED) TxnVerbs.createTopic(com.hedera.services.bdd.spec.transactions.TxnVerbs.createTopic) PerfTestLoadSettings(com.hedera.services.bdd.suites.perf.PerfTestLoadSettings) TxnVerbs.fileUpdate(com.hedera.services.bdd.spec.transactions.TxnVerbs.fileUpdate) Supplier(java.util.function.Supplier) ByteBuffer(java.nio.ByteBuffer) UtilVerbs.keyFromPem(com.hedera.services.bdd.spec.utilops.UtilVerbs.keyFromPem) UtilVerbs.sleepFor(com.hedera.services.bdd.spec.utilops.UtilVerbs.sleepFor) DUPLICATE_TRANSACTION(com.hederahashgraph.api.proto.java.ResponseCodeEnum.DUPLICATE_TRANSACTION) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) HapiApiSpec.defaultHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec) INVALID_TOPIC_ID(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_TOPIC_ID) MESSAGE_SIZE_TOO_LARGE(com.hederahashgraph.api.proto.java.ResponseCodeEnum.MESSAGE_SIZE_TOO_LARGE) LoadTest(com.hedera.services.bdd.spec.utilops.LoadTest) UNKNOWN(com.hederahashgraph.api.proto.java.ResponseCodeEnum.UNKNOWN) UtilVerbs.logIt(com.hedera.services.bdd.spec.utilops.UtilVerbs.logIt) UtilVerbs.newKeyNamed(com.hedera.services.bdd.spec.utilops.UtilVerbs.newKeyNamed) TxnVerbs.submitMessageTo(com.hedera.services.bdd.spec.transactions.TxnVerbs.submitMessageTo) QueryVerbs.getAccountBalance(com.hedera.services.bdd.spec.queries.QueryVerbs.getAccountBalance) Instant(java.time.Instant) SUCCESS(com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS) TxnUtils.randomUtf8Bytes(com.hedera.services.bdd.spec.transactions.TxnUtils.randomUtf8Bytes) KeyFactory(com.hedera.services.bdd.spec.keys.KeyFactory) List(java.util.List) Logger(org.apache.logging.log4j.Logger) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) BUSY(com.hederahashgraph.api.proto.java.ResponseCodeEnum.BUSY) TOPIC_EXPIRED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.TOPIC_EXPIRED) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) LogManager(org.apache.logging.log4j.LogManager) PLATFORM_TRANSACTION_NOT_CREATED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.PLATFORM_TRANSACTION_NOT_CREATED) PerfTestLoadSettings(com.hedera.services.bdd.suites.perf.PerfTestLoadSettings) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation)

Example 14 with PerfTestLoadSettings

use of com.hedera.services.bdd.suites.perf.PerfTestLoadSettings in project hedera-services by hashgraph.

the class CreateAccountsBeforeReconnect method runCreateAccounts.

private HapiApiSpec runCreateAccounts() {
    PerfTestLoadSettings settings = new PerfTestLoadSettings(ACCOUNT_CREATION_RECONNECT_TPS, DEFAULT_MINS_FOR_RECONNECT_TESTS, DEFAULT_THREADS_FOR_RECONNECT_TESTS);
    Supplier<HapiSpecOperation[]> createBurst = () -> new HapiSpecOperation[] { generateCreateAccountOperation() };
    return defaultHapiSpec("RunCreateAccounts").given(logIt(ignore -> settings.toString())).when().then(defaultLoadTest(createBurst, settings));
}
Also used : TxnVerbs.cryptoCreate(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate) UtilVerbs.logIt(com.hedera.services.bdd.spec.utilops.UtilVerbs.logIt) PerfTestLoadSettings(com.hedera.services.bdd.suites.perf.PerfTestLoadSettings) Supplier(java.util.function.Supplier) LoadTest.defaultLoadTest(com.hedera.services.bdd.spec.utilops.LoadTest.defaultLoadTest) UtilVerbs.noOp(com.hedera.services.bdd.spec.utilops.UtilVerbs.noOp) List(java.util.List) Logger(org.apache.logging.log4j.Logger) DUPLICATE_TRANSACTION(com.hederahashgraph.api.proto.java.ResponseCodeEnum.DUPLICATE_TRANSACTION) HapiApiSuite(com.hedera.services.bdd.suites.HapiApiSuite) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) HapiApiSpec.defaultHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) BUSY(com.hederahashgraph.api.proto.java.ResponseCodeEnum.BUSY) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) LogManager(org.apache.logging.log4j.LogManager) PLATFORM_TRANSACTION_NOT_CREATED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.PLATFORM_TRANSACTION_NOT_CREATED) PerfTestLoadSettings(com.hedera.services.bdd.suites.perf.PerfTestLoadSettings) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation)

Example 15 with PerfTestLoadSettings

use of com.hedera.services.bdd.suites.perf.PerfTestLoadSettings in project hedera-services by hashgraph.

the class CryptoTransferLoadTestWithInvalidAccounts method runCryptoTransfers.

protected HapiApiSpec runCryptoTransfers() {
    PerfTestLoadSettings settings = new PerfTestLoadSettings();
    Supplier<HapiSpecOperation[]> transferBurst = () -> {
        return new HapiSpecOperation[] { cryptoTransfer(tinyBarsFromTo("0.0.1000000001", "0.0.1000000002", 1L)).noLogging().signedBy(GENESIS).suppressStats(true).fee(100_000_000L).hasKnownStatusFrom(INVALID_ACCOUNT_ID).hasRetryPrecheckFrom(BUSY, PLATFORM_TRANSACTION_NOT_CREATED).deferStatusResolution() };
    };
    return defaultHapiSpec("RunCryptoTransfers").given(withOpContext((spec, ignore) -> settings.setFrom(spec.setup().ciPropertiesMap())), logIt(ignore -> settings.toString())).when().then(defaultLoadTest(transferBurst, settings));
}
Also used : LoadTest(com.hedera.services.bdd.spec.utilops.LoadTest) UtilVerbs.withOpContext(com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext) UtilVerbs.logIt(com.hedera.services.bdd.spec.utilops.UtilVerbs.logIt) TxnVerbs.cryptoTransfer(com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer) PerfTestLoadSettings(com.hedera.services.bdd.suites.perf.PerfTestLoadSettings) Supplier(java.util.function.Supplier) INVALID_ACCOUNT_ID(com.hederahashgraph.api.proto.java.ResponseCodeEnum.INVALID_ACCOUNT_ID) List(java.util.List) Logger(org.apache.logging.log4j.Logger) HapiApiSpec.defaultHapiSpec(com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec) HapiSpecOperation(com.hedera.services.bdd.spec.HapiSpecOperation) HapiCryptoTransfer.tinyBarsFromTo(com.hedera.services.bdd.spec.transactions.crypto.HapiCryptoTransfer.tinyBarsFromTo) BUSY(com.hederahashgraph.api.proto.java.ResponseCodeEnum.BUSY) HapiApiSpec(com.hedera.services.bdd.spec.HapiApiSpec) LogManager(org.apache.logging.log4j.LogManager) PLATFORM_TRANSACTION_NOT_CREATED(com.hederahashgraph.api.proto.java.ResponseCodeEnum.PLATFORM_TRANSACTION_NOT_CREATED) PerfTestLoadSettings(com.hedera.services.bdd.suites.perf.PerfTestLoadSettings)

Aggregations

HapiApiSpec (com.hedera.services.bdd.spec.HapiApiSpec)24 HapiApiSpec.defaultHapiSpec (com.hedera.services.bdd.spec.HapiApiSpec.defaultHapiSpec)24 HapiSpecOperation (com.hedera.services.bdd.spec.HapiSpecOperation)24 PerfTestLoadSettings (com.hedera.services.bdd.suites.perf.PerfTestLoadSettings)24 List (java.util.List)24 Supplier (java.util.function.Supplier)24 LogManager (org.apache.logging.log4j.LogManager)24 Logger (org.apache.logging.log4j.Logger)24 PLATFORM_TRANSACTION_NOT_CREATED (com.hederahashgraph.api.proto.java.ResponseCodeEnum.PLATFORM_TRANSACTION_NOT_CREATED)22 UtilVerbs.logIt (com.hedera.services.bdd.spec.utilops.UtilVerbs.logIt)21 BUSY (com.hederahashgraph.api.proto.java.ResponseCodeEnum.BUSY)21 UtilVerbs.withOpContext (com.hedera.services.bdd.spec.utilops.UtilVerbs.withOpContext)19 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)19 DUPLICATE_TRANSACTION (com.hederahashgraph.api.proto.java.ResponseCodeEnum.DUPLICATE_TRANSACTION)18 LoadTest (com.hedera.services.bdd.spec.utilops.LoadTest)15 TxnVerbs.cryptoCreate (com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoCreate)12 OK (com.hederahashgraph.api.proto.java.ResponseCodeEnum.OK)11 UNKNOWN (com.hederahashgraph.api.proto.java.ResponseCodeEnum.UNKNOWN)11 TxnVerbs.cryptoTransfer (com.hedera.services.bdd.spec.transactions.TxnVerbs.cryptoTransfer)10 SUCCESS (com.hederahashgraph.api.proto.java.ResponseCodeEnum.SUCCESS)10