func (l *loggerType) LogError(e *collector.Endpoint, err error, state *collector.State) { if err == nil { l.ConnectionErrors.Clear(e) } else { l.ConnectionErrors.Set(e, err, state.Timestamp()) } l.AppStats.ReportError(e, err, state.Timestamp()) }
func (a *ApplicationStatuses) update( e *scotty.Endpoint, newState *scotty.State) { a.lock.Lock() defer a.lock.Unlock() record := a.byEndpoint[e] if record == nil { panic("Unknown endpoint in Update.") } record.Status = newState.Status() if record.Status == scotty.Synced { record.PollTime = newState.TimeSpentPolling() record.LastReadTime = newState.Timestamp() } }