Add MemoryUsage field to QueueStats

This commit is contained in:
Ken Hibino
2021-01-26 18:36:45 -08:00
parent 6529a1e0b1
commit afde6a7266
5 changed files with 43 additions and 13 deletions

View File

@@ -264,6 +264,7 @@ func TestInspectorCurrentStats(t *testing.T) {
m6 := h.NewTaskMessageWithQueue("task6", nil, "low")
now := time.Now()
timeCmpOpt := cmpopts.EquateApproxTime(time.Second)
ignoreMemUsg := cmpopts.IgnoreFields(QueueStats{}, "MemoryUsage")
inspector := NewInspector(getRedisConnOpt(t))
@@ -356,7 +357,7 @@ func TestInspectorCurrentStats(t *testing.T) {
tc.qname, got, err, tc.want)
continue
}
if diff := cmp.Diff(tc.want, got, timeCmpOpt); diff != "" {
if diff := cmp.Diff(tc.want, got, timeCmpOpt, ignoreMemUsg); diff != "" {
t.Errorf("r.CurrentStats(%q) = %v, %v, want %v, nil; (-want, +got)\n%s",
tc.qname, got, err, tc.want, diff)
continue