Skip to content

Commit

Permalink
Merge pull request #933 from ayeshLK/main
Browse files Browse the repository at this point in the history
Update load-test sample with suggestions from runtime team
  • Loading branch information
ayeshLK authored Jul 22, 2024
2 parents eb28fd2 + a4f11c0 commit 30a8c77
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion load-tests/in_memory_hub/deployment/deployment-patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ spec:
- name: "in-memory-hub-deployment"
imagePullPolicy: Always
ports:
- containerPort: 9090
- containerPort: 9000
name: "port-1-in-mem"
protocol: "TCP"
4 changes: 2 additions & 2 deletions load-tests/in_memory_hub/deployment/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ metadata:
spec:
ports:
- name: "port-1-in-mem"
port: 9090
port: 9000
protocol: "TCP"
targetPort: 9090
targetPort: 9000
selector:
app: "in_memory_hub"
type: "ClusterIP"
Expand Down
Binary file modified load-tests/in_memory_hub/scripts/load_test.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions load-tests/in_memory_hub/scripts/load_test/main.bal
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ isolated function retrieveReceivedCount() returns int {
}

websub:SubscriberService subscriberService = @websub:SubscriberServiceConfig {
target: ["http://in-memory-hub-svc.default.svc.cluster.local:9090/hub", "test"],
target: ["http://in-memory-hub-svc.default.svc.cluster.local:9000/hub", "test"],
callback: "http://client-svc.default.svc.cluster.local:9100/sub",
unsubscribeOnShutdown: true,
leaseSeconds: 36000
Expand All @@ -48,7 +48,7 @@ websub:SubscriberService subscriberService = @websub:SubscriberServiceConfig {
};

public function main(string label, string output_csv_path) returns error? {
websubhub:PublisherClient publisherClient = check new("http://in-memory-hub-svc.default.svc.cluster.local:9090/hub");
websubhub:PublisherClient publisherClient = check new("http://in-memory-hub-svc.default.svc.cluster.local:9000/hub");

// register the topic
_ = check publisherClient->registerTopic("test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function syncDispatcherState() returns error? {
isNewTopic = !dispatcherClients.hasKey(topic);
}
if isNewTopic {
_ = @strand {thread: "any"} start consumeMessages(topic);
_ = start consumeMessages(topic);
}

readonly & websubhub:Subscription[]? subscribers = store:retrieveAvailableSubscriptions(topic);
Expand Down
6 changes: 3 additions & 3 deletions load-tests/in_memory_hub/src/start_hub.bal
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import ballerina/lang.runtime;

public function main() returns error? {
// Initialize the Hub
_ = @strand {thread: "any"} start dispatcher:syncDispatcherState();
_ = start dispatcher:syncDispatcherState();

websubhub:Listener hubListener = check new(9090);
websubhub:Listener hubListener = check new(9000, host = "0.0.0.0");
runtime:registerListener(hubListener);
check hubListener.attach(hubService, "hub");
check hubListener.'start();
runtime:registerListener(hubListener);
}

0 comments on commit 30a8c77

Please sign in to comment.