]> git.giacomolli.uk - onechat/blobdiff - responses.go
Measure the compactor with a probe run
[onechat] / responses.go
index 9d6b75f6c05ce2e55335e77b44877b69ea56df5f..ebffaa36aaa3e477cc9a722f2fbbfea16a8f5a52 100644 (file)
@@ -57,7 +57,6 @@ type Client struct {
        cacheKey string
        usage    *usageLog
        http     *http.Client
        cacheKey string
        usage    *usageLog
        http     *http.Client
-       clock    func() time.Time
 }
 
 // Request is one model call. Input holds the input items in order, such as
 }
 
 // Request is one model call. Input holds the input items in order, such as
@@ -179,8 +178,7 @@ func newClient(url string, auth authorizer, cacheKey, usagePath string) *Client
                usage: &usageLog{
                        path: usagePath,
                },
                usage: &usageLog{
                        path: usagePath,
                },
-               http:  &http.Client{},
-               clock: time.Now,
+               http: &http.Client{},
        }
 }
 
        }
 }
 
@@ -216,7 +214,7 @@ func (c *Client) Create(ctx context.Context, request Request) (Response, error)
        }
 
        record := usageRecord{
        }
 
        record := usageRecord{
-               Date:  c.clock().Format(time.RFC3339Nano),
+               Date:  time.Now().Format(time.RFC3339Nano),
                Model: request.Model,
        }
 
                Model: request.Model,
        }