diff options
| author | Xe Iaso <me@xeiaso.net> | 2023-03-05 16:23:33 -0500 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2023-03-05 16:23:33 -0500 |
| commit | b29f4583327c98a18eaebd98ccd6d416504128e4 (patch) | |
| tree | 69daf2121b8ca2e70508c650aa74c78192648a60 /cmd/xedn | |
| parent | ea95496b1d9c9637bad0159b04e781daab359f1d (diff) | |
| download | x-b29f4583327c98a18eaebd98ccd6d416504128e4.tar.xz x-b29f4583327c98a18eaebd98ccd6d416504128e4.zip | |
add cryptocompare API bindings
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'cmd/xedn')
| -rw-r--r-- | cmd/xedn/stablediffusion.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd/xedn/stablediffusion.go b/cmd/xedn/stablediffusion.go index 6bc18c0..0b8c3cf 100644 --- a/cmd/xedn/stablediffusion.go +++ b/cmd/xedn/stablediffusion.go @@ -3,6 +3,7 @@ package main import ( "bytes" "context" + "expvar" "fmt" "image" "image/jpeg" @@ -20,6 +21,11 @@ import ( "within.website/x/internal/stablediffusion" ) +var ( + stableDiffusionHits = expvar.NewInt("xedn_avatar_hits") + stableDiffusionCreation = expvar.NewInt("xedn_avatar_creation") +) + type StableDiffusion struct { client *stablediffusion.Client db *bbolt.DB @@ -55,6 +61,8 @@ func (sd *StableDiffusion) RenderImage(ctx context.Context, w http.ResponseWrite return nil, err } + stableDiffusionCreation.Add(1) + img, _, err := image.Decode(bytes.NewBuffer(imgs.Images[0])) if err != nil { return nil, err @@ -140,6 +148,8 @@ func (sd *StableDiffusion) ServeHTTP(w http.ResponseWriter, r *http.Request) { w.Write(data) } + stableDiffusionHits.Add(1) + return nil }) |
