Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve monitor startup performance (0.38.1) #2397

Merged
merged 1 commit into from
Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions charts/hedera-mirror-monitor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ ingress:
labels: {}

livenessProbe:
failureThreshold: 5
httpGet:
path: /actuator/health/liveness
port: http
initialDelaySeconds: 150
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 2

Expand Down Expand Up @@ -264,10 +265,11 @@ rbac:
enabled: true

readinessProbe:
failureThreshold: 5
httpGet:
path: /actuator/health/readiness
port: http
initialDelaySeconds: 100
initialDelaySeconds: 60
timeoutSeconds: 2

replicas: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ Disposable publish(PublishMetrics publishMetrics) {
.retry()
.name("generate")
.metrics()
.subscribeOn(Schedulers.single())
.parallel(publishProperties.getClients())
.runOn(Schedulers.newParallel("publisher", publishProperties.getClients()))
.map(transactionPublisher::publish)
Expand All @@ -98,6 +97,7 @@ Disposable publish(PublishMetrics publishMetrics) {
.onErrorContinue((t, r) -> log.error("Unexpected error during publish flow: ", t))
.doFinally(s -> log.warn("Stopped after {} signal", s))
.doOnSubscribe(s -> log.info("Starting publisher flow"))
.subscribeOn(Schedulers.single())
.subscribe(publishMetrics::onSuccess);
}

Expand All @@ -117,6 +117,7 @@ Disposable subscribe(SubscribeMetrics subscribeMetrics) {
.onErrorContinue((t, r) -> log.error("Unexpected error during subscribe: ", t))
.doFinally(s -> log.warn("Stopped after {} signal", s))
.doOnSubscribe(s -> log.info("Starting subscribe flow"))
.subscribeOn(Schedulers.parallel())
.subscribe(subscribeMetrics::onNext);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ public class TransactionPublisher implements AutoCloseable {

private final MonitorProperties monitorProperties;
private final PublishProperties publishProperties;
private final Flux<Client> clients = Flux.defer(this::getClients).cache();
private final List<AccountId> nodeAccountIds = new CopyOnWriteArrayList<>();
private final Flux<Client> clients = Flux.defer(this::getClients).cache();
private final SecureRandom secureRandom = new SecureRandom();

@Override
Expand Down Expand Up @@ -186,8 +186,8 @@ private boolean validateNode(Client client, NodeProperties node) {
new TransferTransaction()
.addHbarTransfer(nodeAccountId, hbar)
.addHbarTransfer(client.getOperatorAccountId(), hbar.negated())
.execute(client, Duration.ofSeconds(10L))
.getReceipt(client, Duration.ofSeconds(10L));
.execute(client, Duration.ofSeconds(30L))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if you circle - move to shared constant.
Meant to say this in main before you merged.

.getReceipt(client, Duration.ofSeconds(30L));
log.info("Validated node: {}", node);
valid = true;
} catch (TimeoutException e) {
Expand Down