Skip to content

Commit

Permalink
Merge pull request #5 from lytics/time-windowing
Browse files Browse the repository at this point in the history
removed unused file
  • Loading branch information
epsniff authored Jan 13, 2021
2 parents ffc5f67 + 432341e commit 01bcf6f
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 10 deletions.
84 changes: 84 additions & 0 deletions coverage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@

mode: atomic
github.com/lytics/inflight/callgroup.go:35.55,42.2 1 125
github.com/lytics/inflight/callgroup.go:45.57,60.2 6 602919
github.com/lytics/inflight/callgroup.go:63.39,65.2 1 0
github.com/lytics/inflight/callgroup.go:67.29,68.32 1 5050
github.com/lytics/inflight/callgroup.go:72.2,72.23 1 25
github.com/lytics/inflight/callgroup.go:68.32,70.3 1 5025
github.com/lytics/inflight/callgroup.go:72.23,75.3 1 25
github.com/lytics/inflight/callgroup.go:94.50,98.16 3 5050
github.com/lytics/inflight/callgroup.go:103.2,105.13 2 5050
github.com/lytics/inflight/callgroup.go:98.16,100.3 1 0
github.com/lytics/inflight/callgroup.go:100.8,102.3 1 5050
github.com/lytics/inflight/opqueue.go:43.44,55.12 4 30
github.com/lytics/inflight/opqueue.go:61.2,61.10 1 30
github.com/lytics/inflight/opqueue.go:55.12,60.3 4 30
github.com/lytics/inflight/opqueue.go:67.27,69.2 1 30
github.com/lytics/inflight/opqueue.go:72.29,76.2 3 5
github.com/lytics/inflight/opqueue.go:84.48,88.26 3 597749
github.com/lytics/inflight/opqueue.go:92.2,93.9 2 576455
github.com/lytics/inflight/opqueue.go:119.2,119.12 1 576005
github.com/lytics/inflight/opqueue.go:88.26,90.3 1 21294
github.com/lytics/inflight/opqueue.go:93.9,114.3 2 572014
github.com/lytics/inflight/opqueue.go:114.8,114.38 1 4441
github.com/lytics/inflight/opqueue.go:114.38,116.3 1 450
github.com/lytics/inflight/opqueue.go:116.8,118.3 1 3991
github.com/lytics/inflight/opqueue.go:128.44,132.6 3 572089
github.com/lytics/inflight/opqueue.go:132.6,133.33 1 585370
github.com/lytics/inflight/opqueue.go:137.3,137.10 1 13356
github.com/lytics/inflight/opqueue.go:146.3,146.16 1 13281
github.com/lytics/inflight/opqueue.go:133.33,135.4 1 572014
github.com/lytics/inflight/opqueue.go:138.23,139.21 1 75
github.com/lytics/inflight/opqueue.go:140.11,140.11 0 13281
github.com/lytics/inflight/opqueue.go:150.43,155.2 3 572014
github.com/lytics/inflight/opqueue.go:157.44,159.17 2 585370
github.com/lytics/inflight/opqueue.go:162.2,166.9 4 572014
github.com/lytics/inflight/opqueue.go:169.2,170.18 2 572014
github.com/lytics/inflight/opqueue.go:159.17,161.3 1 13356
github.com/lytics/inflight/opqueue.go:166.9,167.71 1 0
github.com/lytics/inflight/opset.go:13.30,17.2 1 572084
github.com/lytics/inflight/opset.go:19.33,21.2 1 4061
github.com/lytics/inflight/opset.go:24.30,26.2 1 1148519
github.com/lytics/inflight/opset.go:34.57,35.28 1 5
github.com/lytics/inflight/opset.go:35.28,37.3 1 10
github.com/lytics/inflight/opwindow.go:36.93,49.12 4 35
github.com/lytics/inflight/opwindow.go:66.2,66.10 1 35
github.com/lytics/inflight/opwindow.go:49.12,51.7 2 35
github.com/lytics/inflight/opwindow.go:51.7,52.11 1 104
github.com/lytics/inflight/opwindow.go:53.24,54.11 1 35
github.com/lytics/inflight/opwindow.go:55.20,59.24 2 69
github.com/lytics/inflight/opwindow.go:62.5,62.22 1 69
github.com/lytics/inflight/opwindow.go:59.24,61.6 1 27
github.com/lytics/inflight/opwindow.go:72.28,81.2 6 35
github.com/lytics/inflight/opwindow.go:85.30,89.2 3 30
github.com/lytics/inflight/opwindow.go:97.49,101.26 3 140
github.com/lytics/inflight/opwindow.go:105.2,106.9 2 140
github.com/lytics/inflight/opwindow.go:133.2,133.12 1 140
github.com/lytics/inflight/opwindow.go:101.26,103.3 1 0
github.com/lytics/inflight/opwindow.go:106.9,128.3 2 70
github.com/lytics/inflight/opwindow.go:128.8,128.38 1 70
github.com/lytics/inflight/opwindow.go:128.38,130.3 1 0
github.com/lytics/inflight/opwindow.go:130.8,132.3 1 70
github.com/lytics/inflight/opwindow.go:142.45,146.6 3 130
github.com/lytics/inflight/opwindow.go:146.6,147.33 1 217
github.com/lytics/inflight/opwindow.go:151.3,151.10 1 147
github.com/lytics/inflight/opwindow.go:160.3,160.16 1 87
github.com/lytics/inflight/opwindow.go:147.33,149.4 1 70
github.com/lytics/inflight/opwindow.go:152.23,153.21 1 60
github.com/lytics/inflight/opwindow.go:154.11,154.11 0 87
github.com/lytics/inflight/opwindow.go:169.44,175.2 4 70
github.com/lytics/inflight/opwindow.go:177.51,179.17 2 69
github.com/lytics/inflight/opwindow.go:183.2,186.23 3 69
github.com/lytics/inflight/opwindow.go:189.2,189.13 1 27
github.com/lytics/inflight/opwindow.go:179.17,181.3 1 0
github.com/lytics/inflight/opwindow.go:186.23,188.3 1 42
github.com/lytics/inflight/opwindow.go:192.45,194.17 2 217
github.com/lytics/inflight/opwindow.go:198.2,200.23 3 157
github.com/lytics/inflight/opwindow.go:204.2,208.9 4 70
github.com/lytics/inflight/opwindow.go:211.2,212.18 2 70
github.com/lytics/inflight/opwindow.go:194.17,196.3 1 60
github.com/lytics/inflight/opwindow.go:200.23,202.3 1 87
github.com/lytics/inflight/opwindow.go:208.9,209.71 1 0
mode: atomic
mode: atomic
10 changes: 5 additions & 5 deletions opqueue.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,8 @@ func (q *OpQueue) Enqueue(id ID, op *Op) error {

set, ok := q.entries[id]
if !ok {
set = newOpSet(op)
q.entries[id] = set

// This is a new item, so we need to insert it into the queue.
q.enqueue(id)
q.newEntry(id, op)

// Signal one waiting go routine to wake up and Dequeue
// I believe we only need to signal if we enqueue a new item.
Expand Down Expand Up @@ -150,7 +147,10 @@ func (q *OpQueue) Dequeue() (*OpSet, bool) {
}
}

func (q *OpQueue) enqueue(id ID) {
func (q *OpQueue) newEntry(id ID, op *Op) {
set := newOpSet(op)
q.entries[id] = set

q.q.PushBack(id)
}

Expand Down
10 changes: 5 additions & 5 deletions opwindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,8 @@ func (q *OpWindow) Enqueue(id ID, op *Op) error {

set, ok := q.entries[id]
if !ok {
set = newOpSet(op)
q.entries[id] = set

// This is a new item, so we need to insert it into the queue.
q.enqueue(id)
q.newEntry(id, op)

// Signal one waiting go routine to wake up and Dequeue
// I believe we only need to signal if we enqueue a new item.
Expand Down Expand Up @@ -169,7 +166,10 @@ type queElement struct {
enqueuedAtUnixN int64
}

func (q *OpWindow) enqueue(id ID) {
func (q *OpWindow) newEntry(id ID, op *Op) {
set := newOpSet(op)
q.entries[id] = set

eq := &queElement{id, time.Now().UnixNano()}
q.q.PushBack(eq)
}
Expand Down

0 comments on commit 01bcf6f

Please sign in to comment.