Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add format=badge which directly serves badges #62

Closed
wants to merge 0 commits into from

Conversation

vaskozl
Copy link
Contributor

@vaskozl vaskozl commented Aug 7, 2024

Adds support for directly generating badges so as to remove the need for shields.io.

I've added DejaVuSans.ttf to the container as go-badge requires a font in order to calculate spacing. Another font can also be configured and mounted in the container if desired.

Example:
https://kromgo.sko.ai/query?metric=nodes&format=badge

@vaskozl
Copy link
Contributor Author

vaskozl commented Aug 7, 2024

Apache Bench on my machine:

vasko@anchor ~ % ab -n 100 -c 10 'https://kromgo.sko.ai/query?metric=pods&format=badge'
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking kromgo.sko.ai (be patient).....done


Server Software:        
Server Hostname:        kromgo.sko.ai
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128
Server Temp Key:        ECDH X25519 253 bits
TLS Server Name:        kromgo.sko.ai

Document Path:          /query?metric=pods&format=badge
Document Length:        1122 bytes

Concurrency Level:      10
Time taken for tests:   6.542 seconds
Complete requests:      100
Failed requests:        34
   (Connect: 0, Receive: 0, Length: 34, Exceptions: 0)
Non-2xx responses:      33
Total transferred:      104707 bytes
HTML transferred:       78703 bytes
Requests per second:    15.29 [#/sec] (mean)
Time per request:       654.210 [ms] (mean)
Time per request:       65.421 [ms] (mean, across all concurrent requests)
Transfer rate:          15.63 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       23   50  10.9     49      69
Processing:    22  577 306.1    549    1546
Waiting:       22  576 306.2    549    1546
Total:         62  626 307.2    604    1592

Percentage of the requests served within a certain time (ms)
  50%    604
  66%    697
  75%    764
  80%    825
  90%   1044
  95%   1268
  98%   1590
  99%   1592
 100%   1592 (longest request)
vasko@anchor ~ % ab -n 100 -c 10 'https://kromgo.sko.ai/query?metric=pods'             
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking kromgo.sko.ai (be patient).....done


Server Software:        
Server Hostname:        kromgo.sko.ai
Server Port:            443
SSL/TLS Protocol:       TLSv1.2,ECDHE-RSA-AES128-GCM-SHA256,2048,128
Server Temp Key:        ECDH X25519 253 bits
TLS Server Name:        kromgo.sko.ai

Document Path:          /query?metric=pods
Document Length:        67 bytes

Concurrency Level:      10
Time taken for tests:   4.223 seconds
Complete requests:      100
Failed requests:        0
Total transferred:      39800 bytes
HTML transferred:       6700 bytes
Requests per second:    23.68 [#/sec] (mean)
Time per request:       422.305 [ms] (mean)
Time per request:       42.230 [ms] (mean, across all concurrent requests)
Transfer rate:          9.20 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       25   49  12.4     48      77
Processing:    10  357 260.4    351    1135
Waiting:       10  357 260.6    351    1133
Total:         41  406 258.7    399    1165

Percentage of the requests served within a certain time (ms)
  50%    399
  66%    499
  75%    567
  80%    602
  90%    769
  95%    899
  98%   1163
  99%   1165
 100%   1165 (longest request)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant