Пример #1
0
func (rt *RTWatcher) collectServerMetrics(m *memmetrics.RTMetrics, u *url.URL) error {
	rt.mtx.Lock()
	defer rt.mtx.Unlock()

	sm, ok := rt.srvs[surl{scheme: u.Scheme, host: u.Host}]
	if ok {
		m.Append(sm)
	}
	return nil
}
Пример #2
0
func (rt *RTWatcher) collectMetrics(m *memmetrics.RTMetrics) error {
	rt.mtx.Lock()
	defer rt.mtx.Unlock()

	return m.Append(rt.m)
}