From a33ac6f8fb6ed1dc6b7f5024d5309e283fb34efa Mon Sep 17 00:00:00 2001 From: Benson Wong Date: Mon, 18 Nov 2024 15:37:50 -0800 Subject: [PATCH] update README --- README.md | 17 +++++++---------- proxy/process_test.go | 2 +- proxy/proxymanager_loghandlers.go | 2 +- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index df8ff5a..8dfaa47 100644 --- a/README.md +++ b/README.md @@ -66,20 +66,17 @@ The `/logs` endpoint is available to monitor what llama-swap is doing. It will s Usage: ``` -# basic, sends up to the last 10KB of logs +# sends up to the last 10KB of logs curl http://host/logs' -# add `stream` to stream new logs as they come in -curl -Ns 'http://host/logs?stream' +# streams logs using chunk encoding +curl -Ns 'http://host/logs/stream' -# add `skip` to skip history (only useful if used with stream) -curl -Ns 'http://host/logs?stream&skip' +# skips history and just streams new log entries +curl -Ns 'http://host/logs/stream?no-history' -# will output nothing :) -curl -Ns 'http://host/logs?skip' - -# combine with pipes -curl -Ns 'http://host/logs?stream&skip' | grep 'tokens per second' +# streams logs using Server Sent Events +curl -Ns 'http://host/logs/streamSSE' ``` ## Systemd Unit Files diff --git a/proxy/process_test.go b/proxy/process_test.go index 2dd16ec..eab3e5a 100644 --- a/proxy/process_test.go +++ b/proxy/process_test.go @@ -29,7 +29,7 @@ func getBinaryPath() string { return filepath.Join("..", "build", fmt.Sprintf("simple-responder_%s_%s", goos, goarch)) } -func TestProcess_StartProxyStop(t *testing.T) { +func TestProcess_ProcessStartStop(t *testing.T) { // Define the range min := 12000 max := 13000 diff --git a/proxy/proxymanager_loghandlers.go b/proxy/proxymanager_loghandlers.go index c82d56f..8946470 100644 --- a/proxy/proxymanager_loghandlers.go +++ b/proxy/proxymanager_loghandlers.go @@ -75,7 +75,7 @@ func (pm *ProxyManager) streamLogsHandlerSSE(c *gin.Context) { notify := c.Request.Context().Done() // Send history first if not skipped - _, skipHistory := c.GetQuery("skip") + _, skipHistory := c.GetQuery("no-history") if !skipHistory { history := pm.logMonitor.GetHistory() if len(history) != 0 {