Fix command line usage docs, replace deprecated recvLine() with readLine().
This commit is contained in:
parent
7e44181f45
commit
8d1e22383f
1 changed files with 5 additions and 7 deletions
|
|
@ -46,7 +46,7 @@ import
|
||||||
const
|
const
|
||||||
VERSION = "v0.2.0"
|
VERSION = "v0.2.0"
|
||||||
USAGE = """
|
USAGE = """
|
||||||
./netdata_tsrelay [-q][-v][-h] --dbopts="[PostgreSQL connection string]" --listen-port=14866 --listen-addr=0.0.0.0
|
./netdata_tsrelay [-d][-h][-q][-t][-T][-v] --dbopts="[PostgreSQL connection string]" --listen-port=14866 --listen-addr=0.0.0.0
|
||||||
|
|
||||||
-q: Quiet mode. No output at all. Ignored if -d is supplied.
|
-q: Quiet mode. No output at all. Ignored if -d is supplied.
|
||||||
-d: Debug: Show incoming and parsed data.
|
-d: Debug: Show incoming and parsed data.
|
||||||
|
|
@ -94,15 +94,13 @@ proc hl( msg: string, fg: ForegroundColor, bright=false ): string =
|
||||||
proc fetch_data( client: Socket ): string =
|
proc fetch_data( client: Socket ): string =
|
||||||
## Netdata JSON backend doesn't send a length, so we read line by
|
## Netdata JSON backend doesn't send a length, so we read line by
|
||||||
## line and wait for stream timeout to determine a "sample".
|
## line and wait for stream timeout to determine a "sample".
|
||||||
var buf: string = ""
|
var buf = ""
|
||||||
try:
|
try:
|
||||||
result = client.recv_line( timeout=conf.timeout )
|
while true:
|
||||||
if result != "": result = result & "\n"
|
client.readline( buf, timeout=conf.timeout )
|
||||||
while buf != "":
|
|
||||||
buf = client.recv_line( timeout=conf.timeout )
|
|
||||||
if buf != "": result = result & buf & "\n"
|
if buf != "": result = result & buf & "\n"
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
discard
|
return
|
||||||
|
|
||||||
|
|
||||||
proc parse_data( data: string ): seq[ JsonNode ] =
|
proc parse_data( data: string ): seq[ JsonNode ] =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue