Skip to content

Commit

Permalink
Top module
Browse files Browse the repository at this point in the history
* deps
* comments
* staged loads 10 at a time in bench_test.go

Signed-off-by: Plamen Petrov <plamb0brt@gmail.com>
  • Loading branch information
plamenmpetrov authored and ustiugov committed Aug 14, 2020
1 parent 7ebac54 commit c0a8e24
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ func TestBenchParallelServe(t *testing.T) {

for k := 0; k < *iterNum; k++ {
var vmGroup sync.WaitGroup
semLoad := make(chan bool, 10)

if !*isWithCache {
dropPageCache()
Expand All @@ -148,17 +149,23 @@ func TestBenchParallelServe(t *testing.T) {
for i := 0; i < parallel; i++ {
vmIDString := strconv.Itoa(vmID + i)

semLoad <- true

vmGroup.Add(1)

go func(i int) {
defer vmGroup.Done()
defer func() { <-semLoad }()

resp, _, err := funcPool.Serve(context.Background(), vmIDString, imageName, "replay")
require.NoError(t, err, "Function returned error")
require.Equal(t, resp.Payload, "Hello, replay_response!")
}(i)
}

for i := 0; i < cap(semLoad); i++ {
semLoad <- true
}
vmGroup.Wait()

duration := time.Since(tStart).Milliseconds()
Expand Down
6 changes: 4 additions & 2 deletions functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ func (p *FuncPool) RemoveInstance(fID, imageName string, isSync bool) (string, e
return f.RemoveInstance(isSync)
}

// DumpUPFPageStats Dumps the memory manager's stats for a function about the number of the unique pages and the number of the pages that are reused across invocations
// DumpUPFPageStats Dumps the memory manager's stats for a function about the number of
// the unique pages and the number of the pages that are reused across invocations
func (p *FuncPool) DumpUPFPageStats(fID, imageName, functionName, metricsOutFilePath string) error {
f := p.getFunction(fID, imageName)

Expand Down Expand Up @@ -398,7 +399,8 @@ func (f *Function) RemoveInstance(isSync bool) (string, error) {
return r, err
}

// DumpUPFPageStats Dumps the memory manager's stats about the number of the unique pages and the number of the pages that are reused across invocations
// DumpUPFPageStats Dumps the memory manager's stats about the number of
// the unique pages and the number of the pages that are reused across invocations
func (f *Function) DumpUPFPageStats(functionName, metricsOutFilePath string) error {
return orch.DumpUPFPageStats(f.vmID, functionName, metricsOutFilePath)
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/containerd/containerd v1.3.6
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.6.1
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20200814073951-0661716e8f1f
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20200814104500-c1a8ec1da550
github.com/ustiugov/fccd-orchestrator/helloworld v0.0.0-20200803195925-0629e1cf4599
github.com/ustiugov/fccd-orchestrator/metrics v0.0.0-20200813133133-6b46b3623de0
github.com/ustiugov/fccd-orchestrator/proto v0.0.0-20200803195925-0629e1cf4599
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20200813133133-6b46b3623de
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20200813133133-6b46b3623de0/go.mod h1:THyJkBUoFSBkKaXEmL9ArXnvweCEZURADXTrEFMR/BE=
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20200814073951-0661716e8f1f h1:XeF7ySbWrKqrxedD/6U3lPinVit4622QUCvjqCwkGIQ=
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20200814073951-0661716e8f1f/go.mod h1:Ull4lf+2AMshamCVtBlmGfuCVkoE0+KgIQDWmMQsx7g=
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20200814104500-c1a8ec1da550 h1:M/c9DGaVdiiyw2W4HBL9TnU7H8gTRddKFQ5YytGqLng=
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20200814104500-c1a8ec1da550/go.mod h1:r2dHTyaCHWXSdYIHIOIlVbKNXpLEZFCn2a2sbAYWBc0=
github.com/ustiugov/fccd-orchestrator/helloworld v0.0.0-20200710144657-9fbec6857e48/go.mod h1:5dhCs/XynpQoQcrhd/YgUBjGahhNpTknQUcC1kHRCaA=
github.com/ustiugov/fccd-orchestrator/helloworld v0.0.0-20200710145415-bb09d1a68889/go.mod h1:5dhCs/XynpQoQcrhd/YgUBjGahhNpTknQUcC1kHRCaA=
github.com/ustiugov/fccd-orchestrator/helloworld v0.0.0-20200710150633-096cac68bd72 h1:r67pqykSYWZHFYfIKuT44PTXFJWu5lJcatkV16d3vKU=
Expand Down Expand Up @@ -727,6 +729,8 @@ github.com/ustiugov/fccd-orchestrator/memory/manager v0.0.0-20200813132011-cbc5d
github.com/ustiugov/fccd-orchestrator/memory/manager v0.0.0-20200813132011-cbc5d5f6f0a2/go.mod h1:RnM7KtF9SaVH0lyeTOFvbMq2E+e+1LAH4rT4AQc2uB0=
github.com/ustiugov/fccd-orchestrator/memory/manager v0.0.0-20200814064842-03f16a02475d h1:GaiSsXzAEwVrHXEis4MP6kEwLJ+lsExjOMZJIqQNdnI=
github.com/ustiugov/fccd-orchestrator/memory/manager v0.0.0-20200814064842-03f16a02475d/go.mod h1:RnM7KtF9SaVH0lyeTOFvbMq2E+e+1LAH4rT4AQc2uB0=
github.com/ustiugov/fccd-orchestrator/memory/manager v0.0.0-20200814104410-a0b269be4cb2 h1:Q8GDhAw8tByrPQxgpOVX8lcGzQKpvIUxmVOkqpC/r1E=
github.com/ustiugov/fccd-orchestrator/memory/manager v0.0.0-20200814104410-a0b269be4cb2/go.mod h1:RnM7KtF9SaVH0lyeTOFvbMq2E+e+1LAH4rT4AQc2uB0=
github.com/ustiugov/fccd-orchestrator/metrics v0.0.0-20200723085111-a9d697412510 h1:2F3Bp/P7C2UMKU+vakjEW/++E2yCntucHKNiRxcxQOE=
github.com/ustiugov/fccd-orchestrator/metrics v0.0.0-20200723085111-a9d697412510/go.mod h1:NOrYF6usVkdr6gpXAP7pk7jp1MlAXlrZQuUEOVhRuV8=
github.com/ustiugov/fccd-orchestrator/metrics v0.0.0-20200723105930-96d5e1cb279b h1:0ukOv2nUQqj14TLHf5MkVyvbyiV6AxwUSI7PQQnVdKQ=
Expand Down

0 comments on commit c0a8e24

Please sign in to comment.