Add benchmark reports and test results with metrics and visualizations

This commit is contained in:
Mingor committed 2025-04-22 18:16:20 +08:00
1 parent a6f82d5a0b
commit 1838c1d559
23 files changed
+1205 -150

No files matched your search

+101 -145
View File
@@ -38,6 +38,8 @@ type Choice struct {
Message Message `json:"message"`
Index int `json:"index"`
FinishReason string `json:"finish_reason"`
// reasoning_content: 思维链内容
ReasoningContent string `json:"reasoning_content"`
}
// Usage 表示API响应中的使用情况
@@ -69,6 +71,8 @@ type Result struct {
ResponseTime time.Duration // 响应时间
FirstTokenTime time.Duration // 首个令牌生成时间(TTFT)
Response string // 响应内容
// 推理模型的思维链内容
ReasoningContent string
Error error // 错误信息
}
@@ -107,7 +111,7 @@ func NewBenchmark(cfg *config.Config) (*Benchmark, error) {
return &Benchmark{
config: cfg,
generator: gen,
httpClient: &http.Client{},
httpClient: &http.Client{Timeout: time.Duration(cfg.Timeout) * time.Second},
rand: rand.New(rand.NewSource(time.Now().UnixNano())),
}, nil
}
@@ -145,20 +149,23 @@ func (b *Benchmark) executeRequest(concurrencyStep int) Result {
promptType := b.generator.SelectPromptType()
result.PromptType = promptType
// 生成提示词
// 生成并统计提示词
prompt, err := b.generator.GeneratePrompt(promptType)
if err != nil {
result.Error = fmt.Errorf("生成提示词失败: %w", err)
return result
}
promptTokens := b.generator.CountTokens(prompt)
result.PromptTokenCount = promptTokens
result.PromptTokens = promptTokens
// 创建请求
// 构造请求对象
reqObj := Request{
Model: b.config.API.Model,
Messages: []Message{{Role: "user", Content: prompt}},
MaxTokens: 2048,
Temperature: 0.7,
Stream: true, // 启用流式响应
MaxTokens: b.config.API.MaxTokens,
Temperature: b.config.API.Temperature,
Stream: true,
}
reqBody, err := json.Marshal(reqObj)
@@ -168,11 +175,9 @@ func (b *Benchmark) executeRequest(concurrencyStep int) Result {
}
requestID := fmt.Sprintf("request-%s", result.Timestamp.Format("20060102-150405.000"))
requestLog := fmt.Sprintf("===== 请求 ID: %s =====\n时间: %s\n并发级别: %d\n提示词类型: %s\n端点: %s\n请求体:\n%s\n",
requestID, result.Timestamp.Format(time.RFC3339), concurrencyStep, promptType, b.config.API.Endpoint, string(reqBody))
logger.LogToFile(requestLog)
logger.LogToFile(fmt.Sprintf("===== 请求 ID: %s =====\n并发: %d, 类型: %s, 端点: %s\n请求体:\n%s\n", requestID, concurrencyStep, promptType, b.config.API.Endpoint, string(reqBody)))
// 构造 http.Request
// 构造 HTTP 请求并绑定超时上下文
httpReq, err := http.NewRequest("POST", b.config.API.Endpoint, bytes.NewReader(reqBody))
if err != nil {
result.Error = fmt.Errorf("创建HTTP请求失败: %w", err)
@@ -182,26 +187,36 @@ func (b *Benchmark) executeRequest(concurrencyStep int) Result {
httpReq.Header.Set("Authorization", "Bearer "+b.config.API.APIKey)
httpReq.Header.Set("Accept", "text/event-stream")
ctxReq, cancel := context.WithTimeout(httpReq.Context(), time.Duration(b.config.Timeout)*time.Second)
defer cancel()
httpReq = httpReq.WithContext(ctxReq)
startTime := time.Now()
resp, err := b.httpClient.Do(httpReq)
if err != nil {
result.Error = fmt.Errorf("发送请求失败: %w", err)
logger.Error("请求失败: %v", err)
logger.Error("请求错误: %v", err)
return result
}
defer resp.Body.Close()
// 检查状态码
if resp.StatusCode != http.StatusOK {
result.Error = fmt.Errorf("HTTP状态码错误: %d", resp.StatusCode)
logger.Warn("HTTP状态码非200: %d", resp.StatusCode)
return result
}
// 记录响应时间
responseTime := time.Since(startTime)
result.ResponseTime = responseTime
// 记录响应日志
respBody, _ := io.ReadAll(io.LimitReader(resp.Body, 4096)) // 只记录前4K
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))
// 非流式记录前4K
if !reqObj.Stream {
head, _ := io.ReadAll(io.LimitReader(resp.Body, 4096))
logger.LogToFile(fmt.Sprintf("===== 响应头部 ID: %s =====\n状态码: %d\n前4K响应体:\n%s\n", requestID, resp.StatusCode, string(head)))
resp.Body = io.NopCloser(io.MultiReader(bytes.NewReader(head), resp.Body))
}
if reqObj.Stream {
return b.handleStreamResponse(resp, result, startTime)
@@ -230,12 +245,13 @@ func (b *Benchmark) runConcurrencyStep(concurrencyStep int) ([]Result, error) {
case <-ctx.Done():
return
default:
result := b.executeRequest(concurrencyStep)
res := b.executeRequest(concurrencyStep)
resultsMutex.Lock()
results = append(results, result)
results = append(results, res)
resultsMutex.Unlock()
// 简单限速,可根据需要调整
time.Sleep(10 * time.Millisecond)
// 按泊松分布间隔
interval := b.rand.ExpFloat64() / b.config.PoissonLambda
time.Sleep(time.Duration(interval * float64(time.Second)))
}
}
}(i)
@@ -245,177 +261,105 @@ func (b *Benchmark) runConcurrencyStep(concurrencyStep int) ([]Result, error) {
return results, nil
}
// handleStreamResponse 处理流式响应(net/http 实现)
// handleStreamResponse 处理流式响应
func (b *Benchmark) handleStreamResponse(resp *http.Response, result Result, startTime time.Time) Result {
responseContent := ""
var builder strings.Builder
// 聚合思维链
var reasoningBuilder strings.Builder
tokenCount := 0
firstTokenReceived := false
var firstTokenTime time.Duration
// 记录响应头接收时间 - 这是我们开始计算TTFT的时间点
reader := bufio.NewReaderSize(resp.Body, 4096)
responseHeaderTime := time.Now()
logger.Debug("接收到响应头,网络请求耗时: %v", responseHeaderTime.Sub(startTime))
// 创建一个带缓冲的读取器,这样我们可以更快地读取数据
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)
line, err := reader.ReadString('\n')
if err != nil {
if err != io.EOF {
logger.Warn("读取响应流出错: %v", err)
logger.Warn("读取流式响应出错: %v", err)
}
break
}
// 处理读取到的数据
data := buffer[:n]
lines := bytes.Split(data, []byte("\n"))
for _, currentLine := range lines {
if len(currentLine) == 0 {
if !strings.HasPrefix(line, "data: ") {
continue
}
// 如果行不完整,先缓存起来
if !bytes.HasSuffix(currentLine, []byte("\n")) {
line = append(line, currentLine...)
continue
}
// 处理完整的行
line = append(line, currentLine...)
// 检查是否为数据行
if !bytes.HasPrefix(line, []byte("data: ")) {
line = nil
continue
}
// 移除 "data: " 前缀
data := line[6:]
line = nil
// 检查是否为结束标记
if bytes.Equal(data, []byte("[DONE]")) {
data := strings.TrimPrefix(line, "data: ")
data = strings.TrimSuffix(data, "\n")
if data == "[DONE]" {
logger.Debug("收到流式响应结束标记")
break
}
// 解析JSON
var chunk map[string]interface{}
if err := json.Unmarshal(data, &chunk); err != nil {
logger.Warn("解析JSON数据块失败: %v, 数据: %s", err, string(data))
if err := json.Unmarshal([]byte(data), &chunk); err != nil {
logger.Warn("JSON解析失败: %v", err)
continue
}
// 提取内容
choices, ok := chunk["choices"].([]interface{})
if !ok || len(choices) == 0 {
continue
}
choice, ok := choices[0].(map[string]interface{})
choiceIface := choices[0]
choiceMap, ok := choiceIface.(map[string]interface{})
if !ok {
continue
}
delta, ok := choice["delta"].(map[string]interface{})
deltaIface, ok := choiceMap["delta"]
deltaMap, ok := deltaIface.(map[string]interface{})
if !ok {
continue
}
content, ok := delta["content"].(string)
if !ok {
contentVal, ok := deltaMap["content"]
content, ok := contentVal.(string)
if !ok || content == "" {
continue
}
// 记录当前时间
now := time.Now()
responseContent += content
builder.WriteString(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 {
logger.LogToFile(fmt.Sprintf("[Chunk %d] %s 内容: %s", chunkIdx, now.Format(time.RFC3339Nano), content))
// 初次令牌检测:推理模型优先考虑思维链内容
rcVal, rcOk := deltaMap["reasoning_content"]
rcStr, _ := rcVal.(string)
if !firstTokenReceived {
if rcOk && rcStr != "" {
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)
logger.Debug("收到首个思维链令牌,TTFT: %v", firstTokenTime)
} else if content != "" {
firstTokenTime = now.Sub(responseHeaderTime)
firstTokenReceived = true
logger.Debug("收到首个内容令牌,TTFT: %v", firstTokenTime)
}
}
// 聚合思维链字段
if rcOk && rcStr != "" {
reasoningBuilder.WriteString(rcStr)
}
streamLogFooter := fmt.Sprintf("===== 流式响应结束 ID: %s =====\n累计响应内容: %s\n", requestID, responseContent)
logger.LogToFile(streamLogFooter)
// 计算总响应时间
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
}
responseContent := builder.String()
// 设置结果
result.Response = responseContent
result.PromptTokenCount = len(result.PromptType) / 2 // 简单估计
result.PromptTokens = len(result.PromptType) / 2 // 简单估计
// CompletionTokens 和总Token
result.CompletionTokens = tokenCount
result.TotalTokens = result.PromptTokens + result.CompletionTokens
// 记录处理后的响应
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)
// 设置思维链内容
result.ReasoningContent = reasoningBuilder.String()
// 设置响应时间和首个令牌时间 (TTFT)
result.ResponseTime = time.Since(startTime)
if firstTokenReceived {
result.FirstTokenTime = firstTokenTime
} else {
// 未检测到首个令牌,使用响应时间作为 TTFT
result.FirstTokenTime = result.ResponseTime
}
return result
}
// handleNormalResponse 处理普通响应(net/http 实现)
// handleNormalResponse 处理普通响应
func (b *Benchmark) handleNormalResponse(resp *http.Response, result Result) Result {
var response Response
if err := json.NewDecoder(resp.Body).Decode(&response); err != nil {
@@ -423,11 +367,23 @@ func (b *Benchmark) handleNormalResponse(resp *http.Response, result Result) Res
logger.Error("解析响应失败: %v", err)
return result
}
// 先获取响应内容
if len(response.Choices) > 0 {
choice := response.Choices[0]
result.Response = choice.Message.Content
// 推理模型思维链
result.ReasoningContent = choice.ReasoningContent
}
// 根据 Usage 判断是否兼容推理模型
if response.Usage.TotalTokens > 0 {
result.PromptTokens = response.Usage.PromptTokens
result.CompletionTokens = response.Usage.CompletionTokens
result.TotalTokens = response.Usage.TotalTokens
if len(response.Choices) > 0 {
result.Response = response.Choices[0].Message.Content
} else {
// 推理模型未返回 Usage,使用本地统计
result.PromptTokens = result.PromptTokenCount
result.CompletionTokens = b.generator.CountTokens(result.Response)
result.TotalTokens = result.PromptTokens + result.CompletionTokens
}
result.FirstTokenTime = result.ResponseTime
logger.Debug("非流式响应,使用响应时间作为TTFT: %v", result.FirstTokenTime)
+10
View File
@@ -21,6 +21,8 @@ type APIConfig struct {
Endpoint string `mapstructure:"endpoint"`
APIKey string `mapstructure:"api_key"`
Model string `mapstructure:"model"`
MaxTokens int `mapstructure:"max_tokens"`
Temperature float64 `mapstructure:"temperature"`
}
// PromptTemplatesConfig 表示提示词模板配置
@@ -70,6 +72,14 @@ func LoadConfig(path string) (*Config, error) {
return nil, err
}
// 设置默认值
if config.API.MaxTokens == 0 {
config.API.MaxTokens = 2048
}
if config.API.Temperature == 0 {
config.API.Temperature = 0.7
}
return &config, nil
}
BIN
View File
Binary file not shown.
+6
View File
@@ -325,3 +325,9 @@ func (g *Generator) SelectPromptType() string {
// 默认返回第一个类型
return g.config.Requests[0].Type
}
// CountTokens 返回字符串的 token 数
func (g *Generator) CountTokens(s string) int {
tokens := g.tokenizer.Encode(s, nil, nil)
return len(tokens)
}
+19 -5
View File
@@ -87,7 +87,7 @@ func GenerateReport(results *benchmark.BenchmarkResults, cfg *config.Config, out
// 生成CSV数据
logger.Info("生成CSV数据...")
if err := generateCSVData(results, outputPath); err != nil {
if err := generateCSVData(results, metrics, outputPath); err != nil {
return fmt.Errorf("生成CSV数据失败: %w", err)
}
@@ -346,10 +346,13 @@ func createOverviewChart(results *benchmark.BenchmarkResults, metrics *Metrics,
"总请求数",
"成功请求数",
"失败请求数",
"超时比率(%)",
"平均响应时间(ms)",
"P90响应时间(ms)",
"P95响应时间(ms)",
"P99响应时间(ms)",
"最小响应时间(ms)",
"最大响应时间(ms)",
"最小TTFT(ms)",
"最大TTFT(ms)",
"P90 TTFT(ms)",
@@ -357,16 +360,22 @@ func createOverviewChart(results *benchmark.BenchmarkResults, metrics *Metrics,
"P99 TTFT(ms)",
"平均QPS",
"最大QPS",
"平均Token生成速率(tokens/s)",
"最大Token生成速率(tokens/s)",
"最大有效并发用户数",
})
chart.AddSeries("指标", []opts.BarData{
{Value: metrics.TotalRequests},
{Value: metrics.SuccessfulRequests},
{Value: metrics.FailedRequests},
{Value: metrics.TimeoutRatio * 100},
{Value: metrics.AvgResponseTime.Milliseconds()},
{Value: metrics.P90ResponseTime.Milliseconds()},
{Value: metrics.P95ResponseTime.Milliseconds()},
{Value: metrics.P99ResponseTime.Milliseconds()},
{Value: metrics.MinResponseTime.Milliseconds()},
{Value: metrics.MaxResponseTime.Milliseconds()},
{Value: metrics.MinTTFT.Milliseconds()},
{Value: metrics.MaxTTFT.Milliseconds()},
{Value: metrics.P90TTFT.Milliseconds()},
@@ -374,6 +383,9 @@ func createOverviewChart(results *benchmark.BenchmarkResults, metrics *Metrics,
{Value: metrics.P99TTFT.Milliseconds()},
{Value: metrics.AvgQPS},
{Value: metrics.MaxQPS},
{Value: metrics.AvgTokenRate},
{Value: metrics.MaxTokenRate},
{Value: metrics.MaxConcurrency},
})
return chart
@@ -721,7 +733,7 @@ func createTTFTOverTimeChart(results *benchmark.BenchmarkResults) *charts.Line {
}
// generateCSVData 生成CSV数据
func generateCSVData(results *benchmark.BenchmarkResults, outputPath string) error {
func generateCSVData(results *benchmark.BenchmarkResults, metrics *Metrics, outputPath string) error {
// 创建CSV文件
csvPath := filepath.Join(outputPath, "results.csv")
logger.Debug("创建CSV文件: %s", csvPath)
@@ -733,7 +745,7 @@ func generateCSVData(results *benchmark.BenchmarkResults, outputPath string) err
// 写入CSV头
logger.Debug("写入CSV头...")
_, err = f.WriteString("Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error\n")
_, err = f.WriteString("Timestamp,PromptType,PromptTokens,CompletionTokens,TotalTokens,ResponseTime(ms),FirstTokenTime(ms),Concurrency,Error,ReasoningContent\n")
if err != nil {
return err
}
@@ -754,15 +766,17 @@ func generateCSVData(results *benchmark.BenchmarkResults, outputPath string) err
}
// 写入一行数据
line := fmt.Sprintf("%s,%s,%d,%d,%d,%d,%d,%s\n",
line := fmt.Sprintf("%s,%s,%d,%d,%d,%d,%d,%d,%s,%q\n",
result.Timestamp.Format(time.RFC3339),
result.PromptType,
result.PromptTokens,
result.CompletionTokens,
result.TotalTokens,
result.ResponseTime.Milliseconds(),
result.Concurrency,
result.FirstTokenTime.Milliseconds(),
result.Concurrency,
errorMsg,
result.ReasoningContent,
)
_, err = f.WriteString(line)
@@ -0,0 +1,55 @@
[2025-04-22 15:04:25.267] [信息] 日志文件已设置: reports/report_2025-04-22_15-04-25/api_logs.txt
[2025-04-22 15:04:25.267] [信息] API请求响应日志将记录到: reports/report_2025-04-22_15-04-25/api_logs.txt
[2025-04-22 15:04:25.267] [信息] 创建报告输出目录: reports/report_2025-04-22_15-04-25
[2025-04-22 15:04:25.267] [调试] 共有 3 条测试结果记录
[2025-04-22 15:04:25.267] [信息] 计算性能指标...
[2025-04-22 15:04:25.267] [调试] 计算指标 - 总请求数: 3
[2025-04-22 15:04:25.267] [调试] 计算指标 - 成功请求: 3, 失败请求: 0
[2025-04-22 15:04:25.267] [调试] 计算指标 - 超时比率: 0.00%
[2025-04-22 15:04:25.267] [调试] 计算指标 - 响应时间(ms) - 平均: 166.00, P90: 185.00, P95: 185.00, P99: 185.00, 最小: 128.00, 最大: 214.00
[2025-04-22 15:04:25.267] [调试] 计算指标 - TTFT(ms) - 最小: 0.00, 最大: 0.00, P90: 0.00, P95: 0.00, P99: 0.00
[2025-04-22 15:04:25.267] [调试] 计算指标 - 平均QPS: 0.04 (总持续时间: 69.39秒)
[2025-04-22 15:04:25.267] [调试] 计算各并发步骤的QPS...
[2025-04-22 15:04:25.267] [调试] 并发步骤 1: 持续时间过短
[2025-04-22 15:04:25.267] [调试] 并发步骤 2: QPS = 214270.41 (成功请求: 2, 持续时间: 0.00秒)
[2025-04-22 15:04:25.267] [调试] 更新最大QPS: 214270.41 (并发步骤: 2)
[2025-04-22 15:04:25.267] [调试] 更新最大有效并发用户数: 2
[2025-04-22 15:04:25.267] [调试] 计算指标 - 平均Token生成速率: 22.12 tokens/s (总Token: 1535)
[2025-04-22 15:04:25.267] [调试] 计算各并发步骤的Token生成速率...
[2025-04-22 15:04:25.267] [调试] 并发步骤 2: Token生成速率 = 149453610.46 tokens/s (总Token: 1395, 持续时间: 0.00秒)
[2025-04-22 15:04:25.267] [调试] 更新最大Token生成速率: 149453610.46 tokens/s (并发步骤: 2)
[2025-04-22 15:04:25.267] [信息] 性能指标摘要:
[2025-04-22 15:04:25.267] [信息] 总请求数: 3 (成功: 3, 失败: 0)
[2025-04-22 15:04:25.267] [信息] 超时比率: 0.00%
[2025-04-22 15:04:25.267] [信息] 平均响应时间: 166ms
[2025-04-22 15:04:25.267] [信息] P90响应时间: 185ms
[2025-04-22 15:04:25.267] [信息] P95响应时间: 185ms
[2025-04-22 15:04:25.267] [信息] P99响应时间: 185ms
[2025-04-22 15:04:25.267] [信息] 平均QPS: 0.04
[2025-04-22 15:04:25.268] [信息] 最大QPS: 214270.41
[2025-04-22 15:04:25.268] [信息] 平均Token生成速率: 22.12 tokens/s
[2025-04-22 15:04:25.268] [信息] 最大Token生成速率: 149453610.46 tokens/s
[2025-04-22 15:04:25.268] [信息] 最大有效并发用户数: 2
[2025-04-22 15:04:25.268] [信息] 最小首个令牌生成时间: 0s
[2025-04-22 15:04:25.268] [信息] 最大首个令牌生成时间: 0s
[2025-04-22 15:04:25.268] [信息] P90首个令牌生成时间: 0s
[2025-04-22 15:04:25.268] [信息] P95首个令牌生成时间: 0s
[2025-04-22 15:04:25.268] [信息] P99首个令牌生成时间: 0s
[2025-04-22 15:04:25.268] [信息] 生成HTML报告...
[2025-04-22 15:04:25.268] [调试] 创建HTML报告页面...
[2025-04-22 15:04:25.268] [调试] 添加概述图表...
[2025-04-22 15:04:25.268] [调试] 添加响应时间分布图...
[2025-04-22 15:04:25.268] [调试] 添加QPS随时间变化图...
[2025-04-22 15:04:25.268] [调试] 添加Token生成速率随时间变化图...
[2025-04-22 15:04:25.268] [调试] 添加并发与响应时间关系图...
[2025-04-22 15:04:25.268] [调试] 添加TTFT随时间变化图...
[2025-04-22 15:04:25.268] [调试] 保存HTML报告: reports/report_2025-04-22_15-04-25/report.html
[2025-04-22 15:04:25.272] [信息] 生成CSV数据...
[2025-04-22 15:04:25.272] [调试] 创建CSV文件: reports/report_2025-04-22_15-04-25/results.csv
[2025-04-22 15:04:25.272] [调试] 写入CSV头...
[2025-04-22 15:04:25.272] [调试] 写入CSV数据,共3条记录...
[2025-04-22 15:04:25.272] [调试] CSV数据写入完成
[2025-04-22 15:04:25.272] [信息] 报告生成完成
[2025-04-22 15:04:25.272] [信息] 基准测试完成!报告已生成: reports/report_2025-04-22_15-04-25
[2025-04-22 15:04:25.272] [信息] HTML报告: reports/report_2025-04-22_15-04-25/report.html
[2025-04-22 15:04:25.272] [信息] CSV数据: reports/report_2025-04-22_15-04-25/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="QgXFsvqLAWSC" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_QgXFsvqLAWSC = echarts.init(document.getElementById('QgXFsvqLAWSC'), "white");
let option_QgXFsvqLAWSC = {"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":166},{"value":185},{"value":185},{"value":185},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0.04323371476620453},{"value":214270.40925648165}]}],"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_QgXFsvqLAWSC = {"areas":{},"type":""}
;
goecharts_QgXFsvqLAWSC.setOption(option_QgXFsvqLAWSC);
goecharts_QgXFsvqLAWSC.dispatchAction(action_QgXFsvqLAWSC);
</script>
<div class="container">
<div class="item" id="PdKLjsCLIHFJ" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_PdKLjsCLIHFJ = echarts.init(document.getElementById('PdKLjsCLIHFJ'), "white");
let option_PdKLjsCLIHFJ = {"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":2},{"value":1},{"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_PdKLjsCLIHFJ = {"areas":{},"type":""}
;
goecharts_PdKLjsCLIHFJ.setOption(option_PdKLjsCLIHFJ);
goecharts_PdKLjsCLIHFJ.dispatchAction(action_PdKLjsCLIHFJ);
</script>
<div class="container">
<div class="item" id="vyzyNcVQQtMQ" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_vyzyNcVQQtMQ = echarts.init(document.getElementById('vyzyNcVQQtMQ'), "white");
let option_vyzyNcVQQtMQ = {"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":["15:03:34"]}],"yAxis":[{}]}
;
let action_vyzyNcVQQtMQ = {"areas":{},"type":""}
;
goecharts_vyzyNcVQQtMQ.setOption(option_vyzyNcVQQtMQ);
goecharts_vyzyNcVQQtMQ.dispatchAction(action_vyzyNcVQQtMQ);
</script>
<div class="container">
<div class="item" id="xREMObByzgZc" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_xREMObByzgZc = echarts.init(document.getElementById('xREMObByzgZc'), "white");
let option_xREMObByzgZc = {"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":28,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":279,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["15:03:34"]}],"yAxis":[{}]}
;
let action_xREMObByzgZc = {"areas":{},"type":""}
;
goecharts_xREMObByzgZc.setOption(option_xREMObByzgZc);
goecharts_xREMObByzgZc.dispatchAction(action_xREMObByzgZc);
</script>
<div class="container">
<div class="item" id="NQqeQSCEludq" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_NQqeQSCEludq = echarts.init(document.getElementById('NQqeQSCEludq'), "white");
let option_NQqeQSCEludq = {"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":156,"XAxisIndex":0,"YAxisIndex":0},{"value":171,"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":156,"XAxisIndex":0,"YAxisIndex":0},{"value":171,"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":156,"XAxisIndex":0,"YAxisIndex":0},{"value":171,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1","2"]}],"yAxis":[{}]}
;
let action_NQqeQSCEludq = {"areas":{},"type":""}
;
goecharts_NQqeQSCEludq.setOption(option_NQqeQSCEludq);
goecharts_NQqeQSCEludq.dispatchAction(action_NQqeQSCEludq);
</script>
<div class="container">
<div class="item" id="JdiBDXtvAWJa" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_JdiBDXtvAWJa = echarts.init(document.getElementById('JdiBDXtvAWJa'), "white");
let option_JdiBDXtvAWJa = {"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":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["15:03:34"]}],"yAxis":[{}]}
;
let action_JdiBDXtvAWJa = {"areas":{},"type":""}
;
goecharts_JdiBDXtvAWJa.setOption(option_JdiBDXtvAWJa);
goecharts_JdiBDXtvAWJa.dispatchAction(action_JdiBDXtvAWJa);
</script>
</body>
</html>
@@ -0,0 +1,4 @@
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error
2025-04-22T15:03:15+08:00,short,52,140,156,1,0,
2025-04-22T15:03:34+08:00,short,48,363,128,2,0,
2025-04-22T15:03:34+08:00,long,960,1032,214,2,0,
1 Timestamp PromptType PromptTokens CompletionTokens ResponseTime Concurrency FirstTokenTime Error
2 2025-04-22T15:03:15+08:00 short 52 140 156 1 0
3 2025-04-22T15:03:34+08:00 short 48 363 128 2 0
4 2025-04-22T15:03:34+08:00 long 960 1032 214 2 0
@@ -0,0 +1,55 @@
[2025-04-22 15:17:42.168] [信息] 日志文件已设置: reports/report_2025-04-22_15-17-42/api_logs.txt
[2025-04-22 15:17:42.168] [信息] API请求响应日志将记录到: reports/report_2025-04-22_15-17-42/api_logs.txt
[2025-04-22 15:17:42.168] [信息] 创建报告输出目录: reports/report_2025-04-22_15-17-42
[2025-04-22 15:17:42.168] [调试] 共有 3 条测试结果记录
[2025-04-22 15:17:42.168] [信息] 计算性能指标...
[2025-04-22 15:17:42.168] [调试] 计算指标 - 总请求数: 3
[2025-04-22 15:17:42.169] [调试] 计算指标 - 成功请求: 3, 失败请求: 0
[2025-04-22 15:17:42.169] [调试] 计算指标 - 超时比率: 0.00%
[2025-04-22 15:17:42.169] [调试] 计算指标 - 响应时间(ms) - 平均: 22476.33, P90: 24723.00, P95: 24723.00, P99: 24723.00, 最小: 17983.00, 最大: 24791.00
[2025-04-22 15:17:42.169] [调试] 计算指标 - TTFT(ms) - 最小: 9267.00, 最大: 11273.00, P90: 11088.00, P95: 11088.00, P99: 11088.00
[2025-04-22 15:17:42.169] [调试] 计算指标 - 平均QPS: 0.06 (总持续时间: 50.92秒)
[2025-04-22 15:17:42.169] [调试] 计算各并发步骤的QPS...
[2025-04-22 15:17:42.169] [调试] 并发步骤 1: 持续时间过短
[2025-04-22 15:17:42.169] [调试] 并发步骤 2: QPS = 205128.21 (成功请求: 2, 持续时间: 0.00秒)
[2025-04-22 15:17:42.169] [调试] 更新最大QPS: 205128.21 (并发步骤: 2)
[2025-04-22 15:17:42.169] [调试] 更新最大有效并发用户数: 2
[2025-04-22 15:17:42.169] [调试] 计算指标 - 平均Token生成速率: 19.25 tokens/s (总Token: 980)
[2025-04-22 15:17:42.169] [调试] 计算各并发步骤的Token生成速率...
[2025-04-22 15:17:42.169] [调试] 并发步骤 2: Token生成速率 = 68307692.31 tokens/s (总Token: 666, 持续时间: 0.00秒)
[2025-04-22 15:17:42.169] [调试] 更新最大Token生成速率: 68307692.31 tokens/s (并发步骤: 2)
[2025-04-22 15:17:42.169] [信息] 性能指标摘要:
[2025-04-22 15:17:42.169] [信息] 总请求数: 3 (成功: 3, 失败: 0)
[2025-04-22 15:17:42.169] [信息] 超时比率: 0.00%
[2025-04-22 15:17:42.169] [信息] 平均响应时间: 22.476s
[2025-04-22 15:17:42.169] [信息] P90响应时间: 24.723s
[2025-04-22 15:17:42.169] [信息] P95响应时间: 24.723s
[2025-04-22 15:17:42.169] [信息] P99响应时间: 24.723s
[2025-04-22 15:17:42.169] [信息] 平均QPS: 0.06
[2025-04-22 15:17:42.169] [信息] 最大QPS: 205128.21
[2025-04-22 15:17:42.169] [信息] 平均Token生成速率: 19.25 tokens/s
[2025-04-22 15:17:42.169] [信息] 最大Token生成速率: 68307692.31 tokens/s
[2025-04-22 15:17:42.169] [信息] 最大有效并发用户数: 2
[2025-04-22 15:17:42.169] [信息] 最小首个令牌生成时间: 9.267s
[2025-04-22 15:17:42.169] [信息] 最大首个令牌生成时间: 11.273s
[2025-04-22 15:17:42.169] [信息] P90首个令牌生成时间: 11.088s
[2025-04-22 15:17:42.169] [信息] P95首个令牌生成时间: 11.088s
[2025-04-22 15:17:42.169] [信息] P99首个令牌生成时间: 11.088s
[2025-04-22 15:17:42.169] [信息] 生成HTML报告...
[2025-04-22 15:17:42.169] [调试] 创建HTML报告页面...
[2025-04-22 15:17:42.169] [调试] 添加概述图表...
[2025-04-22 15:17:42.169] [调试] 添加响应时间分布图...
[2025-04-22 15:17:42.170] [调试] 添加QPS随时间变化图...
[2025-04-22 15:17:42.170] [调试] 添加Token生成速率随时间变化图...
[2025-04-22 15:17:42.170] [调试] 添加并发与响应时间关系图...
[2025-04-22 15:17:42.170] [调试] 添加TTFT随时间变化图...
[2025-04-22 15:17:42.170] [调试] 保存HTML报告: reports/report_2025-04-22_15-17-42/report.html
[2025-04-22 15:17:42.175] [信息] 生成CSV数据...
[2025-04-22 15:17:42.175] [调试] 创建CSV文件: reports/report_2025-04-22_15-17-42/results.csv
[2025-04-22 15:17:42.176] [调试] 写入CSV头...
[2025-04-22 15:17:42.176] [调试] 写入CSV数据,共3条记录...
[2025-04-22 15:17:42.176] [调试] CSV数据写入完成
[2025-04-22 15:17:42.176] [信息] 报告生成完成
[2025-04-22 15:17:42.176] [信息] 基准测试完成!报告已生成: reports/report_2025-04-22_15-17-42
[2025-04-22 15:17:42.176] [信息] HTML报告: reports/report_2025-04-22_15-17-42/report.html
[2025-04-22 15:17:42.176] [信息] CSV数据: reports/report_2025-04-22_15-17-42/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="csYaKBGQJwwL" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_csYaKBGQJwwL = echarts.init(document.getElementById('csYaKBGQJwwL'), "white");
let option_csYaKBGQJwwL = {"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":22476},{"value":24723},{"value":24723},{"value":24723},{"value":9267},{"value":11273},{"value":11088},{"value":11088},{"value":11088},{"value":0.058917026111260054},{"value":205128.20512820513}]}],"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_csYaKBGQJwwL = {"areas":{},"type":""}
;
goecharts_csYaKBGQJwwL.setOption(option_csYaKBGQJwwL);
goecharts_csYaKBGQJwwL.dispatchAction(action_csYaKBGQJwwL);
</script>
<div class="container">
<div class="item" id="ccezcGJddHPN" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_ccezcGJddHPN = echarts.init(document.getElementById('ccezcGJddHPN'), "white");
let option_ccezcGJddHPN = {"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_ccezcGJddHPN = {"areas":{},"type":""}
;
goecharts_ccezcGJddHPN.setOption(option_ccezcGJddHPN);
goecharts_ccezcGJddHPN.dispatchAction(action_ccezcGJddHPN);
</script>
<div class="container">
<div class="item" id="KJeZkMONuYVK" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_KJeZkMONuYVK = echarts.init(document.getElementById('KJeZkMONuYVK'), "white");
let option_KJeZkMONuYVK = {"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":["15:17:17"]}],"yAxis":[{}]}
;
let action_KJeZkMONuYVK = {"areas":{},"type":""}
;
goecharts_KJeZkMONuYVK.setOption(option_KJeZkMONuYVK);
goecharts_KJeZkMONuYVK.dispatchAction(action_KJeZkMONuYVK);
</script>
<div class="container">
<div class="item" id="iptMRELGIKHr" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_iptMRELGIKHr = echarts.init(document.getElementById('iptMRELGIKHr'), "white");
let option_iptMRELGIKHr = {"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":62.8,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":133.2,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["15:17:17"]}],"yAxis":[{}]}
;
let action_iptMRELGIKHr = {"areas":{},"type":""}
;
goecharts_iptMRELGIKHr.setOption(option_iptMRELGIKHr);
goecharts_iptMRELGIKHr.dispatchAction(action_iptMRELGIKHr);
</script>
<div class="container">
<div class="item" id="KIZPieHjJeve" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_KIZPieHjJeve = echarts.init(document.getElementById('KIZPieHjJeve'), "white");
let option_KIZPieHjJeve = {"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":24791,"XAxisIndex":0,"YAxisIndex":0},{"value":21319,"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":24791,"XAxisIndex":0,"YAxisIndex":0},{"value":21319,"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":24791,"XAxisIndex":0,"YAxisIndex":0},{"value":21319,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1","2"]}],"yAxis":[{}]}
;
let action_KIZPieHjJeve = {"areas":{},"type":""}
;
goecharts_KIZPieHjJeve.setOption(option_KIZPieHjJeve);
goecharts_KIZPieHjJeve.dispatchAction(action_KIZPieHjJeve);
</script>
<div class="container">
<div class="item" id="YrBZZZMMvKDw" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_YrBZZZMMvKDw = echarts.init(document.getElementById('YrBZZZMMvKDw'), "white");
let option_YrBZZZMMvKDw = {"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":11273,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":10085,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["15:17:17"]}],"yAxis":[{}]}
;
let action_YrBZZZMMvKDw = {"areas":{},"type":""}
;
goecharts_YrBZZZMMvKDw.setOption(option_YrBZZZMMvKDw);
goecharts_YrBZZZMMvKDw.dispatchAction(action_YrBZZZMMvKDw);
</script>
</body>
</html>
@@ -0,0 +1,4 @@
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error
2025-04-22T15:16:51+08:00,short,50,314,24791,1,11273,
2025-04-22T15:17:17+08:00,short,49,216,17983,2,9267,
2025-04-22T15:17:17+08:00,short,47,450,24655,2,10903,
1 Timestamp PromptType PromptTokens CompletionTokens ResponseTime Concurrency FirstTokenTime Error
2 2025-04-22T15:16:51+08:00 short 50 314 24791 1 11273
3 2025-04-22T15:17:17+08:00 short 49 216 17983 2 9267
4 2025-04-22T15:17:17+08:00 short 47 450 24655 2 10903
@@ -0,0 +1,55 @@
[2025-04-22 16:39:44.748] [信息] 日志文件已设置: reports/report_2025-04-22_16-39-44/api_logs.txt
[2025-04-22 16:39:44.748] [信息] API请求响应日志将记录到: reports/report_2025-04-22_16-39-44/api_logs.txt
[2025-04-22 16:39:44.749] [信息] 创建报告输出目录: reports/report_2025-04-22_16-39-44
[2025-04-22 16:39:44.749] [调试] 共有 3 条测试结果记录
[2025-04-22 16:39:44.749] [信息] 计算性能指标...
[2025-04-22 16:39:44.749] [调试] 计算指标 - 总请求数: 3
[2025-04-22 16:39:44.749] [调试] 计算指标 - 成功请求: 3, 失败请求: 0
[2025-04-22 16:39:44.749] [调试] 计算指标 - 超时比率: 0.00%
[2025-04-22 16:39:44.749] [调试] 计算指标 - 响应时间(ms) - 平均: 34273.33, P90: 38649.50, P95: 38649.50, P99: 38649.50, 最小: 25521.00, 最大: 48694.00
[2025-04-22 16:39:44.749] [调试] 计算指标 - TTFT(ms) - 最小: 11289.00, 最大: 14450.00, P90: 13680.00, P95: 13680.00, P99: 13680.00
[2025-04-22 16:39:44.749] [调试] 计算指标 - 平均QPS: 0.04 (总持续时间: 77.80秒)
[2025-04-22 16:39:44.749] [调试] 计算各并发步骤的QPS...
[2025-04-22 16:39:44.749] [调试] 并发步骤 1: 持续时间过短
[2025-04-22 16:39:44.749] [调试] 并发步骤 2: QPS = 431.68 (成功请求: 2, 持续时间: 0.00秒)
[2025-04-22 16:39:44.749] [调试] 更新最大QPS: 431.68 (并发步骤: 2)
[2025-04-22 16:39:44.749] [调试] 更新最大有效并发用户数: 2
[2025-04-22 16:39:44.749] [调试] 计算指标 - 平均Token生成速率: 21.53 tokens/s (总Token: 1675)
[2025-04-22 16:39:44.749] [调试] 计算各并发步骤的Token生成速率...
[2025-04-22 16:39:44.749] [调试] 并发步骤 2: Token生成速率 = 275628.84 tokens/s (总Token: 1277, 持续时间: 0.00秒)
[2025-04-22 16:39:44.749] [调试] 更新最大Token生成速率: 275628.84 tokens/s (并发步骤: 2)
[2025-04-22 16:39:44.749] [信息] 性能指标摘要:
[2025-04-22 16:39:44.749] [信息] 总请求数: 3 (成功: 3, 失败: 0)
[2025-04-22 16:39:44.749] [信息] 超时比率: 0.00%
[2025-04-22 16:39:44.749] [信息] 平均响应时间: 34.273s
[2025-04-22 16:39:44.749] [信息] P90响应时间: 38.649s
[2025-04-22 16:39:44.749] [信息] P95响应时间: 38.649s
[2025-04-22 16:39:44.749] [信息] P99响应时间: 38.649s
[2025-04-22 16:39:44.749] [信息] 平均QPS: 0.04
[2025-04-22 16:39:44.749] [信息] 最大QPS: 431.68
[2025-04-22 16:39:44.749] [信息] 平均Token生成速率: 21.53 tokens/s
[2025-04-22 16:39:44.749] [信息] 最大Token生成速率: 275628.84 tokens/s
[2025-04-22 16:39:44.749] [信息] 最大有效并发用户数: 2
[2025-04-22 16:39:44.749] [信息] 最小首个令牌生成时间: 11.289s
[2025-04-22 16:39:44.749] [信息] 最大首个令牌生成时间: 14.45s
[2025-04-22 16:39:44.749] [信息] P90首个令牌生成时间: 13.68s
[2025-04-22 16:39:44.749] [信息] P95首个令牌生成时间: 13.68s
[2025-04-22 16:39:44.749] [信息] P99首个令牌生成时间: 13.68s
[2025-04-22 16:39:44.749] [信息] 生成HTML报告...
[2025-04-22 16:39:44.750] [调试] 创建HTML报告页面...
[2025-04-22 16:39:44.750] [调试] 添加概述图表...
[2025-04-22 16:39:44.750] [调试] 添加响应时间分布图...
[2025-04-22 16:39:44.750] [调试] 添加QPS随时间变化图...
[2025-04-22 16:39:44.750] [调试] 添加Token生成速率随时间变化图...
[2025-04-22 16:39:44.750] [调试] 添加并发与响应时间关系图...
[2025-04-22 16:39:44.750] [调试] 添加TTFT随时间变化图...
[2025-04-22 16:39:44.751] [调试] 保存HTML报告: reports/report_2025-04-22_16-39-44/report.html
[2025-04-22 16:39:44.756] [信息] 生成CSV数据...
[2025-04-22 16:39:44.757] [调试] 创建CSV文件: reports/report_2025-04-22_16-39-44/results.csv
[2025-04-22 16:39:44.757] [调试] 写入CSV头...
[2025-04-22 16:39:44.757] [调试] 写入CSV数据,共3条记录...
[2025-04-22 16:39:44.757] [调试] CSV数据写入完成
[2025-04-22 16:39:44.757] [信息] 报告生成完成
[2025-04-22 16:39:44.757] [信息] 基准测试完成!报告已生成: reports/report_2025-04-22_16-39-44
[2025-04-22 16:39:44.757] [信息] HTML报告: reports/report_2025-04-22_16-39-44/report.html
[2025-04-22 16:39:44.757] [信息] CSV数据: reports/report_2025-04-22_16-39-44/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="vaZEOovdukcp" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_vaZEOovdukcp = echarts.init(document.getElementById('vaZEOovdukcp'), "white");
let option_vaZEOovdukcp = {"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":34273},{"value":38649},{"value":38649},{"value":38649},{"value":11289},{"value":14450},{"value":13680},{"value":13680},{"value":13680},{"value":0.03856057253786327},{"value":431.6818194179979}]}],"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_vaZEOovdukcp = {"areas":{},"type":""}
;
goecharts_vaZEOovdukcp.setOption(option_vaZEOovdukcp);
goecharts_vaZEOovdukcp.dispatchAction(action_vaZEOovdukcp);
</script>
<div class="container">
<div class="item" id="HAStDCAqydOO" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_HAStDCAqydOO = echarts.init(document.getElementById('HAStDCAqydOO'), "white");
let option_HAStDCAqydOO = {"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_HAStDCAqydOO = {"areas":{},"type":""}
;
goecharts_HAStDCAqydOO.setOption(option_HAStDCAqydOO);
goecharts_HAStDCAqydOO.dispatchAction(action_HAStDCAqydOO);
</script>
<div class="container">
<div class="item" id="eyNJQFoXCCJK" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_eyNJQFoXCCJK = echarts.init(document.getElementById('eyNJQFoXCCJK'), "white");
let option_eyNJQFoXCCJK = {"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":["16:38:55"]}],"yAxis":[{}]}
;
let action_eyNJQFoXCCJK = {"areas":{},"type":""}
;
goecharts_eyNJQFoXCCJK.setOption(option_eyNJQFoXCCJK);
goecharts_eyNJQFoXCCJK.dispatchAction(action_eyNJQFoXCCJK);
</script>
<div class="container">
<div class="item" id="NwAMEUNvySAt" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_NwAMEUNvySAt = echarts.init(document.getElementById('NwAMEUNvySAt'), "white");
let option_NwAMEUNvySAt = {"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":79.6,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":255.4,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["16:38:55"]}],"yAxis":[{}]}
;
let action_NwAMEUNvySAt = {"areas":{},"type":""}
;
goecharts_NwAMEUNvySAt.setOption(option_NwAMEUNvySAt);
goecharts_NwAMEUNvySAt.dispatchAction(action_NwAMEUNvySAt);
</script>
<div class="container">
<div class="item" id="NlDENrAQxfFk" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_NlDENrAQxfFk = echarts.init(document.getElementById('NlDENrAQxfFk'), "white");
let option_NlDENrAQxfFk = {"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":28605,"XAxisIndex":0,"YAxisIndex":0},{"value":37107.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":28605,"XAxisIndex":0,"YAxisIndex":0},{"value":37107.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":28605,"XAxisIndex":0,"YAxisIndex":0},{"value":37107.5,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1","2"]}],"yAxis":[{}]}
;
let action_NlDENrAQxfFk = {"areas":{},"type":""}
;
goecharts_NlDENrAQxfFk.setOption(option_NlDENrAQxfFk);
goecharts_NlDENrAQxfFk.dispatchAction(action_NlDENrAQxfFk);
</script>
<div class="container">
<div class="item" id="jSbrZyVkuTxS" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_jSbrZyVkuTxS = echarts.init(document.getElementById('jSbrZyVkuTxS'), "white");
let option_jSbrZyVkuTxS = {"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":12910,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":12869.5,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["16:38:55"]}],"yAxis":[{}]}
;
let action_jSbrZyVkuTxS = {"areas":{},"type":""}
;
goecharts_jSbrZyVkuTxS.setOption(option_jSbrZyVkuTxS);
goecharts_jSbrZyVkuTxS.dispatchAction(action_jSbrZyVkuTxS);
</script>
</body>
</html>
@@ -0,0 +1,4 @@
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error
2025-04-22T16:38:26+08:00,short,49,398,28605,1,12910,
2025-04-22T16:38:55+08:00,short,49,371,25521,2,11289,
2025-04-22T16:38:55+08:00,long,1005,906,48694,2,14450,
1 Timestamp PromptType PromptTokens CompletionTokens ResponseTime Concurrency FirstTokenTime Error
2 2025-04-22T16:38:26+08:00 short 49 398 28605 1 12910
3 2025-04-22T16:38:55+08:00 short 49 371 25521 2 11289
4 2025-04-22T16:38:55+08:00 long 1005 906 48694 2 14450
@@ -0,0 +1,44 @@
[2025-04-22 17:16:42.378] [信息] 日志文件已设置: reports/report_2025-04-22_17-16-42/api_logs.txt
[2025-04-22 17:16:42.378] [信息] API请求响应日志将记录到: reports/report_2025-04-22_17-16-42/api_logs.txt
[2025-04-22 17:16:42.379] [信息] 创建报告输出目录: reports/report_2025-04-22_17-16-42
[2025-04-22 17:16:42.380] [调试] 共有 3 条测试结果记录
[2025-04-22 17:16:42.380] [信息] 计算性能指标...
[2025-04-22 17:16:42.380] [调试] 计算指标 - 总请求数: 3
[2025-04-22 17:16:42.380] [调试] 计算指标 - 成功请求: 0, 失败请求: 3
[2025-04-22 17:16:42.380] [调试] 计算指标 - 超时比率: 100.00%
[2025-04-22 17:16:42.380] [警告] 没有成功的请求,无法计算详细指标
[2025-04-22 17:16:42.380] [信息] 性能指标摘要:
[2025-04-22 17:16:42.380] [信息] 总请求数: 3 (成功: 0, 失败: 3)
[2025-04-22 17:16:42.380] [信息] 超时比率: 100.00%
[2025-04-22 17:16:42.380] [信息] 平均响应时间: 0s
[2025-04-22 17:16:42.380] [信息] P90响应时间: 0s
[2025-04-22 17:16:42.380] [信息] P95响应时间: 0s
[2025-04-22 17:16:42.380] [信息] P99响应时间: 0s
[2025-04-22 17:16:42.380] [信息] 平均QPS: 0.00
[2025-04-22 17:16:42.380] [信息] 最大QPS: 0.00
[2025-04-22 17:16:42.380] [信息] 平均Token生成速率: 0.00 tokens/s
[2025-04-22 17:16:42.380] [信息] 最大Token生成速率: 0.00 tokens/s
[2025-04-22 17:16:42.380] [信息] 最大有效并发用户数: 0
[2025-04-22 17:16:42.380] [信息] 最小首个令牌生成时间: 0s
[2025-04-22 17:16:42.380] [信息] 最大首个令牌生成时间: 0s
[2025-04-22 17:16:42.380] [信息] P90首个令牌生成时间: 0s
[2025-04-22 17:16:42.380] [信息] P95首个令牌生成时间: 0s
[2025-04-22 17:16:42.380] [信息] P99首个令牌生成时间: 0s
[2025-04-22 17:16:42.380] [信息] 生成HTML报告...
[2025-04-22 17:16:42.380] [调试] 创建HTML报告页面...
[2025-04-22 17:16:42.380] [调试] 添加概述图表...
[2025-04-22 17:16:42.380] [调试] 添加响应时间分布图...
[2025-04-22 17:16:42.380] [调试] 添加QPS随时间变化图...
[2025-04-22 17:16:42.381] [调试] 添加Token生成速率随时间变化图...
[2025-04-22 17:16:42.381] [调试] 添加并发与响应时间关系图...
[2025-04-22 17:16:42.381] [调试] 添加TTFT随时间变化图...
[2025-04-22 17:16:42.381] [调试] 保存HTML报告: reports/report_2025-04-22_17-16-42/report.html
[2025-04-22 17:16:42.389] [信息] 生成CSV数据...
[2025-04-22 17:16:42.389] [调试] 创建CSV文件: reports/report_2025-04-22_17-16-42/results.csv
[2025-04-22 17:16:42.389] [调试] 写入CSV头...
[2025-04-22 17:16:42.390] [调试] 写入CSV数据,共3条记录...
[2025-04-22 17:16:42.390] [调试] CSV数据写入完成
[2025-04-22 17:16:42.390] [信息] 报告生成完成
[2025-04-22 17:16:42.390] [信息] 基准测试完成!报告已生成: reports/report_2025-04-22_17-16-42
[2025-04-22 17:16:42.390] [信息] HTML报告: reports/report_2025-04-22_17-16-42/report.html
[2025-04-22 17:16:42.390] [信息] CSV数据: reports/report_2025-04-22_17-16-42/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="VBYVtuQbWiMV" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_VBYVtuQbWiMV = echarts.init(document.getElementById('VBYVtuQbWiMV'), "white");
let option_VBYVtuQbWiMV = {"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":0},{"value":3},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0},{"value":0}]}],"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_VBYVtuQbWiMV = {"areas":{},"type":""}
;
goecharts_VBYVtuQbWiMV.setOption(option_VBYVtuQbWiMV);
goecharts_VBYVtuQbWiMV.dispatchAction(action_VBYVtuQbWiMV);
</script>
<div class="container">
<div class="item" id="hsnmsNCEYAJG" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_hsnmsNCEYAJG = echarts.init(document.getElementById('hsnmsNCEYAJG'), "white");
let option_hsnmsNCEYAJG = {"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_hsnmsNCEYAJG = {"areas":{},"type":""}
;
goecharts_hsnmsNCEYAJG.setOption(option_hsnmsNCEYAJG);
goecharts_hsnmsNCEYAJG.dispatchAction(action_hsnmsNCEYAJG);
</script>
<div class="container">
<div class="item" id="jXWeXGIGUXTb" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_jXWeXGIGUXTb = echarts.init(document.getElementById('jXWeXGIGUXTb'), "white");
let option_jXWeXGIGUXTb = {"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":"QPS随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["17:16:07"]}],"yAxis":[{}]}
;
let action_jXWeXGIGUXTb = {"areas":{},"type":""}
;
goecharts_jXWeXGIGUXTb.setOption(option_jXWeXGIGUXTb);
goecharts_jXWeXGIGUXTb.dispatchAction(action_jXWeXGIGUXTb);
</script>
<div class="container">
<div class="item" id="TbDUiQGEbGUH" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_TbDUiQGEbGUH = echarts.init(document.getElementById('TbDUiQGEbGUH'), "white");
let option_TbDUiQGEbGUH = {"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":["17:16:07"]}],"yAxis":[{}]}
;
let action_TbDUiQGEbGUH = {"areas":{},"type":""}
;
goecharts_TbDUiQGEbGUH.setOption(option_TbDUiQGEbGUH);
goecharts_TbDUiQGEbGUH.dispatchAction(action_TbDUiQGEbGUH);
</script>
<div class="container">
<div class="item" id="DORyNBxQrPfZ" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_DORyNBxQrPfZ = echarts.init(document.getElementById('DORyNBxQrPfZ'), "white");
let option_DORyNBxQrPfZ = {"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":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"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":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"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":0,"XAxisIndex":0,"YAxisIndex":0},{"value":0,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1","2"]}],"yAxis":[{}]}
;
let action_DORyNBxQrPfZ = {"areas":{},"type":""}
;
goecharts_DORyNBxQrPfZ.setOption(option_DORyNBxQrPfZ);
goecharts_DORyNBxQrPfZ.dispatchAction(action_DORyNBxQrPfZ);
</script>
<div class="container">
<div class="item" id="lgLNOEvORYpS" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_lgLNOEvORYpS = echarts.init(document.getElementById('lgLNOEvORYpS'), "white");
let option_lgLNOEvORYpS = {"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":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["17:16:07"]}],"yAxis":[{}]}
;
let action_lgLNOEvORYpS = {"areas":{},"type":""}
;
goecharts_lgLNOEvORYpS.setOption(option_lgLNOEvORYpS);
goecharts_lgLNOEvORYpS.dispatchAction(action_lgLNOEvORYpS);
</script>
</body>
</html>
@@ -0,0 +1,4 @@
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error
2025-04-22T17:15:36+08:00,long,979,0,0,1,0,发送请求失败: Post "http://139.9.229.200:8080/v1/chat/completions": dial tcp 139.9.229.200:8080: i/o timeout
2025-04-22T17:16:07+08:00,short,51,0,0,2,0,发送请求失败: Post "http://139.9.229.200:8080/v1/chat/completions": dial tcp 139.9.229.200:8080: i/o timeout
2025-04-22T17:16:07+08:00,long,955,0,0,2,0,发送请求失败: Post "http://139.9.229.200:8080/v1/chat/completions": dial tcp 139.9.229.200:8080: i/o timeout
Can't render this file because it contains an unexpected character in line 2 and column 69.
@@ -0,0 +1,55 @@
[2025-04-22 17:18:50.907] [信息] 日志文件已设置: reports/report_2025-04-22_17-18-50/api_logs.txt
[2025-04-22 17:18:50.910] [信息] API请求响应日志将记录到: reports/report_2025-04-22_17-18-50/api_logs.txt
[2025-04-22 17:18:50.910] [信息] 创建报告输出目录: reports/report_2025-04-22_17-18-50
[2025-04-22 17:18:50.910] [调试] 共有 3 条测试结果记录
[2025-04-22 17:18:50.910] [信息] 计算性能指标...
[2025-04-22 17:18:50.910] [调试] 计算指标 - 总请求数: 3
[2025-04-22 17:18:50.910] [调试] 计算指标 - 成功请求: 3, 失败请求: 0
[2025-04-22 17:18:50.910] [调试] 计算指标 - 超时比率: 0.00%
[2025-04-22 17:18:50.910] [调试] 计算指标 - 响应时间(ms) - 平均: 41352.67, P90: 49964.00, P95: 49964.00, P99: 49964.00, 最小: 24130.00, 最大: 51447.00
[2025-04-22 17:18:50.910] [调试] 计算指标 - TTFT(ms) - 最小: 11284.00, 最大: 14291.00, P90: 13733.50, P95: 13733.50, P99: 13733.50
[2025-04-22 17:18:50.910] [调试] 计算指标 - 平均QPS: 0.03 (总持续时间: 100.52秒)
[2025-04-22 17:18:50.910] [调试] 计算各并发步骤的QPS...
[2025-04-22 17:18:50.910] [调试] 并发步骤 1: 持续时间过短
[2025-04-22 17:18:50.910] [调试] 并发步骤 2: QPS = 458.27 (成功请求: 2, 持续时间: 0.00秒)
[2025-04-22 17:18:50.910] [调试] 更新最大QPS: 458.27 (并发步骤: 2)
[2025-04-22 17:18:50.910] [调试] 更新最大有效并发用户数: 2
[2025-04-22 17:18:50.910] [调试] 计算指标 - 平均Token生成速率: 23.57 tokens/s (总Token: 2369)
[2025-04-22 17:18:50.910] [调试] 计算各并发步骤的Token生成速率...
[2025-04-22 17:18:50.910] [调试] 并发步骤 2: Token生成速率 = 286418.06 tokens/s (总Token: 1250, 持续时间: 0.00秒)
[2025-04-22 17:18:50.910] [调试] 更新最大Token生成速率: 286418.06 tokens/s (并发步骤: 2)
[2025-04-22 17:18:50.910] [信息] 性能指标摘要:
[2025-04-22 17:18:50.910] [信息] 总请求数: 3 (成功: 3, 失败: 0)
[2025-04-22 17:18:50.910] [信息] 超时比率: 0.00%
[2025-04-22 17:18:50.910] [信息] 平均响应时间: 41.352s
[2025-04-22 17:18:50.910] [信息] P90响应时间: 49.964s
[2025-04-22 17:18:50.910] [信息] P95响应时间: 49.964s
[2025-04-22 17:18:50.910] [信息] P99响应时间: 49.964s
[2025-04-22 17:18:50.910] [信息] 平均QPS: 0.03
[2025-04-22 17:18:50.910] [信息] 最大QPS: 458.27
[2025-04-22 17:18:50.910] [信息] 平均Token生成速率: 23.57 tokens/s
[2025-04-22 17:18:50.910] [信息] 最大Token生成速率: 286418.06 tokens/s
[2025-04-22 17:18:50.910] [信息] 最大有效并发用户数: 2
[2025-04-22 17:18:50.910] [信息] 最小首个令牌生成时间: 11.284s
[2025-04-22 17:18:50.910] [信息] 最大首个令牌生成时间: 14.291s
[2025-04-22 17:18:50.910] [信息] P90首个令牌生成时间: 13.733s
[2025-04-22 17:18:50.910] [信息] P95首个令牌生成时间: 13.733s
[2025-04-22 17:18:50.910] [信息] P99首个令牌生成时间: 13.733s
[2025-04-22 17:18:50.910] [信息] 生成HTML报告...
[2025-04-22 17:18:50.910] [调试] 创建HTML报告页面...
[2025-04-22 17:18:50.910] [调试] 添加概述图表...
[2025-04-22 17:18:50.910] [调试] 添加响应时间分布图...
[2025-04-22 17:18:50.910] [调试] 添加QPS随时间变化图...
[2025-04-22 17:18:50.910] [调试] 添加Token生成速率随时间变化图...
[2025-04-22 17:18:50.910] [调试] 添加并发与响应时间关系图...
[2025-04-22 17:18:50.911] [调试] 添加TTFT随时间变化图...
[2025-04-22 17:18:50.911] [调试] 保存HTML报告: reports/report_2025-04-22_17-18-50/report.html
[2025-04-22 17:18:50.914] [信息] 生成CSV数据...
[2025-04-22 17:18:50.914] [调试] 创建CSV文件: reports/report_2025-04-22_17-18-50/results.csv
[2025-04-22 17:18:50.915] [调试] 写入CSV头...
[2025-04-22 17:18:50.915] [调试] 写入CSV数据,共3条记录...
[2025-04-22 17:18:50.915] [调试] CSV数据写入完成
[2025-04-22 17:18:50.915] [信息] 报告生成完成
[2025-04-22 17:18:50.915] [信息] 基准测试完成!报告已生成: reports/report_2025-04-22_17-18-50
[2025-04-22 17:18:50.915] [信息] HTML报告: reports/report_2025-04-22_17-18-50/report.html
[2025-04-22 17:18:50.915] [信息] CSV数据: reports/report_2025-04-22_17-18-50/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="FJlukWMElzMM" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_FJlukWMElzMM = echarts.init(document.getElementById('FJlukWMElzMM'), "white");
let option_FJlukWMElzMM = {"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":41352},{"value":49964},{"value":49964},{"value":49964},{"value":11284},{"value":14291},{"value":13733},{"value":13733},{"value":13733},{"value":0.029844102293535076},{"value":458.2688892707796}]}],"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_FJlukWMElzMM = {"areas":{},"type":""}
;
goecharts_FJlukWMElzMM.setOption(option_FJlukWMElzMM);
goecharts_FJlukWMElzMM.dispatchAction(action_FJlukWMElzMM);
</script>
<div class="container">
<div class="item" id="vzePhhKEVGbM" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_vzePhhKEVGbM = echarts.init(document.getElementById('vzePhhKEVGbM'), "white");
let option_vzePhhKEVGbM = {"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_vzePhhKEVGbM = {"areas":{},"type":""}
;
goecharts_vzePhhKEVGbM.setOption(option_vzePhhKEVGbM);
goecharts_vzePhhKEVGbM.dispatchAction(action_vzePhhKEVGbM);
</script>
<div class="container">
<div class="item" id="YmyPZJWtHNpM" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_YmyPZJWtHNpM = echarts.init(document.getElementById('YmyPZJWtHNpM'), "white");
let option_YmyPZJWtHNpM = {"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":["17:18:01"]}],"yAxis":[{}]}
;
let action_YmyPZJWtHNpM = {"areas":{},"type":""}
;
goecharts_YmyPZJWtHNpM.setOption(option_YmyPZJWtHNpM);
goecharts_YmyPZJWtHNpM.dispatchAction(action_YmyPZJWtHNpM);
</script>
<div class="container">
<div class="item" id="QjIFgdDKEMAk" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_QjIFgdDKEMAk = echarts.init(document.getElementById('QjIFgdDKEMAk'), "white");
let option_QjIFgdDKEMAk = {"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":223.8,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":250,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["17:18:01"]}],"yAxis":[{}]}
;
let action_QjIFgdDKEMAk = {"areas":{},"type":""}
;
goecharts_QjIFgdDKEMAk.setOption(option_QjIFgdDKEMAk);
goecharts_QjIFgdDKEMAk.dispatchAction(action_QjIFgdDKEMAk);
</script>
<div class="container">
<div class="item" id="HawyIfGFKPBk" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_HawyIfGFKPBk = echarts.init(document.getElementById('HawyIfGFKPBk'), "white");
let option_HawyIfGFKPBk = {"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":51447,"XAxisIndex":0,"YAxisIndex":0},{"value":36305.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":51447,"XAxisIndex":0,"YAxisIndex":0},{"value":36305.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":51447,"XAxisIndex":0,"YAxisIndex":0},{"value":36305.5,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1","2"]}],"yAxis":[{}]}
;
let action_HawyIfGFKPBk = {"areas":{},"type":""}
;
goecharts_HawyIfGFKPBk.setOption(option_HawyIfGFKPBk);
goecharts_HawyIfGFKPBk.dispatchAction(action_HawyIfGFKPBk);
</script>
<div class="container">
<div class="item" id="nHNjgzPnVbGc" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_nHNjgzPnVbGc = echarts.init(document.getElementById('nHNjgzPnVbGc'), "white");
let option_nHNjgzPnVbGc = {"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":13176,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":12787.5,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["17:18:01"]}],"yAxis":[{}]}
;
let action_nHNjgzPnVbGc = {"areas":{},"type":""}
;
goecharts_nHNjgzPnVbGc.setOption(option_nHNjgzPnVbGc);
goecharts_nHNjgzPnVbGc.dispatchAction(action_nHNjgzPnVbGc);
</script>
</body>
</html>
@@ -0,0 +1,4 @@
Timestamp,PromptType,PromptTokens,CompletionTokens,ResponseTime,Concurrency,FirstTokenTime,Error
2025-04-22T17:17:10+08:00,long,958,1119,51447,1,13176,
2025-04-22T17:18:01+08:00,short,50,250,24130,2,14291,
2025-04-22T17:18:01+08:00,long,957,1000,48481,2,11284,
1 Timestamp PromptType PromptTokens CompletionTokens ResponseTime Concurrency FirstTokenTime Error
2 2025-04-22T17:17:10+08:00 long 958 1119 51447 1 13176
3 2025-04-22T17:18:01+08:00 short 50 250 24130 2 14291
4 2025-04-22T17:18:01+08:00 long 957 1000 48481 2 11284
@@ -0,0 +1,55 @@
[2025-04-22 17:37:34.946] [信息] 日志文件已设置: reports/report_2025-04-22_17-37-34/api_logs.txt
[2025-04-22 17:37:34.946] [信息] API请求响应日志将记录到: reports/report_2025-04-22_17-37-34/api_logs.txt
[2025-04-22 17:37:34.946] [信息] 创建报告输出目录: reports/report_2025-04-22_17-37-34
[2025-04-22 17:37:34.946] [调试] 共有 3 条测试结果记录
[2025-04-22 17:37:34.946] [信息] 计算性能指标...
[2025-04-22 17:37:34.946] [调试] 计算指标 - 总请求数: 3
[2025-04-22 17:37:34.946] [调试] 计算指标 - 成功请求: 3, 失败请求: 0
[2025-04-22 17:37:34.946] [调试] 计算指标 - 超时比率: 0.00%
[2025-04-22 17:37:34.946] [调试] 计算指标 - 响应时间(ms) - 平均: 48196.33, P90: 54100.50, P95: 54100.50, P99: 54100.50, 最小: 36388.00, 最大: 54352.00
[2025-04-22 17:37:34.946] [调试] 计算指标 - TTFT(ms) - 最小: 12860.00, 最大: 23094.00, P90: 20190.00, P95: 20190.00, P99: 20190.00
[2025-04-22 17:37:34.946] [调试] 计算指标 - 平均QPS: 0.03 (总持续时间: 110.94秒)
[2025-04-22 17:37:34.946] [调试] 计算各并发步骤的QPS...
[2025-04-22 17:37:34.946] [调试] 并发步骤 1: 持续时间过短
[2025-04-22 17:37:34.946] [调试] 并发步骤 2: QPS = 968.00 (成功请求: 2, 持续时间: 0.00秒)
[2025-04-22 17:37:34.946] [调试] 更新最大QPS: 968.00 (并发步骤: 2)
[2025-04-22 17:37:34.946] [调试] 更新最大有效并发用户数: 2
[2025-04-22 17:37:34.946] [调试] 计算指标 - 平均Token生成速率: 27.46 tokens/s (总Token: 3046)
[2025-04-22 17:37:34.946] [调试] 计算各并发步骤的Token生成速率...
[2025-04-22 17:37:34.946] [调试] 并发步骤 2: Token生成速率 = 884748.02 tokens/s (总Token: 1828, 持续时间: 0.00秒)
[2025-04-22 17:37:34.946] [调试] 更新最大Token生成速率: 884748.02 tokens/s (并发步骤: 2)
[2025-04-22 17:37:34.946] [信息] 性能指标摘要:
[2025-04-22 17:37:34.946] [信息] 总请求数: 3 (成功: 3, 失败: 0)
[2025-04-22 17:37:34.946] [信息] 超时比率: 0.00%
[2025-04-22 17:37:34.946] [信息] 平均响应时间: 48.196s
[2025-04-22 17:37:34.946] [信息] P90响应时间: 54.1s
[2025-04-22 17:37:34.946] [信息] P95响应时间: 54.1s
[2025-04-22 17:37:34.946] [信息] P99响应时间: 54.1s
[2025-04-22 17:37:34.946] [信息] 平均QPS: 0.03
[2025-04-22 17:37:34.946] [信息] 最大QPS: 968.00
[2025-04-22 17:37:34.946] [信息] 平均Token生成速率: 27.46 tokens/s
[2025-04-22 17:37:34.946] [信息] 最大Token生成速率: 884748.02 tokens/s
[2025-04-22 17:37:34.946] [信息] 最大有效并发用户数: 2
[2025-04-22 17:37:34.946] [信息] 最小首个令牌生成时间: 12.86s
[2025-04-22 17:37:34.946] [信息] 最大首个令牌生成时间: 23.094s
[2025-04-22 17:37:34.946] [信息] P90首个令牌生成时间: 20.19s
[2025-04-22 17:37:34.947] [信息] P95首个令牌生成时间: 20.19s
[2025-04-22 17:37:34.947] [信息] P99首个令牌生成时间: 20.19s
[2025-04-22 17:37:34.947] [信息] 生成HTML报告...
[2025-04-22 17:37:34.947] [调试] 创建HTML报告页面...
[2025-04-22 17:37:34.947] [调试] 添加概述图表...
[2025-04-22 17:37:34.947] [调试] 添加响应时间分布图...
[2025-04-22 17:37:34.947] [调试] 添加QPS随时间变化图...
[2025-04-22 17:37:34.947] [调试] 添加Token生成速率随时间变化图...
[2025-04-22 17:37:34.947] [调试] 添加并发与响应时间关系图...
[2025-04-22 17:37:34.947] [调试] 添加TTFT随时间变化图...
[2025-04-22 17:37:34.947] [调试] 保存HTML报告: reports/report_2025-04-22_17-37-34/report.html
[2025-04-22 17:37:34.953] [信息] 生成CSV数据...
[2025-04-22 17:37:34.953] [调试] 创建CSV文件: reports/report_2025-04-22_17-37-34/results.csv
[2025-04-22 17:37:34.953] [调试] 写入CSV头...
[2025-04-22 17:37:34.953] [调试] 写入CSV数据,共3条记录...
[2025-04-22 17:37:34.953] [调试] CSV数据写入完成
[2025-04-22 17:37:34.953] [信息] 报告生成完成
[2025-04-22 17:37:34.953] [信息] 基准测试完成!报告已生成: reports/report_2025-04-22_17-37-34
[2025-04-22 17:37:34.953] [信息] HTML报告: reports/report_2025-04-22_17-37-34/report.html
[2025-04-22 17:37:34.953] [信息] CSV数据: reports/report_2025-04-22_17-37-34/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="xCOcpSWYyAGW" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_xCOcpSWYyAGW = echarts.init(document.getElementById('xCOcpSWYyAGW'), "white");
let option_xCOcpSWYyAGW = {"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":0},{"value":48196},{"value":54100},{"value":54100},{"value":54100},{"value":36388},{"value":54352},{"value":12860},{"value":23094},{"value":20190},{"value":20190},{"value":20190},{"value":0.027040685394883506},{"value":967.995644019602},{"value":27.455309237605054},{"value":884748.0186339163},{"value":2}]}],"title":{"text":"性能概览"},"tooltip":{"show":false},"xAxis":[{"data":["总请求数","成功请求数","失败请求数","超时比率(%)","平均响应时间(ms)","P90响应时间(ms)","P95响应时间(ms)","P99响应时间(ms)","最小响应时间(ms)","最大响应时间(ms)","最小TTFT(ms)","最大TTFT(ms)","P90 TTFT(ms)","P95 TTFT(ms)","P99 TTFT(ms)","平均QPS","最大QPS","平均Token生成速率(tokens/s)","最大Token生成速率(tokens/s)","最大有效并发用户数"]}],"yAxis":[{}]}
;
let action_xCOcpSWYyAGW = {"areas":{},"type":""}
;
goecharts_xCOcpSWYyAGW.setOption(option_xCOcpSWYyAGW);
goecharts_xCOcpSWYyAGW.dispatchAction(action_xCOcpSWYyAGW);
</script>
<div class="container">
<div class="item" id="kPZWbxGpYxEY" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_kPZWbxGpYxEY = echarts.init(document.getElementById('kPZWbxGpYxEY'), "white");
let option_kPZWbxGpYxEY = {"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_kPZWbxGpYxEY = {"areas":{},"type":""}
;
goecharts_kPZWbxGpYxEY.setOption(option_kPZWbxGpYxEY);
goecharts_kPZWbxGpYxEY.dispatchAction(action_kPZWbxGpYxEY);
</script>
<div class="container">
<div class="item" id="vnquLiEpoKRA" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_vnquLiEpoKRA = echarts.init(document.getElementById('vnquLiEpoKRA'), "white");
let option_vnquLiEpoKRA = {"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":["17:36:40"]}],"yAxis":[{}]}
;
let action_vnquLiEpoKRA = {"areas":{},"type":""}
;
goecharts_vnquLiEpoKRA.setOption(option_vnquLiEpoKRA);
goecharts_vnquLiEpoKRA.dispatchAction(action_vnquLiEpoKRA);
</script>
<div class="container">
<div class="item" id="YExMNdZOyAZX" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_YExMNdZOyAZX = echarts.init(document.getElementById('YExMNdZOyAZX'), "white");
let option_YExMNdZOyAZX = {"animation":true,"color":["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],"legend":{"show":true,"type":""},"series":[{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":365.6,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 1","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":243.6,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"Token生成速率随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["17:35:44"]}],"yAxis":[{}]}
;
let action_YExMNdZOyAZX = {"areas":{},"type":""}
;
goecharts_YExMNdZOyAZX.setOption(option_YExMNdZOyAZX);
goecharts_YExMNdZOyAZX.dispatchAction(action_YExMNdZOyAZX);
</script>
<div class="container">
<div class="item" id="YXYQYEwQXnFv" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_YXYQYEwQXnFv = echarts.init(document.getElementById('YXYQYEwQXnFv'), "white");
let option_YXYQYEwQXnFv = {"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":53849,"XAxisIndex":0,"YAxisIndex":0},{"value":45370,"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":53849,"XAxisIndex":0,"YAxisIndex":0},{"value":45370,"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":53849,"XAxisIndex":0,"YAxisIndex":0},{"value":45370,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"并发与响应时间关系"},"tooltip":{"show":false},"xAxis":[{"data":["1","2"]}],"yAxis":[{}]}
;
let action_YXYQYEwQXnFv = {"areas":{},"type":""}
;
goecharts_YXYQYEwQXnFv.setOption(option_YXYQYEwQXnFv);
goecharts_YXYQYEwQXnFv.dispatchAction(action_YXYQYEwQXnFv);
</script>
<div class="container">
<div class="item" id="YIMMOZBeQHGr" style="width:900px;height:500px;"></div>
</div>
<script type="text/javascript">
"use strict";
let goecharts_YIMMOZBeQHGr = echarts.init(document.getElementById('YIMMOZBeQHGr'), "white");
let option_YIMMOZBeQHGr = {"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":17286,"XAxisIndex":0,"YAxisIndex":0}]},{"name":"并发 2","type":"line","smooth":false,"connectNulls":false,"showSymbol":false,"waveAnimation":false,"renderLabelForZeroData":false,"selectedMode":false,"animation":true,"data":[{"value":17977,"XAxisIndex":0,"YAxisIndex":0}]}],"title":{"text":"TTFT随时间变化"},"tooltip":{"show":false},"xAxis":[{"data":["17:36:40"]}],"yAxis":[{}]}
;
let action_YIMMOZBeQHGr = {"areas":{},"type":""}
;
goecharts_YIMMOZBeQHGr.setOption(option_YIMMOZBeQHGr);
goecharts_YIMMOZBeQHGr.dispatchAction(action_YIMMOZBeQHGr);
</script>
</body>
</html>
@@ -0,0 +1,4 @@
Timestamp,PromptType,PromptTokens,CompletionTokens,TotalTokens,ResponseTime(ms),FirstTokenTime(ms),Concurrency,Error,ReasoningContent
2025-04-22T17:35:44+08:00,long,973,1218,2191,53849,17286,1,,""
2025-04-22T17:36:40+08:00,short,47,757,804,36388,12860,2,,""
2025-04-22T17:36:40+08:00,long,970,1071,2041,54352,23094,2,,""
1 Timestamp PromptType PromptTokens CompletionTokens TotalTokens ResponseTime(ms) FirstTokenTime(ms) Concurrency Error ReasoningContent
2 2025-04-22T17:35:44+08:00 long 973 1218 2191 53849 17286 1
3 2025-04-22T17:36:40+08:00 short 47 757 804 36388 12860 2
4 2025-04-22T17:36:40+08:00 long 970 1071 2041 54352 23094 2