设为首页 加入收藏

TOP

Vegeta HTTP 负载测试工具(二)
2023-07-23 13:25:46 】 浏览:48
Tags:Vegeta HTTP
", URL: target, Header: headers, Body: body}} // 创建和执行 vegeta 测试 results := attacker.Attack(vegeta.NewStaticTargeter(targets...), vegeta.Rate{Freq: rate, Per: time.Second}, duration, "Load Test") // 分析结果 metrics := &vegeta.Metrics{} for res := range results { metrics.Add(res) } metrics.Close() // 打印结果 fmt.Printf("Requests: %d\n", metrics.Requests) fmt.Printf("成功率: %.2f%%\n", metrics.Success*100) fmt.Printf("最大延迟: %s\n", metrics.Latencies.Max) fmt.Printf("平均延迟: %s\n", metrics.Latencies.Mean) fmt.Printf("P95 延迟: %s\n", metrics.Latencies.P95) fmt.Printf("P99 延迟: %s\n", metrics.Latencies.P99) fmt.Printf("QPS: %.2f\n", metrics.Rate) }
首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Kubernetes 关键组件和概念(二) 下一篇Kubernetes 系列:了解 k8s 架构..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目