File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -47,11 +47,11 @@ func (a *StatsAPI) now() time.Time {
47
47
}
48
48
49
49
func (a * StatsAPI ) UpdateStats (ctx context.Context , req * agentproto.UpdateStatsRequest ) (* agentproto.UpdateStatsResponse , error ) {
50
- // An empty stat means it's just looking for the report interval.
51
50
res := & agentproto.UpdateStatsResponse {
52
51
ReportInterval : durationpb .New (a .AgentStatsRefreshInterval ),
53
52
}
54
- if req .Stats == nil || len (req .Stats .ConnectionsByProto ) == 0 {
53
+ // An empty stat means it's just looking for the report interval.
54
+ if req .Stats == nil {
55
55
return res , nil
56
56
}
57
57
Original file line number Diff line number Diff line change @@ -262,16 +262,14 @@ func TestUpdateStates(t *testing.T) {
262
262
require .NoError (t , err )
263
263
})
264
264
265
- t .Run ("NoConnectionsByProto " , func (t * testing.T ) {
265
+ t .Run ("NoStats " , func (t * testing.T ) {
266
266
t .Parallel ()
267
267
268
268
var (
269
269
dbM = dbmock .NewMockStore (gomock .NewController (t ))
270
270
ps = pubsub .NewInMemory ()
271
271
req = & agentproto.UpdateStatsRequest {
272
- Stats : & agentproto.Stats {
273
- ConnectionsByProto : map [string ]int64 {}, // len() == 0
274
- },
272
+ Stats : nil ,
275
273
}
276
274
)
277
275
api := agentapi.StatsAPI {
You can’t perform that action at this time.
0 commit comments