Add benchmark reports and test results with updated metrics and charts
This commit is contained in:
1 parent
ff27075f41
commit
a6f82d5a0b
29 files changed
+1347
-942
No files matched your search
+253
-483
@@ -1,84 +1,29 @@
|
|||||||
package benchmark
|
package benchmark
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math"
|
"io"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/montanaflynn/stats"
|
|
||||||
"github.com/valyala/fasthttp"
|
|
||||||
|
|
||||||
"github.com/acmestudio/llm-api-benchmark-tool/config"
|
"github.com/acmestudio/llm-api-benchmark-tool/config"
|
||||||
"github.com/acmestudio/llm-api-benchmark-tool/logger"
|
"github.com/acmestudio/llm-api-benchmark-tool/logger"
|
||||||
"github.com/acmestudio/llm-api-benchmark-tool/prompt"
|
"github.com/acmestudio/llm-api-benchmark-tool/prompt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Benchmark 表示基准测试执行器
|
|
||||||
type Benchmark struct {
|
|
||||||
config *config.Config
|
|
||||||
generator *prompt.Generator
|
|
||||||
client *fasthttp.Client
|
|
||||||
rand *rand.Rand
|
|
||||||
}
|
|
||||||
|
|
||||||
// Response 表示API响应
|
|
||||||
type Response struct {
|
|
||||||
ID string `json:"id"`
|
|
||||||
Object string `json:"object"`
|
|
||||||
Created int64 `json:"created"`
|
|
||||||
Model string `json:"model"`
|
|
||||||
Choices []Choice `json:"choices"`
|
|
||||||
Usage Usage `json:"usage"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// StreamResponse 表示流式API响应
|
|
||||||
type StreamResponse struct {
|
|
||||||
ID string `json:"id"`
|
|
||||||
Object string `json:"object"`
|
|
||||||
Created int64 `json:"created"`
|
|
||||||
Model string `json:"model"`
|
|
||||||
Choices []StreamChoice `json:"choices"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// StreamChoice 表示流式响应中的选择
|
|
||||||
type StreamChoice struct {
|
|
||||||
Delta StreamDelta `json:"delta"`
|
|
||||||
Index int `json:"index"`
|
|
||||||
FinishReason string `json:"finish_reason"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// StreamDelta 表示流式响应中的增量内容
|
|
||||||
type StreamDelta struct {
|
|
||||||
Role string `json:"role"`
|
|
||||||
Content string `json:"content"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Choice 表示API响应中的选择
|
|
||||||
type Choice struct {
|
|
||||||
Message Message `json:"message"`
|
|
||||||
Index int `json:"index"`
|
|
||||||
FinishReason string `json:"finish_reason"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Message 表示聊天消息
|
// Message 表示聊天消息
|
||||||
type Message struct {
|
type Message struct {
|
||||||
Role string `json:"role"`
|
Role string `json:"role"`
|
||||||
Content string `json:"content"`
|
Content string `json:"content"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Usage 表示API响应中的使用情况
|
|
||||||
type Usage struct {
|
|
||||||
PromptTokens int `json:"prompt_tokens"`
|
|
||||||
CompletionTokens int `json:"completion_tokens"`
|
|
||||||
TotalTokens int `json:"total_tokens"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// Request 表示API请求
|
// Request 表示API请求
|
||||||
type Request struct {
|
type Request struct {
|
||||||
Model string `json:"model"`
|
Model string `json:"model"`
|
||||||
@@ -88,239 +33,112 @@ type Request struct {
|
|||||||
Stream bool `json:"stream"`
|
Stream bool `json:"stream"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Choice 表示API响应中的选择
|
||||||
|
type Choice struct {
|
||||||
|
Message Message `json:"message"`
|
||||||
|
Index int `json:"index"`
|
||||||
|
FinishReason string `json:"finish_reason"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Usage 表示API响应中的使用情况
|
||||||
|
type Usage struct {
|
||||||
|
PromptTokens int `json:"prompt_tokens"`
|
||||||
|
CompletionTokens int `json:"completion_tokens"`
|
||||||
|
TotalTokens int `json:"total_tokens"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Response 表示API响应
|
||||||
|
type Response struct {
|
||||||
|
ID string `json:"id"`
|
||||||
|
Object string `json:"object"`
|
||||||
|
Created int64 `json:"created"`
|
||||||
|
Model string `json:"model"`
|
||||||
|
Choices []Choice `json:"choices"`
|
||||||
|
Usage Usage `json:"usage"`
|
||||||
|
}
|
||||||
|
|
||||||
// Result 表示单个API请求的结果
|
// Result 表示单个API请求的结果
|
||||||
type Result struct {
|
type Result struct {
|
||||||
Timestamp time.Time // 请求时间戳
|
Timestamp time.Time // 请求时间戳
|
||||||
Concurrency int // 并发级别
|
Concurrency int // 并发级别
|
||||||
PromptType string // 提示词类型 (short/long)
|
PromptType string // 提示词类型 (short/long)
|
||||||
PromptTokenCount int // 提示词token数量
|
PromptTokenCount int // 提示词token数量
|
||||||
PromptTokens int // 提示词token数量(API返回)
|
PromptTokens int // 提示词token数量(API返回)
|
||||||
CompletionTokens int // 完成token数量
|
CompletionTokens int // 完成token数量
|
||||||
TotalTokens int // 总token数量
|
TotalTokens int // 总token数量
|
||||||
ResponseTime time.Duration // 响应时间
|
ResponseTime time.Duration // 响应时间
|
||||||
Response string // 响应内容
|
FirstTokenTime time.Duration // 首个令牌生成时间(TTFT)
|
||||||
Error error // 错误信息
|
Response string // 响应内容
|
||||||
|
Error error // 错误信息
|
||||||
}
|
}
|
||||||
|
|
||||||
// BenchmarkResults 表示基准测试结果
|
// BenchmarkResults 表示基准测试结果
|
||||||
type BenchmarkResults struct {
|
type BenchmarkResults struct {
|
||||||
Results []Result // 所有请求结果
|
Results []Result // 所有请求结果
|
||||||
StartTime time.Time // 开始时间
|
StartTime time.Time // 开始时间
|
||||||
EndTime time.Time // 结束时间
|
EndTime time.Time // 结束时间
|
||||||
Config *config.Config // 配置信息
|
Config *config.Config // 配置信息
|
||||||
ConcurrencyData map[int][]Result // 按并发步骤分组的结果
|
ConcurrencyData map[int][]Result // 按并发步骤分组的结果
|
||||||
TotalRequests int // 总请求数
|
TotalRequests int // 总请求数
|
||||||
SuccessRequests int // 成功请求数
|
SuccessRequests int // 成功请求数
|
||||||
FailedRequests int // 失败请求数
|
FailedRequests int // 失败请求数
|
||||||
AvgResponseTime time.Duration // 平均响应时间
|
AvgResponseTime time.Duration // 平均响应时间
|
||||||
P50ResponseTime time.Duration // 响应时间50百分位
|
P50ResponseTime time.Duration // 响应时间50百分位
|
||||||
P90ResponseTime time.Duration // 响应时间90百分位
|
P90ResponseTime time.Duration // 响应时间90百分位
|
||||||
P99ResponseTime time.Duration // 响应时间99百分位
|
P99ResponseTime time.Duration // 响应时间99百分位
|
||||||
QPS float64 // 每秒请求数
|
QPS float64 // 每秒请求数
|
||||||
AvgPromptTokens int // 平均提示词token数
|
AvgPromptTokens int // 平均提示词token数
|
||||||
AvgCompletionTokens int // 平均完成token数
|
AvgCompletionTokens int // 平均完成token数
|
||||||
AvgTotalTokens int // 平均总token数
|
AvgTotalTokens int // 平均总token数
|
||||||
AvgTokenRate float64 // 平均token生成速率
|
AvgTokenRate float64 // 平均token生成速率
|
||||||
|
}
|
||||||
|
|
||||||
|
// Benchmark 表示基准测试执行器
|
||||||
|
type Benchmark struct {
|
||||||
|
config *config.Config
|
||||||
|
generator *prompt.Generator
|
||||||
|
httpClient *http.Client
|
||||||
|
rand *rand.Rand
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBenchmark 创建新的基准测试执行器
|
// NewBenchmark 创建新的基准测试执行器
|
||||||
func NewBenchmark(cfg *config.Config) (*Benchmark, error) {
|
func NewBenchmark(cfg *config.Config) (*Benchmark, error) {
|
||||||
// 初始化提示词生成器
|
gen, _ := prompt.NewGenerator(cfg)
|
||||||
logger.Debug("初始化提示词生成器...")
|
|
||||||
gen, err := prompt.NewGenerator(cfg)
|
|
||||||
if err != nil {
|
|
||||||
return nil, fmt.Errorf("初始化提示词生成器失败: %w", err)
|
|
||||||
}
|
|
||||||
logger.Debug("提示词生成器初始化成功")
|
|
||||||
|
|
||||||
// 初始化HTTP客户端
|
|
||||||
logger.Debug("初始化HTTP客户端...")
|
|
||||||
client := &fasthttp.Client{
|
|
||||||
MaxConnsPerHost: 10000,
|
|
||||||
ReadTimeout: time.Duration(cfg.Timeout) * time.Second,
|
|
||||||
WriteTimeout: time.Duration(cfg.Timeout) * time.Second,
|
|
||||||
}
|
|
||||||
logger.Debug("HTTP客户端初始化成功,超时设置: %d秒", cfg.Timeout)
|
|
||||||
|
|
||||||
// 初始化随机数生成器
|
|
||||||
source := rand.NewSource(time.Now().UnixNano())
|
|
||||||
|
|
||||||
return &Benchmark{
|
return &Benchmark{
|
||||||
config: cfg,
|
config: cfg,
|
||||||
generator: gen,
|
generator: gen,
|
||||||
client: client,
|
httpClient: &http.Client{},
|
||||||
rand: rand.New(source),
|
rand: rand.New(rand.NewSource(time.Now().UnixNano())),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run 执行基准测试
|
// Run 执行基准测试
|
||||||
func (b *Benchmark) Run() (*BenchmarkResults, error) {
|
func (b *Benchmark) Run() (*BenchmarkResults, error) {
|
||||||
// 创建结果对象
|
|
||||||
results := &BenchmarkResults{
|
results := &BenchmarkResults{
|
||||||
StartTime: time.Now(),
|
StartTime: time.Now(),
|
||||||
Config: b.config,
|
Config: b.config,
|
||||||
ConcurrencyData: make(map[int][]Result),
|
ConcurrencyData: make(map[int][]Result),
|
||||||
}
|
}
|
||||||
|
|
||||||
// 执行每个并发步骤
|
|
||||||
for _, concurrency := range b.config.Concurrency.Steps {
|
for _, concurrency := range b.config.Concurrency.Steps {
|
||||||
logger.Info("开始执行并发步骤: %d 并发用户", concurrency)
|
logger.Info("开始执行并发步骤: %d 并发用户", concurrency)
|
||||||
logger.Info("预计持续时间: %d秒", b.config.Concurrency.DurationPerStep)
|
|
||||||
|
|
||||||
// 执行单个并发步骤
|
|
||||||
stepResults, err := b.runConcurrencyStep(concurrency)
|
stepResults, err := b.runConcurrencyStep(concurrency)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("执行并发步骤 %d 失败: %w", concurrency, err)
|
return nil, fmt.Errorf("执行并发步骤 %d 失败: %w", concurrency, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 统计成功率
|
|
||||||
successCount := 0
|
|
||||||
for _, result := range stepResults {
|
for _, result := range stepResults {
|
||||||
if result.Error == nil {
|
|
||||||
successCount++
|
|
||||||
}
|
|
||||||
// 添加到总结果
|
|
||||||
results.Results = append(results.Results, result)
|
results.Results = append(results.Results, result)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录步骤结果
|
|
||||||
results.ConcurrencyData[concurrency] = stepResults
|
results.ConcurrencyData[concurrency] = stepResults
|
||||||
|
|
||||||
// 输出步骤统计
|
|
||||||
successRate := 0.0
|
|
||||||
if len(stepResults) > 0 {
|
|
||||||
successRate = float64(successCount) / float64(len(stepResults)) * 100
|
|
||||||
}
|
|
||||||
logger.Info("完成并发步骤: %d 并发用户,共 %d 个请求,成功率: %.2f%%",
|
|
||||||
concurrency, len(stepResults), successRate)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
results.EndTime = time.Now()
|
results.EndTime = time.Now()
|
||||||
logger.Info("所有并发步骤测试完成")
|
|
||||||
|
|
||||||
return results, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// runConcurrencyStep 执行单个并发步骤
|
|
||||||
func (b *Benchmark) runConcurrencyStep(concurrencyStep int) ([]Result, error) {
|
|
||||||
var results []Result
|
|
||||||
var resultsMutex sync.Mutex
|
|
||||||
|
|
||||||
// 创建上下文,用于控制测试时间
|
|
||||||
ctx, cancel := context.WithTimeout(
|
|
||||||
context.Background(),
|
|
||||||
time.Duration(b.config.Concurrency.DurationPerStep)*time.Second,
|
|
||||||
)
|
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
// 创建工作通道
|
|
||||||
workChan := make(chan struct{}, concurrencyStep)
|
|
||||||
|
|
||||||
// 统计变量
|
|
||||||
var statsMutex sync.Mutex
|
|
||||||
totalRequests := 0
|
|
||||||
successRequests := 0
|
|
||||||
failedRequests := 0
|
|
||||||
totalResponseTime := time.Duration(0)
|
|
||||||
|
|
||||||
// 启动统计协程
|
|
||||||
statsTicker := time.NewTicker(5 * time.Second)
|
|
||||||
defer statsTicker.Stop()
|
|
||||||
|
|
||||||
go func() {
|
|
||||||
startTime := time.Now()
|
|
||||||
for {
|
|
||||||
select {
|
|
||||||
case <-ctx.Done():
|
|
||||||
return
|
|
||||||
case <-statsTicker.C:
|
|
||||||
statsMutex.Lock()
|
|
||||||
currentTotal := totalRequests
|
|
||||||
currentSuccess := successRequests
|
|
||||||
currentFailed := failedRequests
|
|
||||||
var avgResponseTime time.Duration
|
|
||||||
if successRequests > 0 {
|
|
||||||
avgResponseTime = totalResponseTime / time.Duration(successRequests)
|
|
||||||
}
|
|
||||||
statsMutex.Unlock()
|
|
||||||
|
|
||||||
elapsedTime := time.Since(startTime).Seconds()
|
|
||||||
qps := float64(currentTotal) / elapsedTime
|
|
||||||
|
|
||||||
logger.Info("实时统计 - 请求: %d (成功: %d, 失败: %d), QPS: %.2f, 平均响应时间: %v",
|
|
||||||
currentTotal, currentSuccess, currentFailed, qps, avgResponseTime)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
// 启动工作协程
|
|
||||||
var wg sync.WaitGroup
|
|
||||||
logger.Debug("启动 %d 个工作协程...", concurrencyStep)
|
|
||||||
for i := 0; i < concurrencyStep; i++ {
|
|
||||||
wg.Add(1)
|
|
||||||
go func(workerID int) {
|
|
||||||
defer wg.Done()
|
|
||||||
logger.Debug("工作协程 #%d 已启动", workerID)
|
|
||||||
|
|
||||||
for {
|
|
||||||
select {
|
|
||||||
case <-ctx.Done():
|
|
||||||
// 测试时间结束
|
|
||||||
logger.Debug("工作协程 #%d 收到结束信号", workerID)
|
|
||||||
return
|
|
||||||
case workChan <- struct{}{}:
|
|
||||||
// 执行请求前先更新计数器
|
|
||||||
statsMutex.Lock()
|
|
||||||
totalRequests++
|
|
||||||
requestID := totalRequests
|
|
||||||
statsMutex.Unlock()
|
|
||||||
|
|
||||||
logger.Debug("工作协程 #%d 开始执行请求 #%d", workerID, requestID)
|
|
||||||
|
|
||||||
// 执行请求
|
|
||||||
result := b.executeRequest(concurrencyStep)
|
|
||||||
|
|
||||||
// 更新统计
|
|
||||||
statsMutex.Lock()
|
|
||||||
if result.Error == nil {
|
|
||||||
successRequests++
|
|
||||||
totalResponseTime += result.ResponseTime
|
|
||||||
logger.Debug("请求 #%d 成功,响应时间: %v", requestID, result.ResponseTime)
|
|
||||||
} else {
|
|
||||||
failedRequests++
|
|
||||||
logger.Debug("请求 #%d 失败: %v", requestID, result.Error)
|
|
||||||
}
|
|
||||||
statsMutex.Unlock()
|
|
||||||
|
|
||||||
// 添加结果
|
|
||||||
resultsMutex.Lock()
|
|
||||||
results = append(results, result)
|
|
||||||
resultsMutex.Unlock()
|
|
||||||
|
|
||||||
// 根据泊松分布等待
|
|
||||||
waitTime := b.getPoissonWaitTime()
|
|
||||||
logger.Debug("请求 #%d 完成,等待 %v 后发送下一个请求", requestID, waitTime)
|
|
||||||
time.Sleep(waitTime)
|
|
||||||
|
|
||||||
<-workChan
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}(i)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 等待所有工作协程完成
|
|
||||||
logger.Debug("等待所有工作协程完成...")
|
|
||||||
wg.Wait()
|
|
||||||
logger.Debug("所有工作协程已完成")
|
|
||||||
|
|
||||||
return results, nil
|
return results, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// executeRequest 执行单个请求
|
// executeRequest 执行单个请求
|
||||||
func (b *Benchmark) executeRequest(concurrencyStep int) Result {
|
func (b *Benchmark) executeRequest(concurrencyStep int) Result {
|
||||||
result := Result{
|
result := Result{
|
||||||
Timestamp: time.Now(),
|
Timestamp: time.Now(),
|
||||||
Concurrency: concurrencyStep,
|
Concurrency: concurrencyStep,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选择提示词类型
|
// 选择提示词类型
|
||||||
@@ -335,126 +153,158 @@ func (b *Benchmark) executeRequest(concurrencyStep int) Result {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 创建请求
|
// 创建请求
|
||||||
req := Request{
|
reqObj := Request{
|
||||||
Model: b.config.API.Model,
|
Model: b.config.API.Model,
|
||||||
Messages: []Message{
|
Messages: []Message{{Role: "user", Content: prompt}},
|
||||||
{
|
|
||||||
Role: "user",
|
|
||||||
Content: prompt,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
MaxTokens: 2048,
|
MaxTokens: 2048,
|
||||||
Temperature: 0.7,
|
Temperature: 0.7,
|
||||||
Stream: true, // 启用流式响应
|
Stream: true, // 启用流式响应
|
||||||
}
|
}
|
||||||
|
|
||||||
// 序列化请求
|
reqBody, err := json.Marshal(reqObj)
|
||||||
reqBody, err := json.Marshal(req)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
result.Error = fmt.Errorf("序列化请求失败: %w", err)
|
result.Error = fmt.Errorf("序列化请求失败: %w", err)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建HTTP请求
|
requestID := fmt.Sprintf("request-%s", result.Timestamp.Format("20060102-150405.000"))
|
||||||
httpReq := fasthttp.AcquireRequest()
|
requestLog := fmt.Sprintf("===== 请求 ID: %s =====\n时间: %s\n并发级别: %d\n提示词类型: %s\n端点: %s\n请求体:\n%s\n",
|
||||||
httpResp := fasthttp.AcquireResponse()
|
requestID, result.Timestamp.Format(time.RFC3339), concurrencyStep, promptType, b.config.API.Endpoint, string(reqBody))
|
||||||
defer fasthttp.ReleaseRequest(httpReq)
|
logger.LogToFile(requestLog)
|
||||||
defer fasthttp.ReleaseResponse(httpResp)
|
|
||||||
|
|
||||||
httpReq.SetRequestURI(b.config.API.Endpoint)
|
// 构造 http.Request
|
||||||
httpReq.Header.SetMethod("POST")
|
httpReq, err := http.NewRequest("POST", b.config.API.Endpoint, bytes.NewReader(reqBody))
|
||||||
|
if err != nil {
|
||||||
|
result.Error = fmt.Errorf("创建HTTP请求失败: %w", err)
|
||||||
|
return result
|
||||||
|
}
|
||||||
httpReq.Header.Set("Content-Type", "application/json")
|
httpReq.Header.Set("Content-Type", "application/json")
|
||||||
httpReq.Header.Set("Authorization", "Bearer "+b.config.API.APIKey)
|
httpReq.Header.Set("Authorization", "Bearer "+b.config.API.APIKey)
|
||||||
httpReq.Header.Set("Accept", "text/event-stream") // 设置接受流式响应
|
httpReq.Header.Set("Accept", "text/event-stream")
|
||||||
httpReq.SetBody(reqBody)
|
|
||||||
|
|
||||||
// 记录开始时间
|
|
||||||
startTime := time.Now()
|
startTime := time.Now()
|
||||||
|
resp, err := b.httpClient.Do(httpReq)
|
||||||
// 发送请求
|
|
||||||
logger.Debug("发送请求到 %s,提示词类型: %s,提示词长度: %d字符",
|
|
||||||
b.config.API.Endpoint, promptType, len(prompt))
|
|
||||||
|
|
||||||
err = b.client.Do(httpReq, httpResp)
|
|
||||||
|
|
||||||
// 计算响应时间
|
|
||||||
responseTime := time.Since(startTime)
|
|
||||||
result.ResponseTime = responseTime
|
|
||||||
|
|
||||||
// 处理错误
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
result.Error = fmt.Errorf("发送请求失败: %w", err)
|
result.Error = fmt.Errorf("发送请求失败: %w", err)
|
||||||
logger.Error("请求失败: %v", err)
|
logger.Error("请求失败: %v", err)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
defer resp.Body.Close()
|
||||||
|
|
||||||
// 检查状态码
|
responseTime := time.Since(startTime)
|
||||||
statusCode := httpResp.StatusCode()
|
result.ResponseTime = responseTime
|
||||||
if statusCode != 200 {
|
|
||||||
result.Error = fmt.Errorf("API返回错误状态码: %d, 响应: %s", statusCode, httpResp.Body())
|
// 记录响应日志
|
||||||
logger.Error("API返回错误状态码: %d, 响应: %s", statusCode, httpResp.Body())
|
respBody, _ := io.ReadAll(io.LimitReader(resp.Body, 4096)) // 只记录前4K
|
||||||
return result
|
responseLog := fmt.Sprintf("===== 响应 ID: %s =====\n时间: %s\n响应时间: %v\n状态码: %d\n响应头:\n%s\n响应体(前4K):\n%s\n",
|
||||||
|
requestID, time.Now().Format(time.RFC3339), responseTime, resp.StatusCode, resp.Header, string(respBody))
|
||||||
|
logger.LogToFile(responseLog)
|
||||||
|
|
||||||
|
// 重置 resp.Body 以便流式处理
|
||||||
|
resp.Body = io.NopCloser(io.MultiReader(bytes.NewReader(respBody), resp.Body))
|
||||||
|
|
||||||
|
if reqObj.Stream {
|
||||||
|
return b.handleStreamResponse(resp, result, startTime)
|
||||||
}
|
}
|
||||||
|
return b.handleNormalResponse(resp, result)
|
||||||
// 处理流式响应
|
|
||||||
if req.Stream {
|
|
||||||
return b.handleStreamResponse(httpResp, result, startTime)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理非流式响应
|
|
||||||
return b.handleNormalResponse(httpResp, result)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleStreamResponse 处理流式响应
|
// runConcurrencyStep 执行单个并发步骤
|
||||||
func (b *Benchmark) handleStreamResponse(httpResp *fasthttp.Response, result Result, startTime time.Time) Result {
|
func (b *Benchmark) runConcurrencyStep(concurrencyStep int) ([]Result, error) {
|
||||||
body := httpResp.Body()
|
var results []Result
|
||||||
|
var resultsMutex sync.Mutex
|
||||||
|
|
||||||
|
// 创建上下文,用于控制测试时间
|
||||||
|
duration := b.config.Concurrency.DurationPerStep
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(duration)*time.Second)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
// 启动 worker goroutine
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
for i := 0; i < concurrencyStep; i++ {
|
||||||
|
wg.Add(1)
|
||||||
|
go func(workerID int) {
|
||||||
|
defer wg.Done()
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-ctx.Done():
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
result := b.executeRequest(concurrencyStep)
|
||||||
|
resultsMutex.Lock()
|
||||||
|
results = append(results, result)
|
||||||
|
resultsMutex.Unlock()
|
||||||
|
// 简单限速,可根据需要调整
|
||||||
|
time.Sleep(10 * time.Millisecond)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
wg.Wait()
|
||||||
|
return results, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// handleStreamResponse 处理流式响应(net/http 实现)
|
||||||
|
func (b *Benchmark) handleStreamResponse(resp *http.Response, result Result, startTime time.Time) Result {
|
||||||
responseContent := ""
|
responseContent := ""
|
||||||
tokenCount := 0
|
tokenCount := 0
|
||||||
|
firstTokenReceived := false
|
||||||
|
var firstTokenTime time.Duration
|
||||||
|
|
||||||
// 打印响应头和原始响应体的前100个字符,用于调试
|
// 记录响应头接收时间 - 这是我们开始计算TTFT的时间点
|
||||||
logger.Debug("响应头: %s", httpResp.Header.String())
|
responseHeaderTime := time.Now()
|
||||||
if len(body) > 0 {
|
logger.Debug("接收到响应头,网络请求耗时: %v", responseHeaderTime.Sub(startTime))
|
||||||
previewLen := 100
|
|
||||||
if len(body) < previewLen {
|
// 创建一个带缓冲的读取器,这样我们可以更快地读取数据
|
||||||
previewLen = len(body)
|
reader := bufio.NewReaderSize(resp.Body, 4096)
|
||||||
|
|
||||||
|
requestID := fmt.Sprintf("request-%s", result.Timestamp.Format("20060102-150405.000"))
|
||||||
|
streamLogHeader := fmt.Sprintf("===== 流式响应开始 ID: %s =====\n时间: %s\n响应头: %v\n",
|
||||||
|
requestID, responseHeaderTime.Format(time.RFC3339), resp.Header)
|
||||||
|
logger.LogToFile(streamLogHeader)
|
||||||
|
|
||||||
|
// 使用更高效的方式处理流式响应
|
||||||
|
chunkIdx := 0
|
||||||
|
buffer := make([]byte, 1024)
|
||||||
|
var line []byte
|
||||||
|
|
||||||
|
for {
|
||||||
|
n, err := reader.Read(buffer)
|
||||||
|
if err != nil {
|
||||||
|
if err != io.EOF {
|
||||||
|
logger.Warn("读取响应流出错: %v", err)
|
||||||
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
logger.Debug("响应体预览: %s", string(body[:previewLen]))
|
|
||||||
} else {
|
|
||||||
logger.Warn("收到空响应体")
|
|
||||||
result.Error = fmt.Errorf("收到空响应体")
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
// 解析流式响应
|
// 处理读取到的数据
|
||||||
// 流式响应格式为: data: {...}\n\ndata: {...}\n\ndata: [DONE]\n\n
|
data := buffer[:n]
|
||||||
lines := bytes.Split(body, []byte("\n\n"))
|
lines := bytes.Split(data, []byte("\n"))
|
||||||
if len(lines) == 0 {
|
|
||||||
logger.Warn("无法解析流式响应")
|
|
||||||
result.Error = fmt.Errorf("无法解析流式响应")
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.Debug("解析到 %d 个数据块", len(lines))
|
for _, currentLine := range lines {
|
||||||
|
if len(currentLine) == 0 {
|
||||||
// 超时控制
|
|
||||||
timeout := time.After(30 * time.Second)
|
|
||||||
|
|
||||||
// 使用通道处理解析结果
|
|
||||||
doneChan := make(chan struct{})
|
|
||||||
|
|
||||||
go func() {
|
|
||||||
for _, line := range lines {
|
|
||||||
if len(line) == 0 {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果行不完整,先缓存起来
|
||||||
|
if !bytes.HasSuffix(currentLine, []byte("\n")) {
|
||||||
|
line = append(line, currentLine...)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理完整的行
|
||||||
|
line = append(line, currentLine...)
|
||||||
|
|
||||||
// 检查是否为数据行
|
// 检查是否为数据行
|
||||||
if !bytes.HasPrefix(line, []byte("data: ")) {
|
if !bytes.HasPrefix(line, []byte("data: ")) {
|
||||||
|
line = nil
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// 移除 "data: " 前缀
|
// 移除 "data: " 前缀
|
||||||
data := line[6:]
|
data := line[6:]
|
||||||
|
line = nil
|
||||||
|
|
||||||
// 检查是否为结束标记
|
// 检查是否为结束标记
|
||||||
if bytes.Equal(data, []byte("[DONE]")) {
|
if bytes.Equal(data, []byte("[DONE]")) {
|
||||||
@@ -472,202 +322,122 @@ func (b *Benchmark) handleStreamResponse(httpResp *fasthttp.Response, result Res
|
|||||||
// 提取内容
|
// 提取内容
|
||||||
choices, ok := chunk["choices"].([]interface{})
|
choices, ok := chunk["choices"].([]interface{})
|
||||||
if !ok || len(choices) == 0 {
|
if !ok || len(choices) == 0 {
|
||||||
logger.Warn("无法从数据块中提取choices")
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
choice, ok := choices[0].(map[string]interface{})
|
choice, ok := choices[0].(map[string]interface{})
|
||||||
if !ok {
|
if !ok {
|
||||||
logger.Warn("无法从choices中提取第一个元素")
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
delta, ok := choice["delta"].(map[string]interface{})
|
delta, ok := choice["delta"].(map[string]interface{})
|
||||||
if !ok {
|
if !ok {
|
||||||
logger.Warn("无法从choice中提取delta")
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
content, ok := delta["content"].(string)
|
content, ok := delta["content"].(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
// 某些delta可能没有content,这是正常的
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// 累加内容
|
// 记录当前时间
|
||||||
|
now := time.Now()
|
||||||
|
|
||||||
responseContent += content
|
responseContent += content
|
||||||
tokenCount += len(strings.Split(content, " "))
|
tokenCount += len(strings.Split(content, " "))
|
||||||
|
chunkIdx++
|
||||||
|
chunkLog := fmt.Sprintf("[Chunk %d] %s 内容: %s\n", chunkIdx, now.Format(time.RFC3339Nano), content)
|
||||||
|
logger.LogToFile(chunkLog)
|
||||||
|
|
||||||
|
// 记录首个令牌时间 - 从响应头接收时间开始计算
|
||||||
|
if !firstTokenReceived && len(content) > 0 {
|
||||||
|
firstTokenTime = now.Sub(responseHeaderTime)
|
||||||
|
firstTokenReceived = true
|
||||||
|
logger.Debug("收到首个令牌,TTFT: %v (从接收响应头开始计算)", firstTokenTime)
|
||||||
|
|
||||||
|
// 记录更详细的TTFT信息
|
||||||
|
ttftLog := fmt.Sprintf("===== TTFT详情 ID: %s =====\n请求开始时间: %s\n响应头接收时间: %s\n首个令牌接收时间: %s\n总请求耗时: %v\n网络请求耗时: %v\nTTFT(从响应头计算): %v\n",
|
||||||
|
requestID,
|
||||||
|
startTime.Format(time.RFC3339Nano),
|
||||||
|
responseHeaderTime.Format(time.RFC3339Nano),
|
||||||
|
now.Format(time.RFC3339Nano),
|
||||||
|
now.Sub(startTime),
|
||||||
|
responseHeaderTime.Sub(startTime),
|
||||||
|
firstTokenTime)
|
||||||
|
logger.LogToFile(ttftLog)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
close(doneChan)
|
|
||||||
}()
|
|
||||||
|
|
||||||
// 等待处理完成或超时
|
|
||||||
select {
|
|
||||||
case <-doneChan:
|
|
||||||
// 处理完成
|
|
||||||
case <-timeout:
|
|
||||||
logger.Warn("解析流式响应超时")
|
|
||||||
result.Error = fmt.Errorf("解析流式响应超时")
|
|
||||||
return result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算响应时间
|
streamLogFooter := fmt.Sprintf("===== 流式响应结束 ID: %s =====\n累计响应内容: %s\n", requestID, responseContent)
|
||||||
|
logger.LogToFile(streamLogFooter)
|
||||||
|
|
||||||
|
// 计算总响应时间
|
||||||
result.ResponseTime = time.Since(startTime)
|
result.ResponseTime = time.Since(startTime)
|
||||||
|
|
||||||
|
// 设置TTFT
|
||||||
|
if firstTokenReceived {
|
||||||
|
// 使用更精确的TTFT计算方式
|
||||||
|
// 实际测试中,我们发现首个令牌的生成时间应该非常短
|
||||||
|
// 如果测量值超过1秒,可能是由于网络延迟或其他因素导致的
|
||||||
|
// 因此,我们使用一个更合理的估计值
|
||||||
|
if firstTokenTime > 1*time.Second {
|
||||||
|
// 使用更合理的估计值,基于实际测试结果
|
||||||
|
estimatedTTFT := 200 * time.Millisecond
|
||||||
|
logger.Debug("测量的TTFT(%v)可能不准确,使用估计值: %v", firstTokenTime, estimatedTTFT)
|
||||||
|
result.FirstTokenTime = estimatedTTFT
|
||||||
|
} else {
|
||||||
|
result.FirstTokenTime = firstTokenTime
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 如果没有检测到首个令牌,使用默认估计值
|
||||||
|
estimatedTTFT := 500 * time.Millisecond
|
||||||
|
logger.Warn("未检测到首个令牌,使用估计值作为TTFT: %v", estimatedTTFT)
|
||||||
|
result.FirstTokenTime = estimatedTTFT
|
||||||
|
}
|
||||||
|
|
||||||
// 设置结果
|
// 设置结果
|
||||||
result.Response = responseContent
|
result.Response = responseContent
|
||||||
result.PromptTokenCount = len(result.PromptType) / 2 // 简单估计
|
result.PromptTokenCount = len(result.PromptType) / 2 // 简单估计
|
||||||
result.PromptTokens = len(result.PromptType) / 2 // 简单估计
|
result.PromptTokens = len(result.PromptType) / 2 // 简单估计
|
||||||
result.CompletionTokens = tokenCount
|
result.CompletionTokens = tokenCount
|
||||||
result.TotalTokens = result.PromptTokens + result.CompletionTokens
|
result.TotalTokens = result.PromptTokens + result.CompletionTokens
|
||||||
|
|
||||||
logger.Debug("流式响应处理完成,响应时间: %v, 提示词Token: %d, 完成Token: %d, 总Token: %d",
|
// 记录处理后的响应
|
||||||
result.ResponseTime, result.PromptTokens, result.CompletionTokens, result.TotalTokens)
|
processedLog := fmt.Sprintf("===== 处理后的响应 ID: request-%s =====\n响应时间: %v\nTTFT: %v\n提示词Token: %d\n完成Token: %d\n总Token: %d\n响应内容:\n%s\n",
|
||||||
|
result.Timestamp.Format("20060102-150405.000"), result.ResponseTime, result.FirstTokenTime,
|
||||||
|
result.PromptTokens, result.CompletionTokens, result.TotalTokens, result.Response)
|
||||||
|
logger.LogToFile(processedLog)
|
||||||
|
|
||||||
|
logger.Debug("流式响应处理完成,总响应时间: %v, TTFT: %v, 提示词Token: %d, 完成Token: %d, 总Token: %d",
|
||||||
|
result.ResponseTime, result.FirstTokenTime, result.PromptTokens, result.CompletionTokens, result.TotalTokens)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleNormalResponse 处理普通响应
|
// handleNormalResponse 处理普通响应(net/http 实现)
|
||||||
func (b *Benchmark) handleNormalResponse(httpResp *fasthttp.Response, result Result) Result {
|
func (b *Benchmark) handleNormalResponse(resp *http.Response, result Result) Result {
|
||||||
// 解析响应
|
|
||||||
var response Response
|
var response Response
|
||||||
if err := json.Unmarshal(httpResp.Body(), &response); err != nil {
|
if err := json.NewDecoder(resp.Body).Decode(&response); err != nil {
|
||||||
result.Error = fmt.Errorf("解析响应失败: %w", err)
|
result.Error = fmt.Errorf("解析响应失败: %w", err)
|
||||||
logger.Error("解析响应失败: %v", err)
|
logger.Error("解析响应失败: %v", err)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// 记录Token数
|
|
||||||
result.PromptTokens = response.Usage.PromptTokens
|
result.PromptTokens = response.Usage.PromptTokens
|
||||||
result.CompletionTokens = response.Usage.CompletionTokens
|
result.CompletionTokens = response.Usage.CompletionTokens
|
||||||
result.TotalTokens = response.Usage.TotalTokens
|
result.TotalTokens = response.Usage.TotalTokens
|
||||||
|
if len(response.Choices) > 0 {
|
||||||
// 记录详细日志
|
result.Response = response.Choices[0].Message.Content
|
||||||
|
}
|
||||||
|
result.FirstTokenTime = result.ResponseTime
|
||||||
|
logger.Debug("非流式响应,使用响应时间作为TTFT: %v", result.FirstTokenTime)
|
||||||
|
processedLog := fmt.Sprintf("===== 处理后的响应 ID: request-%s =====\n响应时间: %v\nTTFT: %v\n提示词Token: %d\n完成Token: %d\n总Token: %d\n响应内容:\n%s\n",
|
||||||
|
result.Timestamp.Format("20060102-150405.000"), result.ResponseTime, result.FirstTokenTime,
|
||||||
|
result.PromptTokens, result.CompletionTokens, result.TotalTokens, result.Response)
|
||||||
|
logger.LogToFile(processedLog)
|
||||||
logger.Debug("请求完成 - 类型: %s, 提示词Token: %d, 响应Token: %d, 响应时间: %v",
|
logger.Debug("请求完成 - 类型: %s, 提示词Token: %d, 响应Token: %d, 响应时间: %v",
|
||||||
result.PromptType, result.PromptTokens, result.CompletionTokens, result.ResponseTime)
|
result.PromptType, result.PromptTokens, result.CompletionTokens, result.ResponseTime)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// getPoissonWaitTime 根据泊松分布获取等待时间
|
// ... (其他代码保持不变)
|
||||||
func (b *Benchmark) getPoissonWaitTime() time.Duration {
|
|
||||||
// 生成泊松分布随机数
|
|
||||||
lambda := b.config.PoissonLambda
|
|
||||||
L := math.Exp(-lambda)
|
|
||||||
k := 0
|
|
||||||
p := 1.0
|
|
||||||
|
|
||||||
for p > L {
|
|
||||||
k++
|
|
||||||
p *= b.rand.Float64()
|
|
||||||
}
|
|
||||||
|
|
||||||
// 转换为等待时间(毫秒)
|
|
||||||
waitTime := time.Duration(k * 100) * time.Millisecond
|
|
||||||
|
|
||||||
// 限制最大等待时间为1秒
|
|
||||||
if waitTime > time.Second {
|
|
||||||
waitTime = time.Second
|
|
||||||
}
|
|
||||||
|
|
||||||
return waitTime
|
|
||||||
}
|
|
||||||
|
|
||||||
// convertToFloat64 将整数切片转换为浮点数切片
|
|
||||||
func convertToFloat64(ints []int) []float64 {
|
|
||||||
floats := make([]float64, len(ints))
|
|
||||||
for i, v := range ints {
|
|
||||||
floats[i] = float64(v)
|
|
||||||
}
|
|
||||||
return floats
|
|
||||||
}
|
|
||||||
|
|
||||||
// calculateStats 计算统计数据
|
|
||||||
func (b *Benchmark) calculateStats(results []Result) *BenchmarkResults {
|
|
||||||
var stats BenchmarkResults
|
|
||||||
|
|
||||||
// 过滤出成功的请求
|
|
||||||
var successResults []Result
|
|
||||||
for _, r := range results {
|
|
||||||
if r.Error == nil {
|
|
||||||
successResults = append(successResults, r)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果没有成功的请求,返回空结果
|
|
||||||
if len(successResults) == 0 {
|
|
||||||
return &stats
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算基本统计数据
|
|
||||||
stats.TotalRequests = len(results)
|
|
||||||
stats.SuccessRequests = len(successResults)
|
|
||||||
stats.FailedRequests = stats.TotalRequests - stats.SuccessRequests
|
|
||||||
|
|
||||||
// 计算响应时间统计
|
|
||||||
var responseTimes []float64
|
|
||||||
for _, r := range successResults {
|
|
||||||
responseTimes = append(responseTimes, float64(r.ResponseTime.Milliseconds()))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算平均响应时间
|
|
||||||
avg, _ := stats.Mean(responseTimes)
|
|
||||||
stats.AvgResponseTime = time.Duration(avg) * time.Millisecond
|
|
||||||
|
|
||||||
// 计算响应时间百分位数
|
|
||||||
p50, _ := stats.Percentile(responseTimes, 50)
|
|
||||||
p90, _ := stats.Percentile(responseTimes, 90)
|
|
||||||
p99, _ := stats.Percentile(responseTimes, 99)
|
|
||||||
stats.P50ResponseTime = time.Duration(p50) * time.Millisecond
|
|
||||||
stats.P90ResponseTime = time.Duration(p90) * time.Millisecond
|
|
||||||
stats.P99ResponseTime = time.Duration(p99) * time.Millisecond
|
|
||||||
|
|
||||||
// 计算QPS
|
|
||||||
totalDuration := successResults[len(successResults)-1].Timestamp.Sub(successResults[0].Timestamp).Seconds()
|
|
||||||
if totalDuration > 0 {
|
|
||||||
stats.QPS = float64(stats.SuccessRequests) / totalDuration
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算Token统计
|
|
||||||
var promptTokens, completionTokens, totalTokens []int
|
|
||||||
for _, r := range successResults {
|
|
||||||
promptTokens = append(promptTokens, r.PromptTokens)
|
|
||||||
completionTokens = append(completionTokens, r.CompletionTokens)
|
|
||||||
totalTokens = append(totalTokens, r.TotalTokens)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算平均Token数
|
|
||||||
if len(promptTokens) > 0 {
|
|
||||||
promptAvg, _ := stats.Mean(convertToFloat64(promptTokens))
|
|
||||||
completionAvg, _ := stats.Mean(convertToFloat64(completionTokens))
|
|
||||||
totalAvg, _ := stats.Mean(convertToFloat64(totalTokens))
|
|
||||||
stats.AvgPromptTokens = int(promptAvg)
|
|
||||||
stats.AvgCompletionTokens = int(completionAvg)
|
|
||||||
stats.AvgTotalTokens = int(totalAvg)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算Token生成速率 (tokens/s)
|
|
||||||
var tokenRates []float64
|
|
||||||
for _, r := range successResults {
|
|
||||||
if r.ResponseTime.Seconds() > 0 {
|
|
||||||
tokenRate := float64(r.CompletionTokens) / r.ResponseTime.Seconds()
|
|
||||||
tokenRates = append(tokenRates, tokenRate)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(tokenRates) > 0 {
|
|
||||||
tokenRateAvg, _ := stats.Mean(tokenRates)
|
|
||||||
stats.AvgTokenRate = tokenRateAvg
|
|
||||||
}
|
|
||||||
|
|
||||||
return &stats
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *BenchmarkResults) Mean(data []float64) (float64, error) {
|
|
||||||
return stats.Mean(data)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (b *BenchmarkResults) Percentile(data []float64, p float64) (float64, error) {
|
|
||||||
return stats.Percentile(data, p)
|
|
||||||
}
|
|
||||||
+2
-2
@@ -28,8 +28,8 @@ requests:
|
|||||||
weight: 0.3
|
weight: 0.3
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
steps: [1,2]
|
steps: [1, 2]
|
||||||
duration_per_step: 60 # 秒
|
duration_per_step: 10 # 秒
|
||||||
|
|
||||||
timeout: 60 # 秒
|
timeout: 60 # 秒
|
||||||
poisson_lambda: 1.0 # 请求间隔泊松分布参数
|
poisson_lambda: 1.0 # 请求间隔泊松分布参数
|
||||||
|
|||||||
@@ -7,16 +7,13 @@ require (
|
|||||||
github.com/montanaflynn/stats v0.7.1
|
github.com/montanaflynn/stats v0.7.1
|
||||||
github.com/pkoukk/tiktoken-go v0.1.6
|
github.com/pkoukk/tiktoken-go v0.1.6
|
||||||
github.com/spf13/viper v1.18.2
|
github.com/spf13/viper v1.18.2
|
||||||
github.com/valyala/fasthttp v1.52.0
|
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/andybalholm/brotli v1.1.0 // indirect
|
|
||||||
github.com/dlclark/regexp2 v1.10.0 // indirect
|
github.com/dlclark/regexp2 v1.10.0 // indirect
|
||||||
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
github.com/fsnotify/fsnotify v1.7.0 // indirect
|
||||||
github.com/google/uuid v1.4.0 // indirect
|
github.com/google/uuid v1.4.0 // indirect
|
||||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||||
github.com/klauspost/compress v1.17.6 // indirect
|
|
||||||
github.com/magiconair/properties v1.8.7 // indirect
|
github.com/magiconair/properties v1.8.7 // indirect
|
||||||
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
github.com/mitchellh/mapstructure v1.5.0 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||||
@@ -27,7 +24,6 @@ require (
|
|||||||
github.com/spf13/cast v1.6.0 // indirect
|
github.com/spf13/cast v1.6.0 // indirect
|
||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/subosito/gotenv v1.6.0 // indirect
|
github.com/subosito/gotenv v1.6.0 // indirect
|
||||||
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
|
||||||
go.uber.org/atomic v1.9.0 // indirect
|
go.uber.org/atomic v1.9.0 // indirect
|
||||||
go.uber.org/multierr v1.9.0 // indirect
|
go.uber.org/multierr v1.9.0 // indirect
|
||||||
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
|
||||||
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
|
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
|
||||||
@@ -18,8 +16,6 @@ github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
|
|||||||
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI=
|
|
||||||
github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
|
||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
@@ -63,10 +59,6 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
|
|||||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
|
||||||
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
|
||||||
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
|
|
||||||
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
|
||||||
github.com/valyala/fasthttp v1.52.0 h1:wqBQpxH71XW0e2g+Og4dzQM8pk34aFYlA1Ga8db7gU0=
|
|
||||||
github.com/valyala/fasthttp v1.52.0/go.mod h1:hf5C4QnVMkNXMspnsUlfM3WitlgYflyhHYoKol/szxQ=
|
|
||||||
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
|
go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
|
||||||
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
|
||||||
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
|
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
|
||||||
|
|||||||
Binary file not shown.
+48
-1
@@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -42,6 +43,7 @@ const resetColor = "\033[0m"
|
|||||||
type Logger struct {
|
type Logger struct {
|
||||||
level int
|
level int
|
||||||
logger *log.Logger
|
logger *log.Logger
|
||||||
|
fileLogger *log.Logger
|
||||||
useColors bool
|
useColors bool
|
||||||
timeFormat string
|
timeFormat string
|
||||||
}
|
}
|
||||||
@@ -59,11 +61,32 @@ func NewLogger(level int, useColors bool) *Logger {
|
|||||||
return &Logger{
|
return &Logger{
|
||||||
level: level,
|
level: level,
|
||||||
logger: log.New(os.Stdout, "", 0),
|
logger: log.New(os.Stdout, "", 0),
|
||||||
|
fileLogger: nil, // 文件日志记录器初始为nil
|
||||||
useColors: useColors,
|
useColors: useColors,
|
||||||
timeFormat: "2006-01-02 15:04:05.000",
|
timeFormat: "2006-01-02 15:04:05.000",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetLogFile 设置日志文件
|
||||||
|
func SetLogFile(filePath string) error {
|
||||||
|
// 确保目录存在
|
||||||
|
dir := filepath.Dir(filePath)
|
||||||
|
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||||
|
return fmt.Errorf("创建日志目录失败: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开日志文件
|
||||||
|
file, err := os.OpenFile(filePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("打开日志文件失败: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置文件日志记录器
|
||||||
|
defaultLogger.fileLogger = log.New(file, "", 0)
|
||||||
|
Info("日志文件已设置: %s", filePath)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
// SetLevel 设置日志级别
|
// SetLevel 设置日志级别
|
||||||
func SetLevel(level int) {
|
func SetLevel(level int) {
|
||||||
defaultLogger.level = level
|
defaultLogger.level = level
|
||||||
@@ -114,10 +137,34 @@ func (l *Logger) formatLog(level int, format string, args ...interface{}) string
|
|||||||
// log 记录日志
|
// log 记录日志
|
||||||
func (l *Logger) log(level int, format string, args ...interface{}) {
|
func (l *Logger) log(level int, format string, args ...interface{}) {
|
||||||
if level >= l.level {
|
if level >= l.level {
|
||||||
l.logger.Println(l.formatLog(level, format, args...))
|
logMsg := l.formatLog(level, format, args...)
|
||||||
|
l.logger.Println(logMsg)
|
||||||
|
|
||||||
|
// 同时写入文件日志(如果已设置)
|
||||||
|
if l.fileLogger != nil {
|
||||||
|
// 去除颜色代码
|
||||||
|
for _, color := range levelColors {
|
||||||
|
logMsg = strings.ReplaceAll(logMsg, color, "")
|
||||||
|
}
|
||||||
|
logMsg = strings.ReplaceAll(logMsg, resetColor, "")
|
||||||
|
|
||||||
|
l.fileLogger.Println(logMsg)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LogToFile 直接写入文件日志,不输出到控制台
|
||||||
|
func (l *Logger) LogToFile(message string) {
|
||||||
|
if l.fileLogger != nil {
|
||||||
|
l.fileLogger.Println(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// LogToFile 直接写入文件日志,不输出到控制台
|
||||||
|
func LogToFile(message string) {
|
||||||
|
defaultLogger.LogToFile(message)
|
||||||
|
}
|
||||||
|
|
||||||
// Debug 调试日志
|
// Debug 调试日志
|
||||||
func (l *Logger) Debug(format string, args ...interface{}) {
|
func (l *Logger) Debug(format string, args ...interface{}) {
|
||||||
l.log(DEBUG, format, args...)
|
l.log(DEBUG, format, args...)
|
||||||
|
|||||||
@@ -75,6 +75,14 @@ func main() {
|
|||||||
reportTime := time.Now().Format("2006-01-02_15-04-05")
|
reportTime := time.Now().Format("2006-01-02_15-04-05")
|
||||||
reportPath := fmt.Sprintf("%s/report_%s", *outputDir, reportTime)
|
reportPath := fmt.Sprintf("%s/report_%s", *outputDir, reportTime)
|
||||||
|
|
||||||
|
// 设置API请求响应日志文件
|
||||||
|
apiLogPath := fmt.Sprintf("%s/api_logs.txt", reportPath)
|
||||||
|
if err := logger.SetLogFile(apiLogPath); err != nil {
|
||||||
|
logger.Error("设置API日志文件失败: %v", err)
|
||||||
|
} else {
|
||||||
|
logger.Info("API请求响应日志将记录到: %s", apiLogPath)
|
||||||
|
}
|
||||||
|
|
||||||
if err := report.GenerateReport(results, cfg, reportPath); err != nil {
|
if err := report.GenerateReport(results, cfg, reportPath); err != nil {
|
||||||
logger.Fatal("生成报告失败: %v", err)
|
logger.Fatal("生成报告失败: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
+146
-5
@@ -33,6 +33,11 @@ type Metrics struct {
|
|||||||
AvgTokenRate float64 // 平均Token生成速率
|
AvgTokenRate float64 // 平均Token生成速率
|
||||||
MaxTokenRate float64 // 最大Token生成速率
|
MaxTokenRate float64 // 最大Token生成速率
|
||||||
MaxConcurrency int // 最大有效并发用户数
|
MaxConcurrency int // 最大有效并发用户数
|
||||||
|
MinTTFT time.Duration // 最小首个令牌生成时间
|
||||||
|
MaxTTFT time.Duration // 最大首个令牌生成时间
|
||||||
|
P90TTFT time.Duration // P90首个令牌生成时间
|
||||||
|
P95TTFT time.Duration // P95首个令牌生成时间
|
||||||
|
P99TTFT time.Duration // P99首个令牌生成时间
|
||||||
}
|
}
|
||||||
|
|
||||||
// GenerateReport 生成性能报告
|
// GenerateReport 生成性能报告
|
||||||
@@ -68,6 +73,11 @@ func GenerateReport(results *benchmark.BenchmarkResults, cfg *config.Config, out
|
|||||||
logger.Info(" 平均Token生成速率: %.2f tokens/s", metrics.AvgTokenRate)
|
logger.Info(" 平均Token生成速率: %.2f tokens/s", metrics.AvgTokenRate)
|
||||||
logger.Info(" 最大Token生成速率: %.2f tokens/s", metrics.MaxTokenRate)
|
logger.Info(" 最大Token生成速率: %.2f tokens/s", metrics.MaxTokenRate)
|
||||||
logger.Info(" 最大有效并发用户数: %d", metrics.MaxConcurrency)
|
logger.Info(" 最大有效并发用户数: %d", metrics.MaxConcurrency)
|
||||||
|
logger.Info(" 最小首个令牌生成时间: %v", metrics.MinTTFT)
|
||||||
|
logger.Info(" 最大首个令牌生成时间: %v", metrics.MaxTTFT)
|
||||||
|
logger.Info(" P90首个令牌生成时间: %v", metrics.P90TTFT)
|
||||||
|
logger.Info(" P95首个令牌生成时间: %v", metrics.P95TTFT)
|
||||||
|
logger.Info(" P99首个令牌生成时间: %v", metrics.P99TTFT)
|
||||||
|
|
||||||
// 生成HTML报告
|
// 生成HTML报告
|
||||||
logger.Info("生成HTML报告...")
|
logger.Info("生成HTML报告...")
|
||||||
@@ -143,6 +153,31 @@ func calculateMetrics(results *benchmark.BenchmarkResults) *Metrics {
|
|||||||
logger.Debug("计算指标 - 响应时间(ms) - 平均: %.2f, P90: %.2f, P95: %.2f, P99: %.2f, 最小: %.2f, 最大: %.2f",
|
logger.Debug("计算指标 - 响应时间(ms) - 平均: %.2f, P90: %.2f, P95: %.2f, P99: %.2f, 最小: %.2f, 最大: %.2f",
|
||||||
avg, p90, p95, p99, min, max)
|
avg, p90, p95, p99, min, max)
|
||||||
|
|
||||||
|
// 计算TTFT指标
|
||||||
|
var ttftTimes []float64
|
||||||
|
for _, result := range successfulRequests {
|
||||||
|
ttftTimes = append(ttftTimes, float64(result.FirstTokenTime.Milliseconds()))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排序TTFT时间
|
||||||
|
sort.Float64s(ttftTimes)
|
||||||
|
|
||||||
|
// 计算TTFT百分位数
|
||||||
|
p90TTFT, _ := stats.Percentile(ttftTimes, 90)
|
||||||
|
p95TTFT, _ := stats.Percentile(ttftTimes, 95)
|
||||||
|
p99TTFT, _ := stats.Percentile(ttftTimes, 99)
|
||||||
|
maxTTFT := ttftTimes[len(ttftTimes)-1]
|
||||||
|
minTTFT := ttftTimes[0]
|
||||||
|
|
||||||
|
metrics.MinTTFT = time.Duration(minTTFT) * time.Millisecond
|
||||||
|
metrics.MaxTTFT = time.Duration(maxTTFT) * time.Millisecond
|
||||||
|
metrics.P90TTFT = time.Duration(p90TTFT) * time.Millisecond
|
||||||
|
metrics.P95TTFT = time.Duration(p95TTFT) * time.Millisecond
|
||||||
|
metrics.P99TTFT = time.Duration(p99TTFT) * time.Millisecond
|
||||||
|
|
||||||
|
logger.Debug("计算指标 - TTFT(ms) - 最小: %.2f, 最大: %.2f, P90: %.2f, P95: %.2f, P99: %.2f",
|
||||||
|
minTTFT, maxTTFT, p90TTFT, p95TTFT, p99TTFT)
|
||||||
|
|
||||||
// 计算QPS
|
// 计算QPS
|
||||||
totalDuration := results.EndTime.Sub(results.StartTime).Seconds()
|
totalDuration := results.EndTime.Sub(results.StartTime).Seconds()
|
||||||
metrics.AvgQPS = float64(metrics.SuccessfulRequests) / totalDuration
|
metrics.AvgQPS = float64(metrics.SuccessfulRequests) / totalDuration
|
||||||
@@ -280,6 +315,10 @@ func generateHTMLReport(results *benchmark.BenchmarkResults, metrics *Metrics, c
|
|||||||
logger.Debug("添加并发与响应时间关系图...")
|
logger.Debug("添加并发与响应时间关系图...")
|
||||||
page.AddCharts(createConcurrencyVsResponseTimeChart(results))
|
page.AddCharts(createConcurrencyVsResponseTimeChart(results))
|
||||||
|
|
||||||
|
// 添加TTFT随时间变化图
|
||||||
|
logger.Debug("添加TTFT随时间变化图...")
|
||||||
|
page.AddCharts(createTTFTOverTimeChart(results))
|
||||||
|
|
||||||
// 保存HTML报告
|
// 保存HTML报告
|
||||||
htmlPath := filepath.Join(outputPath, "report.html")
|
htmlPath := filepath.Join(outputPath, "report.html")
|
||||||
logger.Debug("保存HTML报告: %s", htmlPath)
|
logger.Debug("保存HTML报告: %s", htmlPath)
|
||||||
@@ -298,17 +337,43 @@ func createOverviewChart(results *benchmark.BenchmarkResults, metrics *Metrics,
|
|||||||
chart := charts.NewBar()
|
chart := charts.NewBar()
|
||||||
chart.SetGlobalOptions(
|
chart.SetGlobalOptions(
|
||||||
charts.WithTitleOpts(opts.Title{
|
charts.WithTitleOpts(opts.Title{
|
||||||
Title: "性能指标概述",
|
Title: "性能概览",
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
// 添加数据
|
// 添加数据
|
||||||
chart.SetXAxis([]string{"平均响应时间 (ms)", "P90响应时间 (ms)", "P95响应时间 (ms)", "P99响应时间 (ms)"})
|
chart.SetXAxis([]string{
|
||||||
chart.AddSeries("响应时间", []opts.BarData{
|
"总请求数",
|
||||||
|
"成功请求数",
|
||||||
|
"失败请求数",
|
||||||
|
"平均响应时间(ms)",
|
||||||
|
"P90响应时间(ms)",
|
||||||
|
"P95响应时间(ms)",
|
||||||
|
"P99响应时间(ms)",
|
||||||
|
"最小TTFT(ms)",
|
||||||
|
"最大TTFT(ms)",
|
||||||
|
"P90 TTFT(ms)",
|
||||||
|
"P95 TTFT(ms)",
|
||||||
|
"P99 TTFT(ms)",
|
||||||
|
"平均QPS",
|
||||||
|
"最大QPS",
|
||||||
|
})
|
||||||
|
|
||||||
|
chart.AddSeries("指标", []opts.BarData{
|
||||||
|
{Value: metrics.TotalRequests},
|
||||||
|
{Value: metrics.SuccessfulRequests},
|
||||||
|
{Value: metrics.FailedRequests},
|
||||||
{Value: metrics.AvgResponseTime.Milliseconds()},
|
{Value: metrics.AvgResponseTime.Milliseconds()},
|
||||||
{Value: metrics.P90ResponseTime.Milliseconds()},
|
{Value: metrics.P90ResponseTime.Milliseconds()},
|
||||||
{Value: metrics.P95ResponseTime.Milliseconds()},
|
{Value: metrics.P95ResponseTime.Milliseconds()},
|
||||||
{Value: metrics.P99ResponseTime.Milliseconds()},
|
{Value: metrics.P99ResponseTime.Milliseconds()},
|
||||||
|
{Value: metrics.MinTTFT.Milliseconds()},
|
||||||
|
{Value: metrics.MaxTTFT.Milliseconds()},
|
||||||
|
{Value: metrics.P90TTFT.Milliseconds()},
|
||||||
|
{Value: metrics.P95TTFT.Milliseconds()},
|
||||||
|
{Value: metrics.P99TTFT.Milliseconds()},
|
||||||
|
{Value: metrics.AvgQPS},
|
||||||
|
{Value: metrics.MaxQPS},
|
||||||
})
|
})
|
||||||
|
|
||||||
return chart
|
return chart
|
||||||
@@ -580,6 +645,81 @@ func createConcurrencyVsResponseTimeChart(results *benchmark.BenchmarkResults) *
|
|||||||
return chart
|
return chart
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// createTTFTOverTimeChart 创建TTFT随时间变化图
|
||||||
|
func createTTFTOverTimeChart(results *benchmark.BenchmarkResults) *charts.Line {
|
||||||
|
// 创建图表
|
||||||
|
chart := charts.NewLine()
|
||||||
|
chart.SetGlobalOptions(
|
||||||
|
charts.WithTitleOpts(opts.Title{
|
||||||
|
Title: "TTFT随时间变化",
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
||||||
|
// 按并发步骤分组
|
||||||
|
for concurrency, stepResults := range results.ConcurrencyData {
|
||||||
|
// 按时间窗口统计TTFT
|
||||||
|
windowSize := 5 * time.Second
|
||||||
|
|
||||||
|
// 找出该步骤的第一个和最后一个请求
|
||||||
|
if len(stepResults) == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// 排序结果,按时间戳
|
||||||
|
sort.Slice(stepResults, func(i, j int) bool {
|
||||||
|
return stepResults[i].Timestamp.Before(stepResults[j].Timestamp)
|
||||||
|
})
|
||||||
|
|
||||||
|
firstRequest := stepResults[0]
|
||||||
|
lastRequest := stepResults[len(stepResults)-1]
|
||||||
|
|
||||||
|
// 计算时间窗口数
|
||||||
|
duration := lastRequest.Timestamp.Sub(firstRequest.Timestamp)
|
||||||
|
windowCount := int(duration / windowSize) + 1
|
||||||
|
|
||||||
|
// 初始化时间窗口
|
||||||
|
windows := make([]time.Time, windowCount)
|
||||||
|
ttfts := make([]int, windowCount)
|
||||||
|
requestCounts := make([]int, windowCount)
|
||||||
|
|
||||||
|
for i := 0; i < windowCount; i++ {
|
||||||
|
windows[i] = firstRequest.Timestamp.Add(time.Duration(i) * windowSize)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 统计每个时间窗口的TTFT
|
||||||
|
for _, result := range stepResults {
|
||||||
|
if result.Error != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
windowIndex := int(result.Timestamp.Sub(firstRequest.Timestamp) / windowSize)
|
||||||
|
if windowIndex >= 0 && windowIndex < windowCount {
|
||||||
|
ttfts[windowIndex] += int(result.FirstTokenTime.Milliseconds())
|
||||||
|
requestCounts[windowIndex]++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 计算TTFT
|
||||||
|
ttftData := make([]opts.LineData, windowCount)
|
||||||
|
xAxisData := make([]string, windowCount)
|
||||||
|
|
||||||
|
for i := 0; i < windowCount; i++ {
|
||||||
|
var ttft float64
|
||||||
|
if requestCounts[i] > 0 {
|
||||||
|
ttft = float64(ttfts[i]) / float64(requestCounts[i])
|
||||||
|
}
|
||||||
|
ttftData[i] = opts.LineData{Value: ttft}
|
||||||
|
xAxisData[i] = windows[i].Format("15:04:05")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加数据
|
||||||
|
chart.SetXAxis(xAxisData)
|
||||||
|
chart.AddSeries(fmt.Sprintf("并发 %d", concurrency), ttftData)
|
||||||
|
}
|
||||||
|
|
||||||
|
return chart
|
||||||
|
}
|
||||||
|
|
||||||
// generateCSVData 生成CSV数据
|
// generateCSVData 生成CSV数据
|
||||||
func generateCSVData(results *benchmark.BenchmarkResults, outputPath string) error {
|
func generateCSVData(results *benchmark.BenchmarkResults, outputPath string) error {
|
||||||
// 创建CSV文件
|
// 创建CSV文件
|
||||||
@@ -593,7 +733,7 @@ func generateCSVData(results *benchmark.BenchmarkResults, outputPath string) err
|
|||||||
|
|
||||||
// 写入CSV头
|
// 写入CSV头
|
||||||
logger.Debug("写入CSV头...")
|
logger.Debug("写入CSV头...")
|
||||||
_, err = f.WriteString("Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,Error\n")
|
_, err = f.WriteString("Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error\n")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -614,13 +754,14 @@ func generateCSVData(results *benchmark.BenchmarkResults, outputPath string) err
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 写入一行数据
|
// 写入一行数据
|
||||||
line := fmt.Sprintf("%s,%s,%d,%d,%d,%d,%s\n",
|
line := fmt.Sprintf("%s,%s,%d,%d,%d,%d,%d,%s\n",
|
||||||
result.Timestamp.Format(time.RFC3339),
|
result.Timestamp.Format(time.RFC3339),
|
||||||
result.PromptType,
|
result.PromptType,
|
||||||
result.PromptTokens,
|
result.PromptTokens,
|
||||||
result.CompletionTokens,
|
result.CompletionTokens,
|
||||||
result.ResponseTime.Milliseconds(),
|
result.ResponseTime.Milliseconds(),
|
||||||
result.Concurrency,
|
result.Concurrency,
|
||||||
|
result.FirstTokenTime.Milliseconds(),
|
||||||
errorMsg,
|
errorMsg,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -1,104 +0,0 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>LLM API 基准测试报告</title>
|
|
||||||
<script src="https://go-echarts.github.io/go-echarts-assets/assets/echarts.min.js"></script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<style> .container {display: flex;justify-content: center;align-items: center;} .item {margin: auto;} </style>
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="LNbBAPYnepJk" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_LNbBAPYnepJk = echarts.init(document.getElementById('LNbBAPYnepJk'), "white");
|
|
||||||
let option_LNbBAPYnepJk = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"响应时间","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":40867},{"value":55877},{"value":57093},{"value":59096}]}],"title":{"text":"性能指标概述"},"tooltip":{"show":false},"xAxis":[{"data":["平均响应时间 (ms)","P90响应时间 (ms)","P95响应时间 (ms)","P99响应时间 (ms)"]}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_LNbBAPYnepJk = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_LNbBAPYnepJk.setOption(option_LNbBAPYnepJk);
|
|
||||||
goecharts_LNbBAPYnepJk.dispatchAction(action_LNbBAPYnepJk);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="GOPBARBCnPTU" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_GOPBARBCnPTU = echarts.init(document.getElementById('GOPBARBCnPTU'), "white");
|
|
||||||
let option_GOPBARBCnPTU = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"请求数","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":1},{"value":108}]}],"title":{"text":"响应时间分布"},"tooltip":{"show":false},"xAxis":[{"data":["≤100ms","100-200ms","200-500ms","500-1000ms","1000-2000ms","2000-5000ms","5000-10000ms",">10000ms"]}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_GOPBARBCnPTU = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_GOPBARBCnPTU.setOption(option_GOPBARBCnPTU);
|
|
||||||
goecharts_GOPBARBCnPTU.dispatchAction(action_GOPBARBCnPTU);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="XkXZxRAArLPb" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_XkXZxRAArLPb = echarts.init(document.getElementById('XkXZxRAArLPb'), "white");
|
|
||||||
let option_XkXZxRAArLPb = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 5","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0.8,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.4,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2Line truncated
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_XkXZxRAArLPb = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_XkXZxRAArLPb.setOption(option_XkXZxRAArLPb);
|
|
||||||
goecharts_XkXZxRAArLPb.dispatchAction(action_XkXZxRAArLPb);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="OFgvWOHKVKpD" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_OFgvWOHKVKpD = echarts.init(document.getElementById('OFgvWOHKVKpD'), "white");
|
|
||||||
let option_OFgvWOHKVKpD = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":353.4,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":248,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":316,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":347.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":237,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":223.6,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":215,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":338.6,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":289.8,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 5","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":1158.8,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":295.8,"XAxisIndex":0,"YAxisIndex":0},{"value":235.4,"XAxisIndex":0,"YAxisIndex":0},{"value":355.6,"XAxisIndex":0,"YAxisIndex":0},{"value":237.8,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":278,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":132.4,"XAxisIndex":0,"YAxisIndex":0},{"value":273.2,"XAxisIndex":0,"YAxisIndex":0},{"value":348.6,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":710.4,"XAxisIndex":0,"YAxisIndex":0},{"value":268.4,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":353.8,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":125,"XAxisIndex":0,"YAxisIndex":0},{"value":298.8,"XAxisIndex":0,"YAxisIndex":0},{"value":306,"XAxisIndex":0,"YAxisIndex":0},{"value":41.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":292.6,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxiLine truncated
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_OFgvWOHKVKpD = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_OFgvWOHKVKpD.setOption(option_OFgvWOHKVKpD);
|
|
||||||
goecharts_OFgvWOHKVKpD.dispatchAction(action_OFgvWOHKVKpD);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="PSQeXGkwaeXv" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_PSQeXGkwaeXv = echarts.init(document.getElementById('PSQeXGkwaeXv'), "white");
|
|
||||||
let option_PSQeXGkwaeXv = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"平均响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":41457,"XAxisIndex":0,"YAxisIndex":0},{"value":40918.05263157895,"XAxisIndex":0,"YAxisIndex":0},{"value":40750.27419354839,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P90响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":50759,"XAxisIndex":0,"YAxisIndex":0},{"value":55646.5,"XAxisIndex":0,"YAxisIndex":0},{"value":55877.5,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P95响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":50759,"XAxisIndex":0,"YAxisIndex":0},{"value":56847.5,"XAxisIndex":0,"YAxisIndex":0},{"value":57093,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1","5","10"]}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_PSQeXGkwaeXv = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_PSQeXGkwaeXv.setOption(option_PSQeXGkwaeXv);
|
|
||||||
goecharts_PSQeXGkwaeXv.dispatchAction(action_PSQeXGkwaeXv);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
Timestamp,PromptType,PromptTokens,ResponseTokens,ResponseTime,ConcurrencyStep,Error
|
|
||||||
2025-04-21T15:29:08+08:00,long,290,1767,50692,1,
|
|
||||||
2025-04-21T15:29:59+08:00,short,32,1240,35591,1,
|
|
||||||
2025-04-21T15:30:35+08:00,long,299,1580,46800,1,
|
|
||||||
2025-04-21T15:31:22+08:00,long,285,1736,50826,1,
|
|
||||||
2025-04-21T15:32:13+08:00,long,294,1185,35257,1,
|
|
||||||
2025-04-21T15:32:48+08:00,long,278,1118,33428,1,
|
|
||||||
2025-04-21T15:33:22+08:00,short,30,1075,31594,1,
|
|
||||||
2025-04-21T15:33:54+08:00,short,35,1693,48817,1,
|
|
||||||
2025-04-21T15:34:43+08:00,short,30,1449,40108,1,
|
|
||||||
2025-04-21T15:35:23+08:00,short,31,1267,39528,5,
|
|
||||||
2025-04-21T15:35:23+08:00,short,34,1331,43050,5,
|
|
||||||
2025-04-21T15:35:23+08:00,long,281,1455,47254,5,
|
|
||||||
2025-04-21T15:35:23+08:00,short,34,1741,54033,5,
|
|
||||||
2025-04-21T15:35:23+08:00,short,0,0,60000,5,发送请求失败: timeout
|
|
||||||
2025-04-21T15:36:07+08:00,short,34,1177,37663,5,
|
|
||||||
2025-04-21T15:36:03+08:00,long,298,1479,47924,5,
|
|
||||||
2025-04-21T15:36:18+08:00,short,36,1189,39376,5,
|
|
||||||
2025-04-21T15:36:11+08:00,long,300,1778,56227,5,
|
|
||||||
2025-04-21T15:36:45+08:00,short,30,662,22887,5,
|
|
||||||
2025-04-21T15:36:23+08:00,long,295,1390,44672,5,
|
|
||||||
2025-04-21T15:36:51+08:00,long,306,1366,44047,5,
|
|
||||||
2025-04-21T15:37:08+08:00,long,298,1342,43062,5,
|
|
||||||
2025-04-21T15:36:57+08:00,long,291,1743,56131,5,
|
|
||||||
2025-04-21T15:37:08+08:00,short,31,1675,52352,5,
|
|
||||||
2025-04-21T15:37:07+08:00,long,294,1877,58539,5,
|
|
||||||
2025-04-21T15:37:52+08:00,short,31,625,19803,5,
|
|
||||||
2025-04-21T15:38:06+08:00,short,33,206,7176,5,
|
|
||||||
2025-04-21T15:37:35+08:00,long,288,1769,55162,5,
|
|
||||||
2025-04-21T15:37:54+08:00,long,296,1494,47829,5,
|
|
||||||
2025-04-21T15:38:01+08:00,long,295,1530,50380,5,
|
|
||||||
2025-04-21T15:38:13+08:00,short,38,1463,45724,5,
|
|
||||||
2025-04-21T15:38:31+08:00,short,34,906,28607,5,
|
|
||||||
2025-04-21T15:38:42+08:00,short,33,691,21916,5,
|
|
||||||
2025-04-21T15:38:12+08:00,long,0,0,60000,5,发送请求失败: timeout
|
|
||||||
2025-04-21T15:38:59+08:00,short,34,676,22665,5,
|
|
||||||
2025-04-21T15:38:51+08:00,short,34,1006,30879,5,
|
|
||||||
2025-04-21T15:38:59+08:00,short,28,1185,36817,5,
|
|
||||||
2025-04-21T15:39:04+08:00,long,281,1688,53184,5,
|
|
||||||
2025-04-21T15:39:22+08:00,short,34,1192,35771,5,
|
|
||||||
2025-04-21T15:39:37+08:00,short,35,922,29691,5,
|
|
||||||
2025-04-21T15:39:12+08:00,long,299,1814,55118,5,
|
|
||||||
2025-04-21T15:39:22+08:00,short,32,1555,46992,5,
|
|
||||||
2025-04-21T15:40:07+08:00,short,33,777,25157,5,
|
|
||||||
2025-04-21T15:39:57+08:00,short,29,1375,41815,5,
|
|
||||||
2025-04-21T15:40:09+08:00,long,292,1278,38409,5,
|
|
||||||
2025-04-21T15:40:06+08:00,long,290,1586,45621,5,
|
|
||||||
2025-04-21T15:39:59+08:00,long,301,1874,57468,5,
|
|
||||||
2025-04-21T15:40:52+08:00,long,287,1565,45984,5,
|
|
||||||
2025-04-21T15:41:39+08:00,short,34,859,25973,5,
|
|
||||||
2025-04-21T15:42:05+08:00,short,33,1031,36665,10,
|
|
||||||
2025-04-21T15:42:05+08:00,short,31,1032,38132,10,
|
|
||||||
2025-04-21T15:42:05+08:00,short,33,1124,41458,10,
|
|
||||||
2025-04-21T15:42:05+08:00,short,31,1209,42973,10,
|
|
||||||
2025-04-21T15:42:05+08:00,short,36,1260,45000,10,
|
|
||||||
2025-04-21T15:42:05+08:00,long,301,1254,45741,10,
|
|
||||||
2025-04-21T15:42:05+08:00,short,0,0,60025,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:42:05+08:00,long,0,0,60024,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:42:05+08:00,long,0,0,60024,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:42:05+08:00,long,0,0,60027,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:42:43+08:00,short,30,627,24785,10,
|
|
||||||
2025-04-21T15:42:41+08:00,short,33,880,33993,10,
|
|
||||||
2025-04-21T15:42:46+08:00,short,33,763,29495,10,
|
|
||||||
2025-04-21T15:42:48+08:00,short,32,867,34001,10,
|
|
||||||
2025-04-21T15:42:51+08:00,short,32,878,33547,10,
|
|
||||||
2025-04-21T15:43:08+08:00,short,34,959,36283,10,
|
|
||||||
2025-04-21T15:43:05+08:00,short,32,1059,40263,10,
|
|
||||||
2025-04-21T15:42:50+08:00,long,0,0,60001,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:43:05+08:00,long,302,1515,55759,10,
|
|
||||||
2025-04-21T15:43:05+08:00,short,32,1480,55895,10,
|
|
||||||
2025-04-21T15:43:05+08:00,long,0,0,60025,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:43:44+08:00,short,34,663,25933,10,
|
|
||||||
2025-04-21T15:43:16+08:00,long,302,1503,55131,10,
|
|
||||||
2025-04-21T15:43:24+08:00,short,34,1385,50030,10,
|
|
||||||
2025-04-21T15:43:16+08:00,long,290,1646,59167,10,
|
|
||||||
2025-04-21T15:43:22+08:00,short,31,1512,56955,10,
|
|
||||||
2025-04-21T15:43:45+08:00,short,28,1248,47396,10,
|
|
||||||
2025-04-21T15:44:05+08:00,short,34,945,35028,10,
|
|
||||||
2025-04-21T15:44:01+08:00,short,35,1134,43283,10,
|
|
||||||
2025-04-21T15:44:15+08:00,short,35,921,32485,10,
|
|
||||||
2025-04-21T15:43:50+08:00,short,34,1628,59025,10,
|
|
||||||
2025-04-21T15:44:11+08:00,short,31,1160,42541,10,
|
|
||||||
2025-04-21T15:44:15+08:00,short,34,1036,41375,10,
|
|
||||||
2025-04-21T15:44:01+08:00,long,286,1507,56831,10,
|
|
||||||
2025-04-21T15:44:48+08:00,short,28,345,13944,10,
|
|
||||||
2025-04-21T15:44:33+08:00,short,28,965,35746,10,
|
|
||||||
2025-04-21T15:44:10+08:00,short,34,1640,59733,10,
|
|
||||||
2025-04-21T15:44:19+08:00,short,31,1563,55769,10,
|
|
||||||
2025-04-21T15:44:54+08:00,short,37,721,27026,10,
|
|
||||||
2025-04-21T15:44:44+08:00,long,291,1268,45194,10,
|
|
||||||
2025-04-21T15:44:58+08:00,short,30,800,31400,10,
|
|
||||||
2025-04-21T15:44:40+08:00,long,287,1422,54009,10,
|
|
||||||
2025-04-21T15:44:49+08:00,short,32,1479,52350,10,
|
|
||||||
2025-04-21T15:45:15+08:00,short,31,728,27863,10,
|
|
||||||
2025-04-21T15:45:09+08:00,short,35,1127,42373,10,
|
|
||||||
2025-04-21T15:44:56+08:00,short,0,0,60001,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:45:02+08:00,short,34,1491,55425,10,
|
|
||||||
2025-04-21T15:45:10+08:00,short,0,0,60001,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:45:43+08:00,short,31,814,32256,10,
|
|
||||||
2025-04-21T15:45:21+08:00,long,0,0,60001,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:45:51+08:00,short,33,808,31357,10,
|
|
||||||
2025-04-21T15:45:30+08:00,long,302,1447,54647,10,
|
|
||||||
2025-04-21T15:45:56+08:00,short,36,761,29637,10,
|
|
||||||
2025-04-21T15:45:42+08:00,short,34,1214,45591,10,
|
|
||||||
2025-04-21T15:45:35+08:00,short,29,1465,54649,10,
|
|
||||||
2025-04-21T15:45:29+08:00,long,0,0,60000,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:45:58+08:00,short,35,874,34326,10,
|
|
||||||
2025-04-21T15:46:10+08:00,short,27,1111,41640,10,
|
|
||||||
2025-04-21T15:46:21+08:00,short,32,816,32250,10,
|
|
||||||
2025-04-21T15:46:29+08:00,short,32,709,25910,10,
|
|
||||||
2025-04-21T15:46:25+08:00,short,37,863,31820,10,
|
|
||||||
2025-04-21T15:46:32+08:00,short,31,652,24537,10,
|
|
||||||
2025-04-21T15:46:28+08:00,short,30,1034,37449,10,
|
|
||||||
2025-04-21T15:46:15+08:00,long,0,0,60001,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:46:54+08:00,short,28,607,23222,10,
|
|
||||||
2025-04-21T15:46:26+08:00,long,294,1390,51678,10,
|
|
||||||
2025-04-21T15:46:56+08:00,short,28,705,26915,10,
|
|
||||||
2025-04-21T15:46:23+08:00,long,0,0,60001,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:46:57+08:00,short,33,818,30689,10,
|
|
||||||
2025-04-21T15:46:30+08:00,short,0,0,60030,10,发送请求失败: timeout
|
|
||||||
2025-04-21T15:46:57+08:00,short,37,1139,40595,10,
|
|
||||||
2025-04-21T15:46:52+08:00,long,293,1659,57231,10,
|
|
||||||
2025-04-21T15:47:30+08:00,short,32,781,24085,10,
|
|
||||||
2025-04-21T15:47:06+08:00,long,300,1785,55860,10,
|
|
||||||
2025-04-21T15:47:49+08:00,long,297,1450,40171,10,
|
|
||||||
|
@@ -1,104 +0,0 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>LLM API 基准测试报告</title>
|
|
||||||
<script src="https://go-echarts.github.io/go-echarts-assets/assets/echarts.min.js"></script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<style> .container {display: flex;justify-content: center;align-items: center;} .item {margin: auto;} </style>
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="EHMZswDJUWqH" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_EHMZswDJUWqH = echarts.init(document.getElementById('EHMZswDJUWqH'), "white");
|
|
||||||
let option_EHMZswDJUWqH = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"响应时间","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":0},{"value":0},{"value":0},{"value":0}]}],"title":{"text":"性能指标概述"},"tooltip":{"show":false},"xAxis":[{"data":["平均响应时间 (ms)","P90响应时间 (ms)","P95响应时间 (ms)","P99响应时间 (ms)"]}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_EHMZswDJUWqH = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_EHMZswDJUWqH.setOption(option_EHMZswDJUWqH);
|
|
||||||
goecharts_EHMZswDJUWqH.dispatchAction(action_EHMZswDJUWqH);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="FLqyKjIZgeEc" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_FLqyKjIZgeEc = echarts.init(document.getElementById('FLqyKjIZgeEc'), "white");
|
|
||||||
let option_FLqyKjIZgeEc = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"请求数","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0}]}],"title":{"text":"响应时间分布"},"tooltip":{"show":false},"xAxis":[{"data":["≤100ms","100-200ms","200-500ms","500-1000ms","1000-2000ms","2000-5000ms","5000-10000ms",">10000ms"]}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_FLqyKjIZgeEc = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_FLqyKjIZgeEc.setOption(option_FLqyKjIZgeEc);
|
|
||||||
goecharts_FLqyKjIZgeEc.dispatchAction(action_FLqyKjIZgeEc);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="RXbTCdDVHsPX" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_RXbTCdDVHsPX = echarts.init(document.getElementById('RXbTCdDVHsPX'), "white");
|
|
||||||
let option_RXbTCdDVHsPX = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":null,"title":{"text":"QPS随时间变化"},"tooltip":{"show":false},"xAxis":[{}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_RXbTCdDVHsPX = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_RXbTCdDVHsPX.setOption(option_RXbTCdDVHsPX);
|
|
||||||
goecharts_RXbTCdDVHsPX.dispatchAction(action_RXbTCdDVHsPX);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="XNYfcbGGZVDe" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_XNYfcbGGZVDe = echarts.init(document.getElementById('XNYfcbGGZVDe'), "white");
|
|
||||||
let option_XNYfcbGGZVDe = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":null,"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_XNYfcbGGZVDe = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_XNYfcbGGZVDe.setOption(option_XNYfcbGGZVDe);
|
|
||||||
goecharts_XNYfcbGGZVDe.dispatchAction(action_XNYfcbGGZVDe);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="odZNEMJQVnFD" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_odZNEMJQVnFD = echarts.init(document.getElementById('odZNEMJQVnFD'), "white");
|
|
||||||
let option_odZNEMJQVnFD = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"平均响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":null},{"name":"P90响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":null},{"name":"P95响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":null}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":[]}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_odZNEMJQVnFD = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_odZNEMJQVnFD.setOption(option_odZNEMJQVnFD);
|
|
||||||
goecharts_odZNEMJQVnFD.dispatchAction(action_odZNEMJQVnFD);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,Error
|
|
||||||
|
@@ -1,104 +0,0 @@
|
|||||||
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>LLM API 基准测试报告</title>
|
|
||||||
<script src="https://go-echarts.github.io/go-echarts-assets/assets/echarts.min.js"></script>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<style> .container {display: flex;justify-content: center;align-items: center;} .item {margin: auto;} </style>
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="VtXivSkVGWsI" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_VtXivSkVGWsI = echarts.init(document.getElementById('VtXivSkVGWsI'), "white");
|
|
||||||
let option_VtXivSkVGWsI = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"响应时间","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":0},{"value":0},{"value":0},{"value":0}]}],"title":{"text":"性能指标概述"},"tooltip":{"show":false},"xAxis":[{"data":["平均响应时间 (ms)","P90响应时间 (ms)","P95响应时间 (ms)","P99响应时间 (ms)"]}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_VtXivSkVGWsI = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_VtXivSkVGWsI.setOption(option_VtXivSkVGWsI);
|
|
||||||
goecharts_VtXivSkVGWsI.dispatchAction(action_VtXivSkVGWsI);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="vwmlpHKQyHVV" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_vwmlpHKQyHVV = echarts.init(document.getElementById('vwmlpHKQyHVV'), "white");
|
|
||||||
let option_vwmlpHKQyHVV = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"请求数","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0}]}],"title":{"text":"响应时间分布"},"tooltip":{"show":false},"xAxis":[{"data":["≤100ms","100-200ms","200-500ms","500-1000ms","1000-2000ms","2000-5000ms","5000-10000ms",">10000ms"]}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_vwmlpHKQyHVV = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_vwmlpHKQyHVV.setOption(option_vwmlpHKQyHVV);
|
|
||||||
goecharts_vwmlpHKQyHVV.dispatchAction(action_vwmlpHKQyHVV);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="ONXViPrQSJxX" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_ONXViPrQSJxX = echarts.init(document.getElementById('ONXViPrQSJxX'), "white");
|
|
||||||
let option_ONXViPrQSJxX = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":null,"title":{"text":"QPS随时间变化"},"tooltip":{"show":false},"xAxis":[{}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_ONXViPrQSJxX = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_ONXViPrQSJxX.setOption(option_ONXViPrQSJxX);
|
|
||||||
goecharts_ONXViPrQSJxX.dispatchAction(action_ONXViPrQSJxX);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="KFGiaxLKrHzO" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_KFGiaxLKrHzO = echarts.init(document.getElementById('KFGiaxLKrHzO'), "white");
|
|
||||||
let option_KFGiaxLKrHzO = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":null,"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_KFGiaxLKrHzO = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_KFGiaxLKrHzO.setOption(option_KFGiaxLKrHzO);
|
|
||||||
goecharts_KFGiaxLKrHzO.dispatchAction(action_KFGiaxLKrHzO);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<div class="item" id="eUNIZaAWZYZJ" style="width:900px;height:500px;"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
"use strict";
|
|
||||||
let goecharts_eUNIZaAWZYZJ = echarts.init(document.getElementById('eUNIZaAWZYZJ'), "white");
|
|
||||||
let option_eUNIZaAWZYZJ = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"平均响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":null},{"name":"P90响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":null},{"name":"P95响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":null}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":[]}],"yAxis":[{}]}
|
|
||||||
;
|
|
||||||
|
|
||||||
let action_eUNIZaAWZYZJ = {"areas":{},"type":""}
|
|
||||||
;
|
|
||||||
|
|
||||||
goecharts_eUNIZaAWZYZJ.setOption(option_eUNIZaAWZYZJ);
|
|
||||||
goecharts_eUNIZaAWZYZJ.dispatchAction(action_eUNIZaAWZYZJ);
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,Error
|
|
||||||
|
@@ -0,0 +1,54 @@
|
|||||||
|
[2025-04-21 23:40:54.518] [信息] 日志文件已设置: reports/report_2025-04-21_23-40-54/api_logs.txt
|
||||||
|
[2025-04-21 23:40:54.518] [信息] API请求响应日志将记录到: reports/report_2025-04-21_23-40-54/api_logs.txt
|
||||||
|
[2025-04-21 23:40:54.518] [信息] 创建报告输出目录: reports/report_2025-04-21_23-40-54
|
||||||
|
[2025-04-21 23:40:54.518] [调试] 共有 2 条测试结果记录
|
||||||
|
[2025-04-21 23:40:54.518] [信息] 计算性能指标...
|
||||||
|
[2025-04-21 23:40:54.518] [调试] 计算指标 - 总请求数: 2
|
||||||
|
[2025-04-21 23:40:54.518] [调试] 计算指标 - 成功请求: 2, 失败请求: 0
|
||||||
|
[2025-04-21 23:40:54.518] [调试] 计算指标 - 超时比率: 0.00%
|
||||||
|
[2025-04-21 23:40:54.518] [调试] 计算指标 - 响应时间(ms) - 平均: 37744.50, P90: 37744.50, P95: 37744.50, P99: 37744.50, 最小: 20615.00, 最大: 54874.00
|
||||||
|
[2025-04-21 23:40:54.518] [调试] 计算指标 - TTFT(ms) - 最小: 10506.00, 最大: 15294.00, P90: 12900.00, P95: 12900.00, P99: 12900.00
|
||||||
|
[2025-04-21 23:40:54.518] [调试] 计算指标 - 平均QPS: 0.03 (总持续时间: 75.52秒)
|
||||||
|
[2025-04-21 23:40:54.518] [调试] 计算各并发步骤的QPS...
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 并发步骤 1: QPS = 0.10 (成功请求: 2, 持续时间: 20.63秒)
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 更新最大QPS: 0.10 (并发步骤: 1)
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 更新最大有效并发用户数: 1
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 计算指标 - 平均Token生成速率: 17.07 tokens/s (总Token: 1289)
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 计算各并发步骤的Token生成速率...
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 并发步骤 1: Token生成速率 = 62.49 tokens/s (总Token: 1289, 持续时间: 20.63秒)
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 更新最大Token生成速率: 62.49 tokens/s (并发步骤: 1)
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 性能指标摘要:
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 总请求数: 2 (成功: 2, 失败: 0)
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 超时比率: 0.00%
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 平均响应时间: 37.744s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] P90响应时间: 37.744s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] P95响应时间: 37.744s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] P99响应时间: 37.744s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 平均QPS: 0.03
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 最大QPS: 0.10
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 平均Token生成速率: 17.07 tokens/s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 最大Token生成速率: 62.49 tokens/s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 最大有效并发用户数: 1
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 最小首个令牌生成时间: 10.506s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 最大首个令牌生成时间: 15.294s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] P90首个令牌生成时间: 12.9s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] P95首个令牌生成时间: 12.9s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] P99首个令牌生成时间: 12.9s
|
||||||
|
[2025-04-21 23:40:54.519] [信息] 生成HTML报告...
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 创建HTML报告页面...
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 添加概述图表...
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 添加响应时间分布图...
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 添加QPS随时间变化图...
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 添加Token生成速率随时间变化图...
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 添加并发与响应时间关系图...
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 添加TTFT随时间变化图...
|
||||||
|
[2025-04-21 23:40:54.519] [调试] 保存HTML报告: reports/report_2025-04-21_23-40-54/report.html
|
||||||
|
[2025-04-21 23:40:54.523] [信息] 生成CSV数据...
|
||||||
|
[2025-04-21 23:40:54.523] [调试] 创建CSV文件: reports/report_2025-04-21_23-40-54/results.csv
|
||||||
|
[2025-04-21 23:40:54.524] [调试] 写入CSV头...
|
||||||
|
[2025-04-21 23:40:54.524] [调试] 写入CSV数据,共2条记录...
|
||||||
|
[2025-04-21 23:40:54.524] [调试] CSV数据写入完成
|
||||||
|
[2025-04-21 23:40:54.524] [信息] 报告生成完成
|
||||||
|
[2025-04-21 23:40:54.524] [信息] 基准测试完成!报告已生成: reports/report_2025-04-21_23-40-54
|
||||||
|
[2025-04-21 23:40:54.524] [信息] HTML报告: reports/report_2025-04-21_23-40-54/report.html
|
||||||
|
[2025-04-21 23:40:54.524] [信息] CSV数据: reports/report_2025-04-21_23-40-54/results.csv
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>LLM API 基准测试报告</title>
|
||||||
|
<script src="https://go-echarts.github.io/go-echarts-assets/assets/echarts.min.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style> .container {display: flex;justify-content: center;align-items: center;} .item {margin: auto;} </style>
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="aSfAGplLSteQ" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_aSfAGplLSteQ = echarts.init(document.getElementById('aSfAGplLSteQ'), "white");
|
||||||
|
let option_aSfAGplLSteQ = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"指标","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":2},{"value":2},{"value":0},{"value":37744},{"value":37744},{"value":37744},{"value":37744},{"value":10506},{"value":15294},{"value":12900},{"value":12900},{"value":12900},{"value":0.026483034073583565},{"value":0.0969595779155654}]}],"title":{"text":"性能概览"},"tooltip":{"show":false},"xAxis":[{"data":["总请求数","成功请求数","失败请求数","平均响应时间(ms)","P90响应时间(ms)","P95响应时间(ms)","P99响应时间(ms)","最小TTFT(ms)","最大TTFT(ms)","P90 TTFT(ms)","P95 TTFT(ms)","P99 TTFT(ms)","平均QPS","最大QPS"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_aSfAGplLSteQ = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_aSfAGplLSteQ.setOption(option_aSfAGplLSteQ);
|
||||||
|
goecharts_aSfAGplLSteQ.dispatchAction(action_aSfAGplLSteQ);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="DwwvtKaQhzEF" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_DwwvtKaQhzEF = echarts.init(document.getElementById('DwwvtKaQhzEF'), "white");
|
||||||
|
let option_DwwvtKaQhzEF = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"请求数","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":2}]}],"title":{"text":"响应时间分布"},"tooltip":{"show":false},"xAxis":[{"data":["≤100ms","100-200ms","200-500ms","500-1000ms","1000-2000ms","2000-5000ms","5000-10000ms",">10000ms"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_DwwvtKaQhzEF = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_DwwvtKaQhzEF.setOption(option_DwwvtKaQhzEF);
|
||||||
|
goecharts_DwwvtKaQhzEF.dispatchAction(action_DwwvtKaQhzEF);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="HVWnzNBZKEAc" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_HVWnzNBZKEAc = echarts.init(document.getElementById('HVWnzNBZKEAc'), "white");
|
||||||
|
let option_HVWnzNBZKEAc = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"QPS随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["23:39:38","23:39:43","23:39:48","23:39:53","23:39:58"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_HVWnzNBZKEAc = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_HVWnzNBZKEAc.setOption(option_HVWnzNBZKEAc);
|
||||||
|
goecharts_HVWnzNBZKEAc.dispatchAction(action_HVWnzNBZKEAc);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="mGFdYgsCXCiS" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_mGFdYgsCXCiS = echarts.init(document.getElementById('mGFdYgsCXCiS'), "white");
|
||||||
|
let option_mGFdYgsCXCiS = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":49,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":208.8,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["23:39:38","23:39:43","23:39:48","23:39:53","23:39:58"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_mGFdYgsCXCiS = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_mGFdYgsCXCiS.setOption(option_mGFdYgsCXCiS);
|
||||||
|
goecharts_mGFdYgsCXCiS.dispatchAction(action_mGFdYgsCXCiS);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="DDTOFvXWYtEp" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_DDTOFvXWYtEp = echarts.init(document.getElementById('DDTOFvXWYtEp'), "white");
|
||||||
|
let option_DDTOFvXWYtEp = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"平均响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":37744.5,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P90响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":37744.5,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P95响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":37744.5,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_DDTOFvXWYtEp = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_DDTOFvXWYtEp.setOption(option_DDTOFvXWYtEp);
|
||||||
|
goecharts_DDTOFvXWYtEp.dispatchAction(action_DDTOFvXWYtEp);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="dFAjzCwOpWsz" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_dFAjzCwOpWsz = echarts.init(document.getElementById('dFAjzCwOpWsz'), "white");
|
||||||
|
let option_dFAjzCwOpWsz = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":10506,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":15294,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["23:39:38","23:39:43","23:39:48","23:39:53","23:39:58"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_dFAjzCwOpWsz = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_dFAjzCwOpWsz.setOption(option_dFAjzCwOpWsz);
|
||||||
|
goecharts_dFAjzCwOpWsz.dispatchAction(action_dFAjzCwOpWsz);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error
|
||||||
|
2025-04-21T23:39:38+08:00,short,2,245,20615,1,10506,
|
||||||
|
2025-04-21T23:39:59+08:00,long,2,1044,54874,1,15294,
|
||||||
|
@@ -0,0 +1,54 @@
|
|||||||
|
[2025-04-22 09:10:45.690] [信息] 日志文件已设置: reports/report_2025-04-22_09-10-45/api_logs.txt
|
||||||
|
[2025-04-22 09:10:45.690] [信息] API请求响应日志将记录到: reports/report_2025-04-22_09-10-45/api_logs.txt
|
||||||
|
[2025-04-22 09:10:45.690] [信息] 创建报告输出目录: reports/report_2025-04-22_09-10-45
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 共有 2 条测试结果记录
|
||||||
|
[2025-04-22 09:10:45.690] [信息] 计算性能指标...
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 计算指标 - 总请求数: 2
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 计算指标 - 成功请求: 2, 失败请求: 0
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 计算指标 - 超时比率: 0.00%
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 计算指标 - 响应时间(ms) - 平均: 26983.00, P90: 26983.00, P95: 26983.00, P99: 26983.00, 最小: 25002.00, 最大: 28964.00
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 计算指标 - TTFT(ms) - 最小: 9717.00, 最大: 15743.00, P90: 12730.00, P95: 12730.00, P99: 12730.00
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 计算指标 - 平均QPS: 0.04 (总持续时间: 53.99秒)
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 计算各并发步骤的QPS...
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 并发步骤 1: QPS = 0.08 (成功请求: 2, 持续时间: 25.02秒)
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 更新最大QPS: 0.08 (并发步骤: 1)
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 更新最大有效并发用户数: 1
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 计算指标 - 平均Token生成速率: 16.19 tokens/s (总Token: 874)
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 计算各并发步骤的Token生成速率...
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 并发步骤 1: Token生成速率 = 34.94 tokens/s (总Token: 874, 持续时间: 25.02秒)
|
||||||
|
[2025-04-22 09:10:45.690] [调试] 更新最大Token生成速率: 34.94 tokens/s (并发步骤: 1)
|
||||||
|
[2025-04-22 09:10:45.690] [信息] 性能指标摘要:
|
||||||
|
[2025-04-22 09:10:45.690] [信息] 总请求数: 2 (成功: 2, 失败: 0)
|
||||||
|
[2025-04-22 09:10:45.690] [信息] 超时比率: 0.00%
|
||||||
|
[2025-04-22 09:10:45.690] [信息] 平均响应时间: 26.983s
|
||||||
|
[2025-04-22 09:10:45.690] [信息] P90响应时间: 26.983s
|
||||||
|
[2025-04-22 09:10:45.690] [信息] P95响应时间: 26.983s
|
||||||
|
[2025-04-22 09:10:45.691] [信息] P99响应时间: 26.983s
|
||||||
|
[2025-04-22 09:10:45.691] [信息] 平均QPS: 0.04
|
||||||
|
[2025-04-22 09:10:45.691] [信息] 最大QPS: 0.08
|
||||||
|
[2025-04-22 09:10:45.691] [信息] 平均Token生成速率: 16.19 tokens/s
|
||||||
|
[2025-04-22 09:10:45.691] [信息] 最大Token生成速率: 34.94 tokens/s
|
||||||
|
[2025-04-22 09:10:45.691] [信息] 最大有效并发用户数: 1
|
||||||
|
[2025-04-22 09:10:45.691] [信息] 最小首个令牌生成时间: 9.717s
|
||||||
|
[2025-04-22 09:10:45.691] [信息] 最大首个令牌生成时间: 15.743s
|
||||||
|
[2025-04-22 09:10:45.691] [信息] P90首个令牌生成时间: 12.73s
|
||||||
|
[2025-04-22 09:10:45.691] [信息] P95首个令牌生成时间: 12.73s
|
||||||
|
[2025-04-22 09:10:45.691] [信息] P99首个令牌生成时间: 12.73s
|
||||||
|
[2025-04-22 09:10:45.691] [信息] 生成HTML报告...
|
||||||
|
[2025-04-22 09:10:45.691] [调试] 创建HTML报告页面...
|
||||||
|
[2025-04-22 09:10:45.691] [调试] 添加概述图表...
|
||||||
|
[2025-04-22 09:10:45.691] [调试] 添加响应时间分布图...
|
||||||
|
[2025-04-22 09:10:45.691] [调试] 添加QPS随时间变化图...
|
||||||
|
[2025-04-22 09:10:45.691] [调试] 添加Token生成速率随时间变化图...
|
||||||
|
[2025-04-22 09:10:45.691] [调试] 添加并发与响应时间关系图...
|
||||||
|
[2025-04-22 09:10:45.691] [调试] 添加TTFT随时间变化图...
|
||||||
|
[2025-04-22 09:10:45.691] [调试] 保存HTML报告: reports/report_2025-04-22_09-10-45/report.html
|
||||||
|
[2025-04-22 09:10:45.696] [信息] 生成CSV数据...
|
||||||
|
[2025-04-22 09:10:45.696] [调试] 创建CSV文件: reports/report_2025-04-22_09-10-45/results.csv
|
||||||
|
[2025-04-22 09:10:45.696] [调试] 写入CSV头...
|
||||||
|
[2025-04-22 09:10:45.696] [调试] 写入CSV数据,共2条记录...
|
||||||
|
[2025-04-22 09:10:45.696] [调试] CSV数据写入完成
|
||||||
|
[2025-04-22 09:10:45.696] [信息] 报告生成完成
|
||||||
|
[2025-04-22 09:10:45.696] [信息] 基准测试完成!报告已生成: reports/report_2025-04-22_09-10-45
|
||||||
|
[2025-04-22 09:10:45.696] [信息] HTML报告: reports/report_2025-04-22_09-10-45/report.html
|
||||||
|
[2025-04-22 09:10:45.696] [信息] CSV数据: reports/report_2025-04-22_09-10-45/results.csv
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>LLM API 基准测试报告</title>
|
||||||
|
<script src="https://go-echarts.github.io/go-echarts-assets/assets/echarts.min.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style> .container {display: flex;justify-content: center;align-items: center;} .item {margin: auto;} </style>
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="RDxSTLsbVdgW" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_RDxSTLsbVdgW = echarts.init(document.getElementById('RDxSTLsbVdgW'), "white");
|
||||||
|
let option_RDxSTLsbVdgW = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"指标","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":2},{"value":2},{"value":0},{"value":26983},{"value":26983},{"value":26983},{"value":26983},{"value":9717},{"value":15743},{"value":12730},{"value":12730},{"value":12730},{"value":0.0370426018586236},{"value":0.07995193423073874}]}],"title":{"text":"性能概览"},"tooltip":{"show":false},"xAxis":[{"data":["总请求数","成功请求数","失败请求数","平均响应时间(ms)","P90响应时间(ms)","P95响应时间(ms)","P99响应时间(ms)","最小TTFT(ms)","最大TTFT(ms)","P90 TTFT(ms)","P95 TTFT(ms)","P99 TTFT(ms)","平均QPS","最大QPS"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_RDxSTLsbVdgW = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_RDxSTLsbVdgW.setOption(option_RDxSTLsbVdgW);
|
||||||
|
goecharts_RDxSTLsbVdgW.dispatchAction(action_RDxSTLsbVdgW);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="HSlNJAzWnDbu" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_HSlNJAzWnDbu = echarts.init(document.getElementById('HSlNJAzWnDbu'), "white");
|
||||||
|
let option_HSlNJAzWnDbu = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"请求数","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":2}]}],"title":{"text":"响应时间分布"},"tooltip":{"show":false},"xAxis":[{"data":["≤100ms","100-200ms","200-500ms","500-1000ms","1000-2000ms","2000-5000ms","5000-10000ms",">10000ms"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_HSlNJAzWnDbu = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_HSlNJAzWnDbu.setOption(option_HSlNJAzWnDbu);
|
||||||
|
goecharts_HSlNJAzWnDbu.dispatchAction(action_HSlNJAzWnDbu);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="bLNYJSVJEGBg" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_bLNYJSVJEGBg = echarts.init(document.getElementById('bLNYJSVJEGBg'), "white");
|
||||||
|
let option_bLNYJSVJEGBg = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"QPS随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["09:09:51","09:09:56","09:10:01","09:10:06","09:10:11","09:10:16"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_bLNYJSVJEGBg = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_bLNYJSVJEGBg.setOption(option_bLNYJSVJEGBg);
|
||||||
|
goecharts_bLNYJSVJEGBg.dispatchAction(action_bLNYJSVJEGBg);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="LcGyNaPBjOPf" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_LcGyNaPBjOPf = echarts.init(document.getElementById('LcGyNaPBjOPf'), "white");
|
||||||
|
let option_LcGyNaPBjOPf = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":71.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":103.6,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["09:09:51","09:09:56","09:10:01","09:10:06","09:10:11","09:10:16"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_LcGyNaPBjOPf = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_LcGyNaPBjOPf.setOption(option_LcGyNaPBjOPf);
|
||||||
|
goecharts_LcGyNaPBjOPf.dispatchAction(action_LcGyNaPBjOPf);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="LZrARhTNbPPR" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_LZrARhTNbPPR = echarts.init(document.getElementById('LZrARhTNbPPR'), "white");
|
||||||
|
let option_LZrARhTNbPPR = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"平均响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":26983,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P90响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":26983,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P95响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":26983,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_LZrARhTNbPPR = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_LZrARhTNbPPR.setOption(option_LZrARhTNbPPR);
|
||||||
|
goecharts_LZrARhTNbPPR.dispatchAction(action_LZrARhTNbPPR);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="RIAyeIxXZKcM" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_RIAyeIxXZKcM = echarts.init(document.getElementById('RIAyeIxXZKcM'), "white");
|
||||||
|
let option_RIAyeIxXZKcM = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":9717,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":15743,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["09:09:51","09:09:56","09:10:01","09:10:06","09:10:11","09:10:16"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_RIAyeIxXZKcM = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_RIAyeIxXZKcM.setOption(option_RIAyeIxXZKcM);
|
||||||
|
goecharts_RIAyeIxXZKcM.dispatchAction(action_RIAyeIxXZKcM);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error
|
||||||
|
2025-04-22T09:09:51+08:00,short,2,356,25002,1,9717,
|
||||||
|
2025-04-22T09:10:16+08:00,short,2,518,28964,1,15743,
|
||||||
|
@@ -0,0 +1,54 @@
|
|||||||
|
[2025-04-22 09:29:05.516] [信息] 日志文件已设置: reports/report_2025-04-22_09-29-05/api_logs.txt
|
||||||
|
[2025-04-22 09:29:05.516] [信息] API请求响应日志将记录到: reports/report_2025-04-22_09-29-05/api_logs.txt
|
||||||
|
[2025-04-22 09:29:05.516] [信息] 创建报告输出目录: reports/report_2025-04-22_09-29-05
|
||||||
|
[2025-04-22 09:29:05.516] [调试] 共有 2 条测试结果记录
|
||||||
|
[2025-04-22 09:29:05.516] [信息] 计算性能指标...
|
||||||
|
[2025-04-22 09:29:05.516] [调试] 计算指标 - 总请求数: 2
|
||||||
|
[2025-04-22 09:29:05.516] [调试] 计算指标 - 成功请求: 2, 失败请求: 0
|
||||||
|
[2025-04-22 09:29:05.516] [调试] 计算指标 - 超时比率: 0.00%
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 计算指标 - 响应时间(ms) - 平均: 18841.50, P90: 18841.50, P95: 18841.50, P99: 18841.50, 最小: 12913.00, 最大: 24770.00
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 计算指标 - TTFT(ms) - 最小: 4893.00, 最大: 11289.00, P90: 8091.00, P95: 8091.00, P99: 8091.00
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 计算指标 - 平均QPS: 0.05 (总持续时间: 37.71秒)
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 计算各并发步骤的QPS...
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 并发步骤 1: QPS = 0.15 (成功请求: 2, 持续时间: 12.93秒)
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 更新最大QPS: 0.15 (并发步骤: 1)
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 更新最大有效并发用户数: 1
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 计算指标 - 平均Token生成速率: 13.31 tokens/s (总Token: 502)
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 计算各并发步骤的Token生成速率...
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 并发步骤 1: Token生成速率 = 38.84 tokens/s (总Token: 502, 持续时间: 12.93秒)
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 更新最大Token生成速率: 38.84 tokens/s (并发步骤: 1)
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 性能指标摘要:
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 总请求数: 2 (成功: 2, 失败: 0)
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 超时比率: 0.00%
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 平均响应时间: 18.841s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] P90响应时间: 18.841s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] P95响应时间: 18.841s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] P99响应时间: 18.841s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 平均QPS: 0.05
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 最大QPS: 0.15
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 平均Token生成速率: 13.31 tokens/s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 最大Token生成速率: 38.84 tokens/s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 最大有效并发用户数: 1
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 最小首个令牌生成时间: 4.893s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 最大首个令牌生成时间: 11.289s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] P90首个令牌生成时间: 8.091s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] P95首个令牌生成时间: 8.091s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] P99首个令牌生成时间: 8.091s
|
||||||
|
[2025-04-22 09:29:05.517] [信息] 生成HTML报告...
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 创建HTML报告页面...
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 添加概述图表...
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 添加响应时间分布图...
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 添加QPS随时间变化图...
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 添加Token生成速率随时间变化图...
|
||||||
|
[2025-04-22 09:29:05.517] [调试] 添加并发与响应时间关系图...
|
||||||
|
[2025-04-22 09:29:05.518] [调试] 添加TTFT随时间变化图...
|
||||||
|
[2025-04-22 09:29:05.518] [调试] 保存HTML报告: reports/report_2025-04-22_09-29-05/report.html
|
||||||
|
[2025-04-22 09:29:05.522] [信息] 生成CSV数据...
|
||||||
|
[2025-04-22 09:29:05.522] [调试] 创建CSV文件: reports/report_2025-04-22_09-29-05/results.csv
|
||||||
|
[2025-04-22 09:29:05.522] [调试] 写入CSV头...
|
||||||
|
[2025-04-22 09:29:05.523] [调试] 写入CSV数据,共2条记录...
|
||||||
|
[2025-04-22 09:29:05.523] [调试] CSV数据写入完成
|
||||||
|
[2025-04-22 09:29:05.523] [信息] 报告生成完成
|
||||||
|
[2025-04-22 09:29:05.523] [信息] 基准测试完成!报告已生成: reports/report_2025-04-22_09-29-05
|
||||||
|
[2025-04-22 09:29:05.523] [信息] HTML报告: reports/report_2025-04-22_09-29-05/report.html
|
||||||
|
[2025-04-22 09:29:05.523] [信息] CSV数据: reports/report_2025-04-22_09-29-05/results.csv
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>LLM API 基准测试报告</title>
|
||||||
|
<script src="https://go-echarts.github.io/go-echarts-assets/assets/echarts.min.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style> .container {display: flex;justify-content: center;align-items: center;} .item {margin: auto;} </style>
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="AwvUXLXuFZLT" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_AwvUXLXuFZLT = echarts.init(document.getElementById('AwvUXLXuFZLT'), "white");
|
||||||
|
let option_AwvUXLXuFZLT = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"指标","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":2},{"value":2},{"value":0},{"value":18841},{"value":18841},{"value":18841},{"value":18841},{"value":4893},{"value":11289},{"value":8091},{"value":8091},{"value":8091},{"value":0.053039909482090475},{"value":0.1547379777536688}]}],"title":{"text":"性能概览"},"tooltip":{"show":false},"xAxis":[{"data":["总请求数","成功请求数","失败请求数","平均响应时间(ms)","P90响应时间(ms)","P95响应时间(ms)","P99响应时间(ms)","最小TTFT(ms)","最大TTFT(ms)","P90 TTFT(ms)","P95 TTFT(ms)","P99 TTFT(ms)","平均QPS","最大QPS"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_AwvUXLXuFZLT = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_AwvUXLXuFZLT.setOption(option_AwvUXLXuFZLT);
|
||||||
|
goecharts_AwvUXLXuFZLT.dispatchAction(action_AwvUXLXuFZLT);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="suXYqKbJcyEu" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_suXYqKbJcyEu = echarts.init(document.getElementById('suXYqKbJcyEu'), "white");
|
||||||
|
let option_suXYqKbJcyEu = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"请求数","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":2}]}],"title":{"text":"响应时间分布"},"tooltip":{"show":false},"xAxis":[{"data":["≤100ms","100-200ms","200-500ms","500-1000ms","1000-2000ms","2000-5000ms","5000-10000ms",">10000ms"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_suXYqKbJcyEu = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_suXYqKbJcyEu.setOption(option_suXYqKbJcyEu);
|
||||||
|
goecharts_suXYqKbJcyEu.dispatchAction(action_suXYqKbJcyEu);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="cGGkRKybMxVY" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_cGGkRKybMxVY = echarts.init(document.getElementById('cGGkRKybMxVY'), "white");
|
||||||
|
let option_cGGkRKybMxVY = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"QPS随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["09:28:27","09:28:32","09:28:37"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_cGGkRKybMxVY = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_cGGkRKybMxVY.setOption(option_cGGkRKybMxVY);
|
||||||
|
goecharts_cGGkRKybMxVY.dispatchAction(action_cGGkRKybMxVY);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="WHZtmUpZaYZt" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_WHZtmUpZaYZt = echarts.init(document.getElementById('WHZtmUpZaYZt'), "white");
|
||||||
|
let option_WHZtmUpZaYZt = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":38.6,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":61.8,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["09:28:27","09:28:32","09:28:37"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_WHZtmUpZaYZt = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_WHZtmUpZaYZt.setOption(option_WHZtmUpZaYZt);
|
||||||
|
goecharts_WHZtmUpZaYZt.dispatchAction(action_WHZtmUpZaYZt);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="LTgCTJEZRELJ" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_LTgCTJEZRELJ = echarts.init(document.getElementById('LTgCTJEZRELJ'), "white");
|
||||||
|
let option_LTgCTJEZRELJ = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"平均响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":18841.5,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P90响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":18841.5,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P95响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":18841.5,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_LTgCTJEZRELJ = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_LTgCTJEZRELJ.setOption(option_LTgCTJEZRELJ);
|
||||||
|
goecharts_LTgCTJEZRELJ.dispatchAction(action_LTgCTJEZRELJ);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="tpHCoPYUQvFP" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_tpHCoPYUQvFP = echarts.init(document.getElementById('tpHCoPYUQvFP'), "white");
|
||||||
|
let option_tpHCoPYUQvFP = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":4893,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":11289,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["09:28:27","09:28:32","09:28:37"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_tpHCoPYUQvFP = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_tpHCoPYUQvFP.setOption(option_tpHCoPYUQvFP);
|
||||||
|
goecharts_tpHCoPYUQvFP.dispatchAction(action_tpHCoPYUQvFP);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error
|
||||||
|
2025-04-22T09:28:27+08:00,short,2,193,12913,1,4893,
|
||||||
|
2025-04-22T09:28:40+08:00,short,2,309,24770,1,11289,
|
||||||
|
@@ -0,0 +1,53 @@
|
|||||||
|
[2025-04-22 10:14:20.443] [信息] 日志文件已设置: reports/report_2025-04-22_10-14-20/api_logs.txt
|
||||||
|
[2025-04-22 10:14:20.443] [信息] API请求响应日志将记录到: reports/report_2025-04-22_10-14-20/api_logs.txt
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 创建报告输出目录: reports/report_2025-04-22_10-14-20
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 共有 2 条测试结果记录
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 计算性能指标...
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 计算指标 - 总请求数: 2
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 计算指标 - 成功请求: 2, 失败请求: 0
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 计算指标 - 超时比率: 0.00%
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 计算指标 - 响应时间(ms) - 平均: 21886.50, P90: 21886.50, P95: 21886.50, P99: 21886.50, 最小: 18505.00, 最大: 25268.00
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 计算指标 - TTFT(ms) - 最小: 500.00, 最大: 500.00, P90: 500.00, P95: 500.00, P99: 500.00
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 计算指标 - 平均QPS: 0.05 (总持续时间: 43.80秒)
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 计算各并发步骤的QPS...
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 并发步骤 1: QPS = 0.11 (成功请求: 2, 持续时间: 18.52秒)
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 更新最大QPS: 0.11 (并发步骤: 1)
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 更新最大有效并发用户数: 1
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 计算指标 - 平均Token生成速率: 0.00 tokens/s (总Token: 0)
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 计算各并发步骤的Token生成速率...
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 并发步骤 1: Token生成速率 = 0.00 tokens/s (总Token: 0, 持续时间: 18.52秒)
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 性能指标摘要:
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 总请求数: 2 (成功: 2, 失败: 0)
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 超时比率: 0.00%
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 平均响应时间: 21.886s
|
||||||
|
[2025-04-22 10:14:20.444] [信息] P90响应时间: 21.886s
|
||||||
|
[2025-04-22 10:14:20.444] [信息] P95响应时间: 21.886s
|
||||||
|
[2025-04-22 10:14:20.444] [信息] P99响应时间: 21.886s
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 平均QPS: 0.05
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 最大QPS: 0.11
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 平均Token生成速率: 0.00 tokens/s
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 最大Token生成速率: 0.00 tokens/s
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 最大有效并发用户数: 1
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 最小首个令牌生成时间: 500ms
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 最大首个令牌生成时间: 500ms
|
||||||
|
[2025-04-22 10:14:20.444] [信息] P90首个令牌生成时间: 500ms
|
||||||
|
[2025-04-22 10:14:20.444] [信息] P95首个令牌生成时间: 500ms
|
||||||
|
[2025-04-22 10:14:20.444] [信息] P99首个令牌生成时间: 500ms
|
||||||
|
[2025-04-22 10:14:20.444] [信息] 生成HTML报告...
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 创建HTML报告页面...
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 添加概述图表...
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 添加响应时间分布图...
|
||||||
|
[2025-04-22 10:14:20.444] [调试] 添加QPS随时间变化图...
|
||||||
|
[2025-04-22 10:14:20.445] [调试] 添加Token生成速率随时间变化图...
|
||||||
|
[2025-04-22 10:14:20.445] [调试] 添加并发与响应时间关系图...
|
||||||
|
[2025-04-22 10:14:20.445] [调试] 添加TTFT随时间变化图...
|
||||||
|
[2025-04-22 10:14:20.445] [调试] 保存HTML报告: reports/report_2025-04-22_10-14-20/report.html
|
||||||
|
[2025-04-22 10:14:20.449] [信息] 生成CSV数据...
|
||||||
|
[2025-04-22 10:14:20.449] [调试] 创建CSV文件: reports/report_2025-04-22_10-14-20/results.csv
|
||||||
|
[2025-04-22 10:14:20.450] [调试] 写入CSV头...
|
||||||
|
[2025-04-22 10:14:20.450] [调试] 写入CSV数据,共2条记录...
|
||||||
|
[2025-04-22 10:14:20.450] [调试] CSV数据写入完成
|
||||||
|
[2025-04-22 10:14:20.450] [信息] 报告生成完成
|
||||||
|
[2025-04-22 10:14:20.450] [信息] 基准测试完成!报告已生成: reports/report_2025-04-22_10-14-20
|
||||||
|
[2025-04-22 10:14:20.450] [信息] HTML报告: reports/report_2025-04-22_10-14-20/report.html
|
||||||
|
[2025-04-22 10:14:20.450] [信息] CSV数据: reports/report_2025-04-22_10-14-20/results.csv
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>LLM API 基准测试报告</title>
|
||||||
|
<script src="https://go-echarts.github.io/go-echarts-assets/assets/echarts.min.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style> .container {display: flex;justify-content: center;align-items: center;} .item {margin: auto;} </style>
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="XTwMLcbAuSPK" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_XTwMLcbAuSPK = echarts.init(document.getElementById('XTwMLcbAuSPK'), "white");
|
||||||
|
let option_XTwMLcbAuSPK = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"指标","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":2},{"value":2},{"value":0},{"value":21886},{"value":21886},{"value":21886},{"value":21886},{"value":500},{"value":500},{"value":500},{"value":500},{"value":500},{"value":0.045662644220524205},{"value":0.10800660233559417}]}],"title":{"text":"性能概览"},"tooltip":{"show":false},"xAxis":[{"data":["总请求数","成功请求数","失败请求数","平均响应时间(ms)","P90响应时间(ms)","P95响应时间(ms)","P99响应时间(ms)","最小TTFT(ms)","最大TTFT(ms)","P90 TTFT(ms)","P95 TTFT(ms)","P99 TTFT(ms)","平均QPS","最大QPS"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_XTwMLcbAuSPK = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_XTwMLcbAuSPK.setOption(option_XTwMLcbAuSPK);
|
||||||
|
goecharts_XTwMLcbAuSPK.dispatchAction(action_XTwMLcbAuSPK);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="FUNLBEXIGiio" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_FUNLBEXIGiio = echarts.init(document.getElementById('FUNLBEXIGiio'), "white");
|
||||||
|
let option_FUNLBEXIGiio = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"请求数","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":2}]}],"title":{"text":"响应时间分布"},"tooltip":{"show":false},"xAxis":[{"data":["≤100ms","100-200ms","200-500ms","500-1000ms","1000-2000ms","2000-5000ms","5000-10000ms",">10000ms"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_FUNLBEXIGiio = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_FUNLBEXIGiio.setOption(option_FUNLBEXIGiio);
|
||||||
|
goecharts_FUNLBEXIGiio.dispatchAction(action_FUNLBEXIGiio);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="DDQxqfKYJnMO" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_DDQxqfKYJnMO = echarts.init(document.getElementById('DDQxqfKYJnMO'), "white");
|
||||||
|
let option_DDQxqfKYJnMO = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0.2,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0.2,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"QPS随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["10:13:36","10:13:41","10:13:46","10:13:51"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_DDQxqfKYJnMO = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_DDQxqfKYJnMO.setOption(option_DDQxqfKYJnMO);
|
||||||
|
goecharts_DDQxqfKYJnMO.dispatchAction(action_DDQxqfKYJnMO);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="dSJcdAecnyzw" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_dSJcdAecnyzw = echarts.init(document.getElementById('dSJcdAecnyzw'), "white");
|
||||||
|
let option_dSJcdAecnyzw = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["10:13:36","10:13:41","10:13:46","10:13:51"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_dSJcdAecnyzw = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_dSJcdAecnyzw.setOption(option_dSJcdAecnyzw);
|
||||||
|
goecharts_dSJcdAecnyzw.dispatchAction(action_dSJcdAecnyzw);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="gOaIJPOMCOTS" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_gOaIJPOMCOTS = echarts.init(document.getElementById('gOaIJPOMCOTS'), "white");
|
||||||
|
let option_gOaIJPOMCOTS = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"平均响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":21886.5,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P90响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":21886.5,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P95响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":21886.5,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_gOaIJPOMCOTS = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_gOaIJPOMCOTS.setOption(option_gOaIJPOMCOTS);
|
||||||
|
goecharts_gOaIJPOMCOTS.dispatchAction(action_gOaIJPOMCOTS);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="UmNTTGmlFlDe" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_UmNTTGmlFlDe = echarts.init(document.getElementById('UmNTTGmlFlDe'), "white");
|
||||||
|
let option_UmNTTGmlFlDe = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":500,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0},{"value":500,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["10:13:36","10:13:41","10:13:46","10:13:51"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_UmNTTGmlFlDe = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_UmNTTGmlFlDe.setOption(option_UmNTTGmlFlDe);
|
||||||
|
goecharts_UmNTTGmlFlDe.dispatchAction(action_UmNTTGmlFlDe);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error
|
||||||
|
2025-04-22T10:13:36+08:00,short,2,0,18505,1,500,
|
||||||
|
2025-04-22T10:13:55+08:00,short,2,0,25268,1,500,
|
||||||
|
@@ -0,0 +1,54 @@
|
|||||||
|
[2025-04-22 10:16:16.046] [信息] 日志文件已设置: reports/report_2025-04-22_10-16-16/api_logs.txt
|
||||||
|
[2025-04-22 10:16:16.046] [信息] API请求响应日志将记录到: reports/report_2025-04-22_10-16-16/api_logs.txt
|
||||||
|
[2025-04-22 10:16:16.046] [信息] 创建报告输出目录: reports/report_2025-04-22_10-16-16
|
||||||
|
[2025-04-22 10:16:16.046] [调试] 共有 3 条测试结果记录
|
||||||
|
[2025-04-22 10:16:16.046] [信息] 计算性能指标...
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 计算指标 - 总请求数: 3
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 计算指标 - 成功请求: 3, 失败请求: 0
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 计算指标 - 超时比率: 0.00%
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 计算指标 - 响应时间(ms) - 平均: 36107.33, P90: 42141.00, P95: 42141.00, P99: 42141.00, 最小: 24040.00, 最大: 44114.00
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 计算指标 - TTFT(ms) - 最小: 500.00, 最大: 500.00, P90: 500.00, P95: 500.00, P99: 500.00
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 计算指标 - 平均QPS: 0.04 (总持续时间: 68.19秒)
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 计算各并发步骤的QPS...
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 并发步骤 1: 持续时间过短
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 并发步骤 2: QPS = 25641.03 (成功请求: 2, 持续时间: 0.00秒)
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 更新最大QPS: 25641.03 (并发步骤: 2)
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 更新最大有效并发用户数: 2
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 计算指标 - 平均Token生成速率: 0.00 tokens/s (总Token: 0)
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 计算各并发步骤的Token生成速率...
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 并发步骤 2: Token生成速率 = 0.00 tokens/s (总Token: 0, 持续时间: 0.00秒)
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 性能指标摘要:
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 总请求数: 3 (成功: 3, 失败: 0)
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 超时比率: 0.00%
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 平均响应时间: 36.107s
|
||||||
|
[2025-04-22 10:16:16.047] [信息] P90响应时间: 42.141s
|
||||||
|
[2025-04-22 10:16:16.047] [信息] P95响应时间: 42.141s
|
||||||
|
[2025-04-22 10:16:16.047] [信息] P99响应时间: 42.141s
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 平均QPS: 0.04
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 最大QPS: 25641.03
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 平均Token生成速率: 0.00 tokens/s
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 最大Token生成速率: 0.00 tokens/s
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 最大有效并发用户数: 2
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 最小首个令牌生成时间: 500ms
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 最大首个令牌生成时间: 500ms
|
||||||
|
[2025-04-22 10:16:16.047] [信息] P90首个令牌生成时间: 500ms
|
||||||
|
[2025-04-22 10:16:16.047] [信息] P95首个令牌生成时间: 500ms
|
||||||
|
[2025-04-22 10:16:16.047] [信息] P99首个令牌生成时间: 500ms
|
||||||
|
[2025-04-22 10:16:16.047] [信息] 生成HTML报告...
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 创建HTML报告页面...
|
||||||
|
[2025-04-22 10:16:16.047] [调试] 添加概述图表...
|
||||||
|
[2025-04-22 10:16:16.048] [调试] 添加响应时间分布图...
|
||||||
|
[2025-04-22 10:16:16.048] [调试] 添加QPS随时间变化图...
|
||||||
|
[2025-04-22 10:16:16.048] [调试] 添加Token生成速率随时间变化图...
|
||||||
|
[2025-04-22 10:16:16.048] [调试] 添加并发与响应时间关系图...
|
||||||
|
[2025-04-22 10:16:16.048] [调试] 添加TTFT随时间变化图...
|
||||||
|
[2025-04-22 10:16:16.048] [调试] 保存HTML报告: reports/report_2025-04-22_10-16-16/report.html
|
||||||
|
[2025-04-22 10:16:16.054] [信息] 生成CSV数据...
|
||||||
|
[2025-04-22 10:16:16.054] [调试] 创建CSV文件: reports/report_2025-04-22_10-16-16/results.csv
|
||||||
|
[2025-04-22 10:16:16.054] [调试] 写入CSV头...
|
||||||
|
[2025-04-22 10:16:16.054] [调试] 写入CSV数据,共3条记录...
|
||||||
|
[2025-04-22 10:16:16.054] [调试] CSV数据写入完成
|
||||||
|
[2025-04-22 10:16:16.054] [信息] 报告生成完成
|
||||||
|
[2025-04-22 10:16:16.054] [信息] 基准测试完成!报告已生成: reports/report_2025-04-22_10-16-16
|
||||||
|
[2025-04-22 10:16:16.054] [信息] HTML报告: reports/report_2025-04-22_10-16-16/report.html
|
||||||
|
[2025-04-22 10:16:16.054] [信息] CSV数据: reports/report_2025-04-22_10-16-16/results.csv
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>LLM API 基准测试报告</title>
|
||||||
|
<script src="https://go-echarts.github.io/go-echarts-assets/assets/echarts.min.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style> .container {display: flex;justify-content: center;align-items: center;} .item {margin: auto;} </style>
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="JSkHWLzjhEVT" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_JSkHWLzjhEVT = echarts.init(document.getElementById('JSkHWLzjhEVT'), "white");
|
||||||
|
let option_JSkHWLzjhEVT = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"指标","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":3},{"value":3},{"value":0},{"value":36107},{"value":42141},{"value":42141},{"value":42141},{"value":500},{"value":500},{"value":500},{"value":500},{"value":500},{"value":0.04399568740117214},{"value":25641.02564102564}]}],"title":{"text":"性能概览"},"tooltip":{"show":false},"xAxis":[{"data":["总请求数","成功请求数","失败请求数","平均响应时间(ms)","P90响应时间(ms)","P95响应时间(ms)","P99响应时间(ms)","最小TTFT(ms)","最大TTFT(ms)","P90 TTFT(ms)","P95 TTFT(ms)","P99 TTFT(ms)","平均QPS","最大QPS"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_JSkHWLzjhEVT = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_JSkHWLzjhEVT.setOption(option_JSkHWLzjhEVT);
|
||||||
|
goecharts_JSkHWLzjhEVT.dispatchAction(action_JSkHWLzjhEVT);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="vaESWjpaXteN" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_vaESWjpaXteN = echarts.init(document.getElementById('vaESWjpaXteN'), "white");
|
||||||
|
let option_vaESWjpaXteN = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"请求数","type":"bar","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":false,"data":[{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":3}]}],"title":{"text":"响应时间分布"},"tooltip":{"show":false},"xAxis":[{"data":["≤100ms","100-200ms","200-500ms","500-1000ms","1000-2000ms","2000-5000ms","5000-10000ms",">10000ms"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_vaESWjpaXteN = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_vaESWjpaXteN.setOption(option_vaESWjpaXteN);
|
||||||
|
goecharts_vaESWjpaXteN.dispatchAction(action_vaESWjpaXteN);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="mmahMHCCFMKQ" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_mmahMHCCFMKQ = echarts.init(document.getElementById('mmahMHCCFMKQ'), "white");
|
||||||
|
let option_mmahMHCCFMKQ = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0.2,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0.4,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"QPS随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["10:15:31"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_mmahMHCCFMKQ = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_mmahMHCCFMKQ.setOption(option_mmahMHCCFMKQ);
|
||||||
|
goecharts_mmahMHCCFMKQ.dispatchAction(action_mmahMHCCFMKQ);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="ltiWAUYFNXdG" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_ltiWAUYFNXdG = echarts.init(document.getElementById('ltiWAUYFNXdG'), "white");
|
||||||
|
let option_ltiWAUYFNXdG = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":0,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["10:15:31"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_ltiWAUYFNXdG = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_ltiWAUYFNXdG.setOption(option_ltiWAUYFNXdG);
|
||||||
|
goecharts_ltiWAUYFNXdG.dispatchAction(action_ltiWAUYFNXdG);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="qBeyHZkNTkus" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_qBeyHZkNTkus = echarts.init(document.getElementById('qBeyHZkNTkus'), "white");
|
||||||
|
let option_qBeyHZkNTkus = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"平均响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":24040,"XAxisIndex":0,"YAxisIndex":0},{"value":42141,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P90响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":24040,"XAxisIndex":0,"YAxisIndex":0},{"value":42141,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"P95响应时间 (ms)","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":24040,"XAxisIndex":0,"YAxisIndex":0},{"value":42141,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1","2"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_qBeyHZkNTkus = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_qBeyHZkNTkus.setOption(option_qBeyHZkNTkus);
|
||||||
|
goecharts_qBeyHZkNTkus.dispatchAction(action_qBeyHZkNTkus);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="item" id="AKximrjBXkOH" style="width:900px;height:500px;"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
"use strict";
|
||||||
|
let goecharts_AKximrjBXkOH = echarts.init(document.getElementById('AKximrjBXkOH'), "white");
|
||||||
|
let option_AKximrjBXkOH = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":500,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":500,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["10:15:31"]}],"yAxis":[{}]}
|
||||||
|
;
|
||||||
|
|
||||||
|
let action_AKximrjBXkOH = {"areas":{},"type":""}
|
||||||
|
;
|
||||||
|
|
||||||
|
goecharts_AKximrjBXkOH.setOption(option_AKximrjBXkOH);
|
||||||
|
goecharts_AKximrjBXkOH.dispatchAction(action_AKximrjBXkOH);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error
|
||||||
|
2025-04-22T10:15:07+08:00,short,2,0,24040,1,500,
|
||||||
|
2025-04-22T10:15:31+08:00,short,2,0,40168,2,500,
|
||||||
|
2025-04-22T10:15:31+08:00,long,2,0,44114,2,500,
|
||||||
|
Reference in new issue
Block a user