mirror of
https://github.com/coder/coder.git
synced 2026-10-28 02:42:54 +08:00
fix(coderd): fix template insight intervals (#8662)
This commit is contained in:
@@ -2326,12 +2326,15 @@ func (q *FakeQuerier) GetUserLatencyInsights(_ context.Context, arg database.Get
|
||||
if len(arg.TemplateIDs) > 0 && !slices.Contains(arg.TemplateIDs, s.TemplateID) {
|
||||
continue
|
||||
}
|
||||
if !arg.StartTime.Equal(s.CreatedAt) && !(s.CreatedAt.After(arg.StartTime) && s.CreatedAt.Before(arg.EndTime)) {
|
||||
if !arg.StartTime.Equal(s.CreatedAt) && (s.CreatedAt.Before(arg.StartTime) || s.CreatedAt.After(arg.EndTime)) {
|
||||
continue
|
||||
}
|
||||
if s.ConnectionCount == 0 {
|
||||
continue
|
||||
}
|
||||
if s.ConnectionMedianLatencyMS <= 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
latenciesByUserID[s.UserID] = append(latenciesByUserID[s.UserID], s.ConnectionMedianLatencyMS)
|
||||
if seenTemplatesByUserID[s.UserID] == nil {
|
||||
|
||||
Reference in New Issue
Block a user