3.4. 运行 Hyperfoil 基准
使用 Hyperfoil 运行基准测试测试,以收集 Data Grid 集群的性能数据。
先决条件
- 创建 Hyperfoil Operator 订阅。
- 在 Red Hat OpenShift 上实例化 Hyperfoil Controller。
流程
创建基准测试。
$ cat > hyperfoil-benchmark.yaml<<EOF name: hotrod-benchmark hotrod: # Replace <USERNAME>:<PASSWORD> with your Data Grid credentials. # Replace <SERVICE_HOSTNAME>:<PORT> with the host name and port for Data Grid. - uri: hotrod://<USERNAME>:<PASSWORD>@<SERVICE_HOSTNAME>:<PORT> caches: # Replace <CACHE-NAME> with the name of your Data Grid cache. - <CACHE-NAME> agents: agent-1: agent-2: agent-3: agent-4: agent-5: phases: - rampupPut: increasingRate: duration: 10s initialUsersPerSec: 100 targetUsersPerSec: 200 maxSessions: 300 scenario: &put - putData: - randomInt: cacheKey <- 1 .. 40000 - randomUUID: cacheValue - hotrodRequest: # Replace <CACHE-NAME> with the name of your Data Grid cache. put: <CACHE-NAME> key: key-${cacheKey} value: value-${cacheValue} - rampupGet: increasingRate: duration: 10s initialUsersPerSec: 100 targetUsersPerSec: 200 maxSessions: 300 scenario: &get - getData: - randomInt: cacheKey <- 1 .. 40000 - randomUUID: cacheValue - hotrodRequest: # Replace <CACHE-NAME> with the name of your Data Grid cache. put: <CACHE-NAME> key: key-${cacheKey} value: value-${cacheValue} - doPut: constantRate: startAfter: rampupPut duration: 5m usersPerSec: 10000 maxSessions: 11000 scenario: *put - doGet: constantRate: startAfter: rampupGet duration: 5m usersPerSec: 40000 maxSessions: 41000 scenario: *get EOF- 在任何浏览器中打开路由来访问 Hyperfoil CLI。
上传基准测试测试。
运行
upload命令。[hyperfoil]$ upload- 点 Select baseline file,然后导航到文件系统上的基准测试测试并上传它。
运行基准测试测试。
[hyperfoil]$ run hotrod-benchmark获取基准测试测试的结果。
[hyperfoil]$ stats