벤치마크 구성 파일
은 캘리퍼 벤치마크 구동에 필수적인 구성 파일 중 하나이다. 캘리퍼 내부 동작 조정에 사용되는 런타임 구성과 대조적으로, 벤치마크 구성은 벤치마크 워크로드 실행과 결과 수집에만 관련되어 있다.
참고
이론적으로, 벤치마크 구성은 System under test(SUT) 및 캘리퍼 내부 구성과 독립적이다. 하지만, 이 독립성은 오직 한 SUT 타입만 타겟으로 삼을 수 있는 벤치마크 워크로드 모듈 세부사항의 구현에 의해 제한될 수 있다.
벤치마크 구성은 세 메인 파트로 구성되어 있다. :
1. 테스트 설정
2. 옵저버 설정
3. 모니터링 설정
완전한 벤치마크 구성 예시를 보려면 맨 아래 단락을 참고하자.
참고
구성 파일은 아래 설명되는 구성을 준수하는 YAML이나 JSON 파일이 될 수 있다. 벤치마크 구성 파일 경로는
caliper-benchconfig
설정 키를 사용해 매니저와 워커 프로세스를 지정할 수 있다.
벤치마크 워크로드와 관련된 모든 설정은 test
root attribute 아래 있다. 여기에는 몇몇 일반적인 자식 attribute와, 중요한 rounds
attribute가 있다.
Attribute | Description |
---|---|
test.name | 리포트에 보여지는, 벤치마크를 가리키는 짧은 이름 |
test.description | 리포트에 보여지는, 벤치마크에 대한 설명 |
test.workers | 워커 관련 구성 객체 |
test.workers.type | 현재 사용되지 않음 |
test.workers.number | 워크로드 실행을 위해 사용되는 워커 프로세스 수 지정 |
test.rounds | 각각이 라운드 설정을 설명하는, 객체 배열 |
test.rounds[i].label | 라운드의 짧은 이름. 일반적으로 제출된 TXs(트랜잭션들)의 타입과 대응한다. |
test.rounds[i].txNumber | 캘리퍼가 라운드 동안 제출해야 하는 TXs 수 |
test.rounds[i].txDuration | 캘리퍼가 TXs를 제출할 라운드의 길이(초) |
test.rounds[i].rateControl | 라운드에서 사용하는 레이트 컨트롤러를 설명하는 객체 |
test.rounds[i].workload | 라운드에서 사용하는 워크로드 모듈을 설명하는 객체 |
위 구조를 가진 벤치마크 구성은 여러 라운드로 구성된 벤치마크 구동을 정의할 것이다. 각 라운드는 TXs 스케줄링을 담당하는 레이트 컨트롤러 및 스케줄링된 TXs의 실제 내용을 생성하는 워크로드 모듈과 짝지어져 있다.
옵저버 구성은 매니저 프로세스가 워커 프로세스들로부터 진행 정보를 수집하는 방법을 결정한다. 이 구성은 observer
attribute 아래 있다. 자세한 내용은 옵저버 구성 페이지를 참고하자.
모니터링 구성은 매니저 프로세스가 수집할 수 있는 메트릭의 종류와 수집 위치를 결정한다. 이 구성은 monitor
attribute 아래 있다. 자세한 내용은 모니터 구성 페이지를 참고하자.
아래 예시는 다음을 따른다:
init
라운드는 고정된 25 TPS 전송 비율로 500 TXs를 제출한다.init.js
워크로드 모듈로 결정된다.query
라운드는 고정된 5 TPS 전송 비율로 60초 동안 TXs를 제출한다.query.js
워크로드 모듈로 결정된다.Endorse Time (s)
를 포함해야 한다. test:
clients:
type: local
number: 5
rounds:
- label: init
txNumber: 500
rateControl:
type: fixed-rate
opts:
tps: 25
workload:
module: benchmarks/samples/fabric/marbles/init.js
- label: query
txDuration: 60
rateControl:
- type: fixed-rate
opts:
tps: 5
workload:
module: benchmarks/samples/fabric/marbles/query.js
observer:
type: prometheus
interval: 5
monitor:
interval: 1
type: ['docker', 'prometheus']
docker:
containers: ['all']
prometheus:
url: "http://prometheus:9090"
push_url: "http://pushGateway:9091"
metrics:
ignore: [prometheus, pushGateway, cadvisor, grafana, node-exporter]
include:
Endorse Time (s):
query: rate(endorser_propsal_duration_sum{chaincode="marbles:v0"}[5m])/rate(endorser_propsal_duration_count{chaincode="marbles:v0"}[5m])
step: 1
label: instance
statistic: avg
The Caliper codebase is released under the Apache 2.0 license. Any documentation developed by the Caliper Project is licensed under the Creative Commons Attribution 4.0 International License. You may obtain a copy of the license, titled CC-BY-4.0, at http://creativecommons.org/licenses/by/4.0/.