#Benchmark testing of Channel Client
This benchmark test has 1 valid call of Channel Client's Execute() function
Under the directory where this file resides, the test commands are run as shown under the below comments:
(
* Benchmark is using Go's test command with -bench=Call* (or CallExecuteTx* or CallQuery*)
* the -run=notest flag means execute a non-existant 'notest' in the current folder
This will avoid running normal unit tests along with the benchmarks
* by default, the benchmark tool decides when it collected enough information and stops
* the use of -benchtime=XXs forces the benchmark to keep executing until this time has elapsed
This allows the tool to run for longer times and collect more accurate information for larger execution loads
* the benchmark output format is as follows:
benchmarkname [logs from benchamark tests-They have removed from the example commands below] NbOfOperationExecutions TimeInNanoSeconds/OperationExecuted MemoryAllocated/OperationExecuted NbOfAllocations/OperationExecuted
Example from below commands:
BenchmarkExecuteTx-8 [logs removed] 100000 164854 ns/op 5743056 B/op 50449 allocs/op
* the command output also shows the environment and the package used for the benchmark exection:
goos: darwin
goarch: amd64
pkg: github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel
UPDATE: there are now 2 benchmarks in this file, the first being the original one which runs with sequential executions and the second makes use of
parallel client executions to simulate simultanous calls from the client (command line outputs below are updated to reflect these two calls).
- To run the parallel test use -bench=ExecuteTxParallel
- to run all benchmarks use -bench=* or -bench=ExecuteTx*
NOTE: Since the peers/orderers are mocked and running in the same process as the benchmark's, the perf data for this benchmark includes info for both
the benchmark and the mocked servers which decreases the overall performance results. To get exact performance data for this channel client of the Go SDK,
one needs to run benchmarks against a real Fabric network with peers and orderers running in Docker containers.
NOTE 2: The SDK config file must contain Fabric's perf configs in order to enable metrics collections. See this file for an example:
test/fixtures/config/config_test.yaml
NOTE 3: With the update to Fabric's metrics API, new metrics are automatically added when running the benchmark (without any additional setup).
These are found in the statsd package and will show up in the Prometheus report as well:
internal/github.com/hyperledger/fabric/common/metrics/statsd/goruntime/collector.go
Final Note: Performance collection using the Metrics performance tool (see section below) now requires the SDK to be built with the pprof tag.
This means in order to collect metrics data via the Prometheus report, the below sample commands were updated to include `-tags pprof`
)
##### - Benchmark command examples:
$ go test -tags pprof -run=notest -bench=Call*
goos: darwin
goarch: amd64
pkg: github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel
BenchmarkCallExecuteTx-8 1000 1261314 ns/op 208093 B/op 3037 allocs/op
BenchmarkCallQuery-8 2000 975568 ns/op 154871 B/op 2429 allocs/op
BenchmarkCallExecuteTxParallel-8 3000 444365 ns/op 208302 B/op 3019 allocs/op
BenchmarkCallQueryTxParallel-8 5000 319143 ns/op 154845 B/op 2424 allocs/op
PASS
ok github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel 6.618s
$ go test -tags pprof -run=notest -bench=Call* -benchtime=10s
goos: darwin
goarch: amd64
pkg: github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel
BenchmarkCallExecuteTx-8 10000 1319398 ns/op 208059 B/op 3038 allocs/op
BenchmarkCallQuery-8 10000 1024998 ns/op 154866 B/op 2429 allocs/op
BenchmarkCallExecuteTxParallel-8 30000 564144 ns/op 208060 B/op 3015 allocs/op
BenchmarkCallQueryTxParallel-8 50000 386486 ns/op 154849 B/op 2424 allocs/op
PASS
ok github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel 68.788s
$ go test -tags pprof -run=notest -bench=Call* -benchtime=30s
goos: darwin
goarch: amd64
pkg: github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel
BenchmarkCallExecuteTx-8 30000 1295530 ns/op 208024 B/op 3038 allocs/op
BenchmarkCallQuery-8 50000 1027276 ns/op 154858 B/op 2429 allocs/op
BenchmarkCallExecuteTxParallel-8 100000 529863 ns/op 208115 B/op 3016 allocs/op
BenchmarkCallQueryTxParallel-8 100000 380491 ns/op 154854 B/op 2424 allocs/op
PASS
ok github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel 213.246s
$ go test -tags pprof -run=notest -bench=Call* -benchtime=60s
goos: darwin
goarch: amd64
pkg: github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel
BenchmarkCallExecuteTx-8 100000 1304653 ns/op 208043 B/op 3038 allocs/op
BenchmarkCallQuery-8 100000 988127 ns/op 154850 B/op 2429 allocs/op
BenchmarkCallExecuteTxParallel-8 200000 500477 ns/op 208150 B/op 3017 allocs/op
BenchmarkCallQueryTxParallel-8 200000 360922 ns/op 154797 B/op 2424 allocs/op
PASS
ok github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel 433.668s
$ go test -tags pprof -run=notest -bench=Call* -benchtime=120s -timeout 30m
goos: darwin
goarch: amd64
pkg: github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel
BenchmarkCallExecuteTx-8 200000 1286497 ns/op 208050 B/op 3038 allocs/op
BenchmarkCallQuery-8 200000 991448 ns/op 154846 B/op 2429 allocs/op
BenchmarkCallExecuteTxParallel-8 500000 510610 ns/op 208140 B/op 3017 allocs/op
BenchmarkCallQueryTxParallel-8 500000 365202 ns/op 154773 B/op 2424 allocs/op
PASS
ok github.com/hyperledger/fabric-sdk-go/test/performance/pkg/client/channel 926.270s
###Benchmark data (using Prometheus report)
The Channel Client's Execute and Query functions have been amended to collect metric counts and time spent executing these functions.
In order to support collecting the data, make sure to start the data collector server. An example of starting a data collector server is found
in this benchmark (reference chClient.StartOperationsSystem() call)
then start the Prometheus Docker container (an example docker compose config file is found at:
fabric-sdk-go/test/performance/prometheus
)
Finally run your sdk client and the perf data will be collected by the prometheus server. Navigate to
127.0.0.1:9095
to view the report.
Make sure the Go client is running and some channel communication activity has occurred with a peer in order
to see collected performance data.
For the purpose of this channel client benchmark, once the Prometheus docker container is started, run the benchmark with long enough
run times and navigate to the address above to see data being collected
(run with -benchtime=300s will show this data on the
没有合适的资源?快使用搜索试试~ 我知道了~
此 SDK 使 Go 开发人员能够构建与 Hyperledger Fabric 交互的解决方案
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
共877个文件
go:710个
sh:38个
yaml:35个
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 185 浏览量
2023-12-20
17:25:55
上传
评论
收藏 1.53MB ZIP 举报
温馨提示
此 SDK 使 Go 开发人员能够构建与 Hyperledger Fabric 交互的解决方案。SDK 的集成测试针对三个标记的 Fabric 版本运行:prev (currently v1.4.7)。stable (currently v2.2.0)。prerelease (currently disabled)。此外,出于开发目的,集成测试还会根据需要针对可开发的 Fabric 版本运行
资源推荐
资源详情
资源评论
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 877 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/de50ac10e30e41b89db28203f97239be_qq_41701956.jpg!1)
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6828
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)