File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,6 @@ jobs:
174
174
name : benchmark-results
175
175
compression-level : 9
176
176
path : |
177
- examples/server/bench/**/ .png
178
- examples/server/bench/**/ .json
179
- examples/server/bench/**/ .log
177
+ examples/server/bench/*.png
178
+ examples/server/bench/*.json
179
+ examples/server/bench/*.log
Original file line number Diff line number Diff line change 1
1
import argparse
2
- import base64
3
2
import json
4
3
import os
5
4
import re
13
12
from contextlib import closing
14
13
from datetime import datetime
15
14
15
+ import matplotlib
16
+ import matplotlib .dates
16
17
import matplotlib .pyplot as plt
17
18
import requests
18
19
@@ -109,6 +110,10 @@ def main(args_in: list[str] | None = None) -> None:
109
110
for metric in metrics :
110
111
resp = requests .get (f"http://localhost:9090/api/v1/query_range" ,
111
112
params = {'query' : 'llamacpp:' + metric , 'start' : start_time , 'end' : end_time , 'step' : 2 })
113
+
114
+ with open (f"{ metric } .json" , 'w' ) as metric_json :
115
+ metric_json .write (resp .text )
116
+
112
117
if resp .status_code != 200 :
113
118
print (f"bench: unable to extract prometheus metric { metric } : { resp .text } " )
114
119
else :
@@ -131,6 +136,8 @@ def main(args_in: list[str] | None = None) -> None:
131
136
f"parallel={ args .parallel } ctx-size={ args .ctx_size } ngl={ args .n_gpu_layers } batch-size={ args .batch_size } ubatch-size={ args .ubatch_size } \n "
132
137
f"pp={ args .max_prompt_tokens } pp+tg={ args .max_tokens } \n "
133
138
f"branch={ args .branch } commit={ args .commit } " , fontsize = 14 , wrap = True )
139
+ plt .gca ().xaxis .set_major_locator (matplotlib .dates .MinuteLocator ())
140
+ plt .gca ().xaxis .set_major_formatter (matplotlib .dates .DateFormatter ("%Y%m%d %H:%M:%S" ))
134
141
plt .gcf ().autofmt_xdate ()
135
142
136
143
# Remove borders
You can’t perform that action at this time.
0 commit comments