The Go Programming Language
› http://golang.org/
› Go Playground
Go Projects
› Revel Web Framework
gantleman

如何监控 channel 的缓冲区使用状况?

  •  
  •   gantleman ·
    gantleman · Jul 15, 2020 · 2635 views
    This topic created in 2304 days ago, the information mentioned may be changed or developed.
    例如当前创建了多少 channel 和缓冲区阻塞的长度。
    5 replies  •  2020-07-15 15:41:42 +08:00
    guonaihong
    guonaihong
    Jul 15, 2020❤️1
    1
    len(ch) channel 当前存储数据的长度
    cap(ch) channel 的实际长度
    gantleman
    gantleman
    OP
    Jul 15, 2020
    2
    @guonaihong 有没有非侵入的方法?
    guonaihong
    guonaihong
    Jul 15, 2020
    3
    @gantleman 没懂非侵入,可否举个例子。
    gantleman
    gantleman
    OP
    Jul 15, 2020
    4
    @guonaihong 系统日志或监控系统的方法,与代码无关的。
    janxin
    janxin
    Jul 15, 2020❤️1
    5
    没有
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5125 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 06:39 · PVG 14:39 · LAX 22:39 · JFK 01:39
    ♥ Do have faith in what you're doing.