Skip to content

Commit dd1016a

Browse files
committed
stat: go runtime metrics
1 parent 32d8577 commit dd1016a

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

intra/backend/netstat.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ type GoStat struct {
237237
Env string // environment variables
238238
}
239239

240+
type GoMetrics struct {
241+
M string
242+
}
243+
240244
// NetStat is a collection of network engine statistics.
241245
type NetStat struct {
242246
NICSt NICStat
@@ -249,6 +253,7 @@ type NetStat struct {
249253
UDPSt UDPStat
250254
RDNSIn RDNSInfo
251255
GOSt GoStat
256+
GOMet GoMetrics
252257
}
253258

254259
// NIC returns the network interface statistics.
@@ -280,3 +285,6 @@ func (n *NetStat) RDNSINFO() *RDNSInfo { return &n.RDNSIn }
280285

281286
// GO returns the Go runtime statistics.
282287
func (n *NetStat) GO() *GoStat { return &n.GOSt }
288+
289+
// GO2 returns the GO runtime metrics on g, m, & p.
290+
func (n *NetStat) GO2() *GoMetrics { return &n.GOMet }

intra/tunnel.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,9 @@ func (t *rtunnel) stat() (*x.NetStat, error) {
605605
}
606606
out.RDNSIn.ProxyStatus = ss.Status
607607
}
608+
609+
out.GOMet.M = core.Metrics()
610+
608611
return out, nil
609612
}
610613

0 commit comments

Comments
 (0)