use of com.hedera.services.bdd.spec.HapiSpecOperation in project hedera-services by hashgraph.
the class CreateSchedulesBeforeReconnect method runCreateSchedules.
private HapiApiSpec runCreateSchedules() {
PerfTestLoadSettings settings = new PerfTestLoadSettings(SCHEDULE_CREATION_RECONNECT_TPS, DEFAULT_MINS_FOR_RECONNECT_TESTS, DEFAULT_THREADS_FOR_RECONNECT_TESTS);
Supplier<HapiSpecOperation[]> createBurst = () -> new HapiSpecOperation[] { generateScheduleCreateOperation() };
return defaultHapiSpec("RunCreateSchedules").given(scheduleOpsEnablement(), logIt(ignore -> settings.toString()), cryptoCreate("scheduleSender").balance(initialBalance.getAsLong()).key(GENESIS).hasRetryPrecheckFrom(BUSY, DUPLICATE_TRANSACTION, PLATFORM_TRANSACTION_NOT_CREATED).deferStatusResolution(), cryptoCreate("scheduleReceiver").key(GENESIS).hasRetryPrecheckFrom(BUSY, DUPLICATE_TRANSACTION, PLATFORM_TRANSACTION_NOT_CREATED).deferStatusResolution(), sleepFor(10000), scheduleCreate("schedule-" + getHostName() + "-" + scheduleNumber.getAndIncrement(), cryptoTransfer(tinyBarsFromTo("scheduleSender", "scheduleReceiver", 1))).signedBy(DEFAULT_PAYER).fee(ONE_HUNDRED_HBARS).alsoSigningWith("scheduleSender").hasPrecheckFrom(STANDARD_PERMISSIBLE_PRECHECKS).hasAnyKnownStatus().deferStatusResolution().adminKey(DEFAULT_PAYER).noLogging().advertisingCreation()).when(fileUpdate(APP_PROPERTIES).payingWith(GENESIS).overridingProps(Map.of("ledger.schedule.txExpiryTimeSecs", "" + 60)), sleepFor(10000)).then(scheduleCreate("schedule-" + getHostName() + "-" + scheduleNumber.getAndIncrement(), cryptoTransfer(tinyBarsFromTo("scheduleSender", "scheduleReceiver", 1))).signedBy(DEFAULT_PAYER).fee(ONE_HUNDRED_HBARS).alsoSigningWith("scheduleSender").hasPrecheckFrom(STANDARD_PERMISSIBLE_PRECHECKS).hasAnyKnownStatus().deferStatusResolution().adminKey(DEFAULT_PAYER).noLogging().advertisingCreation(), defaultLoadTest(createBurst, settings));
}
use of com.hedera.services.bdd.spec.HapiSpecOperation in project hedera-services by hashgraph.
the class CreateTokensBeforeReconnect method runCreateTopics.
private HapiApiSpec runCreateTopics() {
PerfTestLoadSettings settings = new PerfTestLoadSettings(TOKEN_CREATION_RECONNECT_TPS, DEFAULT_MINS_FOR_RECONNECT_TESTS, DEFAULT_TOKEN_THREADS_FOR_RECONNECT_TESTS);
Supplier<HapiSpecOperation[]> createBurst = () -> new HapiSpecOperation[] { generateTopicCreateOperation() };
return defaultHapiSpec("RunCreateTokens").given(logIt(ignore -> settings.toString())).when().then(defaultLoadTest(createBurst, settings));
}
use of com.hedera.services.bdd.spec.HapiSpecOperation 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));
}
use of com.hedera.services.bdd.spec.HapiSpecOperation 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));
}
use of com.hedera.services.bdd.spec.HapiSpecOperation 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());
}
Aggregations