Skip to content

Instantly share code, notes, and snippets.

@ngerakines
Last active September 7, 2019 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngerakines/fac00af6256addf2bdb8e402083fefd8 to your computer and use it in GitHub Desktop.
Save ngerakines/fac00af6256addf2bdb8e402083fefd8 to your computer and use it in GitHub Desktop.
docker run --rm -i -p 5003:5003 docker.pkg.github.com/sslhound/svger/svger:dev /app/svger --backend https://img.shields.io --backend-insecure=true --enable-post=false
[2019-09-07 16:50:42.922] [info] svger starting up environment=development listen=0.0.0.0 backend=https://img.shields.io
[2019-09-07 16:50:42.927] [info] Started server on http://0.0.0.0:5003/
curl -vv -skH "Content-Type: image/svg+xml" --data "@badge.svg" http://localhost:5003/ > badge.png
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 5003 (#0)
> POST / HTTP/1.1
> Host: localhost:5003
> User-Agent: curl/7.59.0
> Accept: */*
> Content-Type: image/svg+xml
> Content-Length: 900
>
} [900 bytes data]
* upload completely sent off: 900 out of 900 bytes
< HTTP/1.1 405 Method Not Allowed
< Allow: GET
< Content-Length: 0
<
* Connection #0 to host localhost left intact
docker run --rm -p 5003:5003 docker.pkg.github.com/sslhound/svger/svger:dev /app/svger --backend https://img.shields.io --backend-insecure=true
curl -sk http://localhost:5003/
OK
curl -vv -skH "Content-Type: image/svg+xml" --data "@badge.svg" http://localhost:5003/ > badge.png
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 5003 (#0)
> POST / HTTP/1.1
> Host: localhost:5003
> User-Agent: curl/7.59.0
> Accept: */*
> Content-Type: image/svg+xml
> Content-Length: 900
>
} [900 bytes data]
* upload completely sent off: 900 out of 900 bytes
< HTTP/1.1 200 OK
< Content-Length: 2705
< Content-Type: image/png
<
{ [2705 bytes data]
* Connection #0 to host localhost left intact
curl -vvsk http://localhost:5003/badge/nick-rocks-green > badge.png
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 5003 (#0)
> GET /badge/nick-rocks-green HTTP/1.1
> Host: localhost:5003
> User-Agent: curl/7.59.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: max-age=86400
< Content-Length: 1344
< Content-Type: image/png
< Last-Modified: Fri, 06 Sep 2019 19:43:06 GMT
<
{ [1344 bytes data]
* Connection #0 to host localhost left intact
curl -vvsk http://localhost:5003/badge/nick-rocks-green > badge.png
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 5003 (#0)
> GET /badge/nick-rocks-green HTTP/1.1
> Host: localhost:5003
> User-Agent: curl/7.59.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Cache-Control: max-age=86400
< Content-Length: 1344
< Content-Type: image/png
< Last-Modified: Fri, 06 Sep 2019 19:43:06 GMT
<
{ [1344 bytes data]
* Connection #0 to host localhost left intact
curl -vvsk -H "If-Modified-Since: Fri, 06 Sep 2019 19:43:07 GMT" http://localhost:5003/badge/nick-rocks-green
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 5003 (#0)
> GET /badge/nick-rocks-green HTTP/1.1
> Host: localhost:5003
> User-Agent: curl/7.59.0
> Accept: */*
> If-Modified-Since: Fri, 06 Sep 2019 19:43:07 GMT
>
< HTTP/1.1 304 Not Modified
< Content-Length: 0
<
* Connection #0 to host localhost left intact
curl -vvsk http://localhost:5003/metrics
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 5003 (#0)
> GET /metrics HTTP/1.1
> Host: localhost:5003
> User-Agent: curl/7.59.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 2624
< Content-Type: text/plain; charset=utf-8
<
# HELP server_transferred_bytes_total Transferred bytes to from svger
# TYPE server_transferred_bytes_total counter
server_transferred_bytes_total{application="svger"} 5393.000000
# HELP server_get_latencies Latencies of serving svger GET requests, in microseconds
# TYPE server_get_latencies summary
server_get_latencies_count{application="svger"} 2
server_get_latencies_sum{application="svger"} 21514991.000000
server_get_latencies{application="svger",quantile="0.500000"} 250175.000000
server_get_latencies{application="svger",quantile="0.900000"} 250175.000000
server_get_latencies{application="svger",quantile="0.990000"} 250175.000000
# HELP server_post_latencies Latencies of serving svger POST requests, in microseconds
# TYPE server_post_latencies summary
server_post_latencies_count{application="svger"} 1
server_post_latencies_sum{application="svger"} 28116.000000
server_post_latencies{application="svger",quantile="0.500000"} 28116.000000
server_post_latencies{application="svger",quantile="0.900000"} 28116.000000
server_post_latencies{application="svger",quantile="0.990000"} 28116.000000
# HELP server_get_total Number of times a GET request was made
# TYPE server_get_total counter
server_get_total{application="svger"} 5.000000
# HELP backend_post_total Number of times a POST request was made
# TYPE backend_post_total counter
backend_post_total{application="svger"} 1.000000
# HELP backend_bytes_transferred_total Transferred bytes to from backend
# TYPE backend_bytes_transferred_total counter
backend_bytes_transferred_total{application="svger"} 0.000000
# HELP backend_post_total Number of times a backend request was made
# TYPE backend_post_total counter
backend_post_total{application="svger"} 3.000000
# HELP backend_request_latencies Latencies of backend requests, in microseconds
# TYPE backend_request_latencies summary
backend_request_latencies_count{application="svger"} 3
backend_request_latencies_sum{application="svger"} 21599143.000000
backend_request_latencies{application="svger",quantile="0.500000"} 189646.000000
backend_request_latencies{application="svger",quantile="0.900000"} 201076.000000
backend_request_latencies{application="svger",quantile="0.990000"} 201076.000000
# HELP render_latencies Latencies of render work, in microseconds
# TYPE render_latencies summary
render_latencies_count{application="svger"} 3
render_latencies_sum{application="svger"} 30878.000000
render_latencies{application="svger",quantile="0.500000"} 1457.000000
render_latencies{application="svger",quantile="0.900000"} 1593.000000
render_latencies{application="svger",quantile="0.990000"} 1593.000000
* Connection #0 to host localhost left intact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment