-
Notifications
You must be signed in to change notification settings - Fork 443
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1309 from FabianKramm/main
chore: improve load-test
- Loading branch information
Showing
10 changed files
with
249 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mysql | ||
spec: | ||
ports: | ||
- port: 3306 | ||
selector: | ||
app: mysql | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: mysql | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: mysql | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: mysql | ||
spec: | ||
containers: | ||
- image: mysql:8 | ||
name: mysql | ||
args: | ||
- "--default-authentication-plugin=mysql_native_password" | ||
env: | ||
# Use secret in real usage | ||
- name: MYSQL_ROOT_PASSWORD | ||
value: my-password | ||
- name: MYSQL_DATABASE | ||
value: k3s | ||
volumeMounts: | ||
- name: mysql-persistent-storage | ||
mountPath: /var/lib/mysql | ||
volumes: | ||
- name: mysql-persistent-storage | ||
persistentVolumeClaim: | ||
claimName: mysql-pv-claim | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: mysql-pv-claim | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 10Gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
syncer: | ||
resources: | ||
limits: | ||
cpu: "0" | ||
memory: "0" | ||
requests: | ||
cpu: "0" | ||
memory: "0" | ||
|
||
vcluster: | ||
env: | ||
- name: K3S_DATASTORE_ENDPOINT | ||
value: mysql://root:my-password@tcp(mysql:3306)/k3s | ||
resources: | ||
limits: | ||
cpu: "0" | ||
memory: "0" | ||
requests: | ||
cpu: "0" | ||
memory: "0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
syncer: | ||
resources: | ||
limits: | ||
cpu: "0" | ||
memory: "0" | ||
requests: | ||
cpu: "0" | ||
memory: "0" | ||
|
||
vcluster: | ||
resources: | ||
limits: | ||
cpu: "0" | ||
memory: "0" | ||
requests: | ||
cpu: "0" | ||
memory: "0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
syncer: | ||
resources: | ||
limits: | ||
cpu: "0" | ||
memory: "0" | ||
requests: | ||
cpu: "0" | ||
memory: "0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package stopwatch | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/go-logr/logr" | ||
) | ||
|
||
func New(logger logr.Logger) *StopWatch { | ||
return &StopWatch{ | ||
logger: logger, | ||
lastTime: time.Now(), | ||
} | ||
} | ||
|
||
type StopWatch struct { | ||
logger logr.Logger | ||
|
||
lastTime time.Time | ||
} | ||
|
||
func (s *StopWatch) Reset() { | ||
s.lastTime = time.Now() | ||
} | ||
|
||
func (s *StopWatch) Stop(msg string, keysAndValues ...interface{}) { | ||
elapsed := time.Since(s.lastTime) | ||
s.logger.Info(msg, append([]interface{}{"elapsed", elapsed}, keysAndValues...)...) | ||
s.lastTime = time.Now() | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.