這些工具輔助到數(shù)據(jù)流的通用功能和內(nèi)部檢查。
為所有的話題(topic)和通道(channel)的生產(chǎn)者輪詢 /stats,并顯示統(tǒng)計數(shù)據(jù):
---------------depth---------------+--------------metadata---------------
total mem disk inflt def | req t-o msgs clients
24660 24660 0 0 20 | 102688 0 132492418 1
25001 25001 0 0 20 | 102688 0 132493086 1
21132 21132 0 0 21 | 102688 0 132493729 1
-channel="": NSQ 通道(channel)
-lookupd-http-address=: lookupd HTTP 地址 (可能會給多次)
-nsqd-http-address=: nsqd HTTP 地址 (可能會給多次)
-status-every=2s: 輪詢/打印輸出見的時間間隔
-topic="": NSQ 話題(topic)
-version=false: 打印版本
消費指定的話題(topic)/通道(channel),并寫到 stdout (和 tail(1) 類似)。
-channel="": NSQ 通道(channel)
-consumer-opt=: 傳遞給 nsq.Consumer (可能會給多次, http://godoc.org/github.com/bitly/go-nsq#Config)
-lookupd-http-address=: lookupd HTTP 地址 (可能會給多次)
-max-in-flight=200: 最大的消息數(shù) to allow in flight
-n=0: total messages to show (will wait if starved)
-nsqd-tcp-address=: nsqd TCP 地址 (可能會給多次)
-reader-opt=: (已經(jīng)拋棄) 使用 --consumer-opt
-topic="": NSQ 話題(topic)
-version=false: 打印版本信息
消費指定的話題(topic)/通道(channel),并寫到文件中,有選擇的滾動和/或壓縮文件。
-channel="nsq_to_file": nsq 通道(channel)
-consumer-opt=: 傳遞給 nsq.Consumer 的參數(shù) (可能會給多次, http://godoc.org/github.com/bitly/go-nsq#Config)
-datetime-format="%Y-%m-%d_%H": strftime,和 filename 里 <DATETIME> 格式兼容
-filename-format="<TOPIC>.<HOST><GZIPREV>.<DATETIME>.log": output 文件名格式 (<TOPIC>, <HOST>, <DATETIME>, <GZIPREV> 重新生成. <GZIPREV> 是當(dāng)已經(jīng)存在的 gzip 文件的前綴)
-gzip=false: gzip 輸出文件
-gzip-compression=3: (已經(jīng)拋棄) 使用 --gzip-level, gzip 壓縮級別(1 = 速度最佳, 2 = 最近壓縮, 3 = 默認(rèn)壓縮)
-gzip-level=6: gzip 壓縮級別 (1-9, 1=BestSpeed, 9=BestCompression)
-host-identifier="": 輸出到 log 文件,提供主機(jī)名。 <SHORT_HOST> 和 <HOSTNAME> 是有效的替換者
-lookupd-http-address=: lookupd HTTP 地址 (可能會給多次)
-max-in-flight=200: 最大的消息數(shù) to allow in flight
-nsqd-tcp-address=: nsqd TCP 地址 (可能會給多次)
-output-dir="/tmp": 輸出文件所在的文件夾
-reader-opt=: (已經(jīng)拋棄) 使用 --consumer-opt
-skip-empty-files=false: 忽略寫空文件
-topic=: nsq 話題(topic) (可能會給多次)
-topic-refresh=1m0s: 話題(topic)列表刷新的頻率是多少?
-version=false: 打印版本信息
消費指定的話題(topic)/通道(channel)和執(zhí)行 HTTP requests (GET/POST) 到指定的端點。
-channel="nsq_to_http": nsq 通道(channel)
-consumer-opt=: 參數(shù),通過 nsq.Consumer (可能會給多次, http://godoc.org/github.com/bitly/go-nsq#Config)
-content-type="application/octet-stream": the Content-Type 使用d for POST requests
-get=: HTTP 地址 to make a GET request to. '%s' will be printf replaced with data (可能會給多次)
-http-timeout=20s: timeout for HTTP connect/read/write (each)
-http-timeout-ms=20000: (已經(jīng)拋棄) 使用 --http-timeout=X, timeout for HTTP connect/read/write (each)
-lookupd-http-address=: lookupd HTTP 地址 (可能會給多次)
-max-backoff-duration=2m0s: (已經(jīng)拋棄) 使用 --consumer-opt=max_backoff_duration,X
-max-in-flight=200: 最大的消息數(shù) to allow in flight
-mode="round-robin": the upstream request mode options: multicast, round-robin, hostpool
-n=100: number of concurrent publishers
-nsqd-tcp-address=: nsqd TCP 地址 (可能會給多次)
-post=: HTTP 地址 to make a POST request to. data will be in the body (可能會給多次)
-reader-opt=: (已經(jīng)拋棄) 使用 --consumer-opt
-round-robin=false: (已經(jīng)拋棄) 使用 --mode=round-robin, enable round robin mode
-sample=1: % of messages to publish (float b/w 0 -> 1)
-status-every=250: the # of requests between logging status (per handler), 0 disables
-throttle-fraction=1: (已經(jīng)拋棄) 使用 --sample=X, publish only a fraction of messages
-topic="": nsq 話題(topic)
-version=false: 打印版本信息
消費者指定的話題/通道和重發(fā)布消息到目的地 nsqd 通過 TCP。
-channel="nsq_to_nsq": nsq 通道(channel)
-consumer-opt=: 參數(shù),通過 nsq.Consumer (可能會給多次, see http://godoc.org/github.com/bitly/go-nsq#Config)
-destination-nsqd-tcp-address=: destination nsqd TCP 地址 (可能會給多次)
-destination-topic="": destination nsq 話題(topic)
-lookupd-http-address=: lookupd HTTP 地址 (可能會給多次)
-max-backoff-duration=2m0s: (已經(jīng)拋棄) 使用 --consumer-opt=max_backoff_duration,X
-max-in-flight=200: 允許 flight 最大的消息數(shù)
-mode="round-robin": 上行請求的參數(shù): round-robin (默認(rèn)), hostpool
-nsqd-tcp-address=: nsqd TCP 地址 (可能會給多次)
-producer-opt=: 傳遞到 nsq.Producer (可能會給多次, 參見 http://godoc.org/github.com/bitly/go-nsq#Config)
-reader-opt=: (已經(jīng)拋棄) 使用 --consumer-opt
-require-json-field="": JSON 消息: 僅傳遞消息,包含這個參數(shù)
-require-json-value="": JSON 消息: 僅傳遞消息要求參數(shù)有這個值
-status-every=250: # 請求日志的狀態(tài)(每個目的地), 0 不可用
-topic="": nsq 話題(topic)
-version=false: 打印版本信息
-whitelist-json-field=: JSON 消息: 傳遞這個字段 (可能會給多次)
采用 stdin 流,并分解到新行(默認(rèn)),通過 TCP 重新發(fā)布到目的地 nsqd。
-delimiter="\n": 分割字符串(默認(rèn)'\n')
-nsqd-tcp-address=: 目的地 nsqd TCP 地址 (可能會給多次)
-producer-opt=: 參數(shù),通過 nsq.Producer (可能會給多次, http://godoc.org/github.com/bitly/go-nsq#Config)
-topic="": 發(fā)布到的 NSQ 話題(topic)