MCPcopy Create free account
hub / github.com/baidu/EasyFaaS / NewRuntimeManager

Function NewRuntimeManager

pkg/controller/rtctrl/runtime_dispatcher.go:91–110  ·  view source on GitHub ↗
(r *api.FuncletNodeInfo, params *RuntimeManagerParameters)

Source from the content-addressed store, hash-verified

89}
90
91func NewRuntimeManager(r *api.FuncletNodeInfo, params *RuntimeManagerParameters) *RuntimeManager {
92 resource := api.ServiceResource{
93 Capacity: r.Resource.Capacity,
94 Allocatable: r.Resource.Allocatable,
95 Default: r.Resource.Default,
96 Marked: api.NewResource(),
97 Used: api.NewResource(),
98 BaseMemory: r.Resource.BaseMemory,
99 }
100 rtMap := &RuntimeManager{
101 MaxRuntimeIdle: params.MaxRuntimeIdle,
102 MaxRunnerDefunct: params.MaxRunnerDefunct,
103 MaxRunnerResetTimeout: params.MaxRunnerResetTimeout,
104 rtMap: sync.Map{},
105 rtArray: make([]*RuntimeInfo, 0),
106 resource: &resource,
107 resourceLock: sync.RWMutex{},
108 }
109 return rtMap
110}
111
112func (m *RuntimeManager) String() string {
113 buf := bytes.NewBuffer(nil)

Callers 10

initContainersMethod · 0.92
TestRunnerHandlerFunction · 0.70
TestStatisticHandlerFunction · 0.70
TestSendHTTPRequestLoopFunction · 0.70
initRuntimeListFunction · 0.70
findAndMarkRuntimeMapFunction · 0.70
TestInvocationFunction · 0.70
TestInvocationWithStreamFunction · 0.70
TestRuntimeMapFunction · 0.70

Calls 1

NewResourceFunction · 0.92

Tested by 9

TestRunnerHandlerFunction · 0.56
TestStatisticHandlerFunction · 0.56
TestSendHTTPRequestLoopFunction · 0.56
initRuntimeListFunction · 0.56
findAndMarkRuntimeMapFunction · 0.56
TestInvocationFunction · 0.56
TestInvocationWithStreamFunction · 0.56
TestRuntimeMapFunction · 0.56