Skip to content

Commit b2d2307

Browse files
author
Tim Middleton
authored
Initial perf tests (#120)
* Initial perf tests * Fix workflow * Updates to perf tests * Configure timeout * Reduce cache size * more minor updates to output results * output results * Output to file * Minor
1 parent 8dec44a commit b2d2307

File tree

6 files changed

+624
-10
lines changed

6 files changed

+624
-10
lines changed

.github/workflows/build-compatability-v1-1412.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
fail-fast: false
2424
matrix:
2525
coherenceVersion:
26-
- 14.1.2-0-1
26+
- 14.1.2-0-2
2727
- 14.1.2-0-2-SNAPSHOT
2828
go-version:
2929
- 1.23.x

.github/workflows/build-perf.yaml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Copyright 2022, 2025 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at
3+
# https://oss.oracle.com/licenses/upl.
4+
5+
# ---------------------------------------------------------------------------
6+
# Coherence Go Client GitHub Actions CI Perf Tests
7+
# ---------------------------------------------------------------------------
8+
name: CI Perf Tests
9+
10+
on:
11+
workflow_dispatch:
12+
push:
13+
branches-ignore:
14+
- gh-pages
15+
schedule:
16+
# Every day at midnight
17+
- cron: '0 0 * * *'
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
coherenceVersion:
26+
- 14.1.2-0-2
27+
- 25.03.1
28+
go-version:
29+
- 1.23.x
30+
- 1.24.x
31+
32+
33+
# Checkout the source, we need a depth of zero to fetch all of the history otherwise
34+
# the copyright check cannot work out the date of the files from Git.
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
fetch-depth: 0
39+
40+
- name: Set up JDK
41+
uses: actions/setup-java@v4
42+
with:
43+
java-version: '17'
44+
distribution: 'zulu'
45+
46+
- name: Cache Go Modules
47+
uses: actions/cache@v4
48+
with:
49+
path: ~/go/pkg/mod
50+
key: ${{ runner.os }}-go-mods-${{ hashFiles('**/go.sum') }}
51+
restore-keys: |
52+
${{ runner.os }}-go-mods-
53+
54+
- name: Cache Maven packages
55+
uses: actions/cache@v4
56+
with:
57+
path: ~/.m2
58+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
59+
restore-keys: ${{ runner.os }}-m2
60+
61+
- name: Set up Go
62+
uses: actions/setup-go@v5
63+
with:
64+
go-version: '${{ matrix.go-version }}'
65+
66+
- name: Run Perf Test
67+
shell: bash
68+
run: |
69+
curl -sL https://raw.githubusercontent.com/oracle/coherence-cli/main/scripts/install.sh | bash
70+
COHERENCE_CLIENT_REQUEST_TIMEOUT=200000 COHERENCE_VERSION=${{ matrix.coherenceVersion }} make test-perf
71+
72+
- uses: actions/upload-artifact@v4
73+
if: failure()
74+
with:
75+
name: test-output-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
76+
path: build/_output/test-logs
77+
78+
- uses: actions/upload-artifact@v4
79+
with:
80+
name: test-result-${{ matrix.go-version }}-${{ matrix.coherenceVersion }}
81+
path: test/e2e/perf/results.txt

Makefile

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ MVN_VERSION ?= 1.0.0
3434
SHELL := /bin/bash
3535

3636
# Coherence CE version to run base tests against
37-
COHERENCE_VERSION ?= 22.06.11
37+
COHERENCE_VERSION ?= 22.06.12
3838
COHERENCE_GROUP_ID ?= com.oracle.coherence.ce
3939
COHERENCE_WKA1 ?= server1
4040
COHERENCE_WKA2 ?= server1
@@ -207,8 +207,8 @@ golangci: $(TOOLS_BIN)/golangci-lint ## Go code review
207207
.PHONY: generate-proto
208208
generate-proto: $(TOOLS_BIN)/protoc ## Generate Proto Files
209209
mkdir -p $(PROTO_DIR) || true
210-
curl -o $(PROTO_DIR)/services.proto https://raw.githubusercontent.com/oracle/coherence/22.06.11/prj/coherence-grpc/src/main/proto/services.proto
211-
curl -o $(PROTO_DIR)/messages.proto https://raw.githubusercontent.com/oracle/coherence/22.06.11/prj/coherence-grpc/src/main/proto/messages.proto
210+
curl -o $(PROTO_DIR)/services.proto https://raw.githubusercontent.com/oracle/coherence/22.06.12/prj/coherence-grpc/src/main/proto/services.proto
211+
curl -o $(PROTO_DIR)/messages.proto https://raw.githubusercontent.com/oracle/coherence/22.06.12/prj/coherence-grpc/src/main/proto/messages.proto
212212
echo "" >> $(PROTO_DIR)/services.proto
213213
echo "" >> $(PROTO_DIR)/messages.proto
214214
echo 'option go_package = "github.com/oracle/coherence-go-client/proto";' >> $(PROTO_DIR)/services.proto
@@ -221,11 +221,11 @@ generate-proto: $(TOOLS_BIN)/protoc ## Generate Proto Files
221221
.PHONY: generate-proto-v1
222222
generate-proto-v1: $(TOOLS_BIN)/protoc ## Generate Proto Files v1
223223
mkdir -p $(PROTOV1_DIR) || true
224-
curl -o $(PROTOV1_DIR)/proxy_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03/prj/coherence-grpc/src/main/proto/proxy_service_messages_v1.proto
225-
curl -o $(PROTOV1_DIR)/proxy_service_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03/prj/coherence-grpc/src/main/proto/proxy_service_v1.proto
226-
curl -o $(PROTOV1_DIR)/common_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03/prj/coherence-grpc/src/main/proto/common_messages_v1.proto
227-
curl -o $(PROTOV1_DIR)/cache_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03/prj/coherence-grpc/src/main/proto/cache_service_messages_v1.proto
228-
curl -o $(PROTOV1_DIR)/queue_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03/prj/coherence-grpc/src/main/proto/queue_service_messages_v1.proto
224+
curl -o $(PROTOV1_DIR)/proxy_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03.1/prj/coherence-grpc/src/main/proto/proxy_service_messages_v1.proto
225+
curl -o $(PROTOV1_DIR)/proxy_service_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03.1/prj/coherence-grpc/src/main/proto/proxy_service_v1.proto
226+
curl -o $(PROTOV1_DIR)/common_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03.1/prj/coherence-grpc/src/main/proto/common_messages_v1.proto
227+
curl -o $(PROTOV1_DIR)/cache_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03.1/prj/coherence-grpc/src/main/proto/cache_service_messages_v1.proto
228+
curl -o $(PROTOV1_DIR)/queue_service_messages_v1.proto https://raw.githubusercontent.com/oracle/coherence/25.03.1/prj/coherence-grpc/src/main/proto/queue_service_messages_v1.proto
229229
echo "" >> $(PROTOV1_DIR)/proxy_service_messages_v1.proto
230230
echo "" >> $(PROTOV1_DIR)/proxy_service_v1.proto
231231
echo "" >> $(PROTOV1_DIR)/common_messages_v1.proto
@@ -389,6 +389,19 @@ test-discovery: test-clean gotestsum $(BUILD_PROPS) ## Run Discovery tests with
389389
-- $(GO_TEST_FLAGS) -v ./test/e2e/discovery/...
390390
make test-coherence-shutdown
391391

392+
# ----------------------------------------------------------------------------------------------------------------------
393+
# Executes the Go perf tests for standalone Coherence
394+
# ----------------------------------------------------------------------------------------------------------------------
395+
.PHONY: test-perf
396+
test-perf: test-clean gotestsum $(BUILD_PROPS) ## Run Discovery tests with Coherence
397+
./scripts/perf-cluster.sh $(TEST_LOGS_DIR)/cli $(COHERENCE_VERSION) stop || true
398+
mkdir -p $(TEST_LOGS_DIR)/cli
399+
./scripts/perf-cluster.sh $(TEST_LOGS_DIR)/cli $(COHERENCE_VERSION) start
400+
CGO_ENABLED=0 $(GOTESTSUM) --format testname --junitfile $(TEST_LOGS_DIR)/cohctl-test-perf.xml \
401+
-- $(GO_TEST_FLAGS) -v ./test/e2e/perf/...
402+
./scripts/perf-cluster.sh $(TEST_LOGS_DIR)/cli $(COHERENCE_VERSION) stop || true
403+
rm -rf $(TEST_LOGS_DIR)/cli/*
404+
392405
# ----------------------------------------------------------------------------------------------------------------------
393406
# Executes the Go resolver tests for standalone Coherence
394407
# ----------------------------------------------------------------------------------------------------------------------
@@ -413,7 +426,7 @@ test-resolver-cluster: test-clean gotestsum $(BUILD_PROPS) ## Run Resolver tests
413426
# ----------------------------------------------------------------------------------------------------------------------
414427
$(TOOLS_BIN)/golangci-lint:
415428
@mkdir -p $(TOOLS_BIN)
416-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN) v1.61.0
429+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN) v1.64.8
417430

418431

419432
# ----------------------------------------------------------------------------------------------------------------------

scripts/perf-cluster.sh

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
#!/bin/bash
2+
3+
#
4+
# Copyright (c) 2025 Oracle and/or its affiliates.
5+
# Licensed under the Universal Permissive License v 1.0 as shown at
6+
# https://oss.oracle.com/licenses/upl.
7+
#
8+
9+
# Run Performance Test
10+
# environment variables COM accepted
11+
# Arguments:
12+
# 1 - directory for cohctl config
13+
# 2 - coherence version
14+
# 3 - start or stop
15+
pwd
16+
17+
if [ $# -ne 3 ] ; then
18+
echo "Usage: $0 directory Coherence-Version [start|stop]"
19+
exit
20+
fi
21+
22+
CONFIG_DIR=$1
23+
VERSION=$2
24+
COMMAND=$3
25+
26+
if [ ! -d $CONFIG_DIR ]; then
27+
echo "${CONFIG_DIR} is not a directory"
28+
exit 1
29+
fi
30+
31+
DIR=`pwd`
32+
OUTPUT=`mktemp`
33+
34+
mkdir -p ${CONFIG_DIR}
35+
trap "rm -rf ${OUTPUT}" EXIT SIGINT
36+
37+
echo
38+
echo "Config Dir: ${CONFIG_DIR}"
39+
echo "Version: ${VERSION}"
40+
echo "Commercial: ${COM}"
41+
echo
42+
43+
type cohctl
44+
ret=$?
45+
if [ $ret -ne 0 ]; then
46+
echo "cohctl must be in path"
47+
exit 1
48+
fi
49+
50+
# Build the Java project so we get any deps downloaded
51+
52+
COHERENCE_GROUP_ID=com.oracle.coherence.ce
53+
if [ ! -z "$COM" ] ; then
54+
COHERENCE_GROUP_ID=com.oracle.coherence
55+
fi
56+
57+
# Default command
58+
COHCTL="cohctl --config-dir ${CONFIG_DIR}"
59+
60+
function pause() {
61+
echo "sleeping..."
62+
sleep 5
63+
}
64+
65+
function message() {
66+
echo "========================================================="
67+
echo "$*"
68+
}
69+
70+
function save_logs() {
71+
mkdir -p build/_output/test-logs
72+
cp ${CONFIG_DIR}/logs/local/*.log build/_output/test-logs || true
73+
}
74+
75+
function runCommand() {
76+
echo "========================================================="
77+
echo "Running command: cohctl $*"
78+
$COHCTL $* > $OUTPUT 2>&1
79+
ret=$?
80+
cat $OUTPUT
81+
if [ $ret -ne 0 ] ; then
82+
echo "Command failed"
83+
# copy the log files
84+
save_logs
85+
exit 1
86+
fi
87+
}
88+
89+
runCommand version
90+
runCommand set debug on
91+
92+
if [ "${COMMAND}" == "start" ]; then
93+
# Create a cluster
94+
message "Create Cluster"
95+
runCommand create cluster local -y -v $VERSION $COM -S com.tangosol.net.Coherence -a coherence-grpc,coherence-grpc-proxy --machine machine1 -M 2g
96+
runCommand monitor health -n localhost:7574 -I -T 120 -w
97+
elif [ "${COMMAND}" == "stop" ]; then
98+
runCommand stop cluster local -y
99+
runCommand remove cluster local -y
100+
elif [ "${COMMAND}" == "status" ]; then
101+
runCommand get members
102+
else
103+
echo "Invalid command ${COMMAND}"
104+
exit 1
105+
fi

0 commit comments

Comments
 (0)