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

Method createRequest

pkg/controller/rtctrl/client.go:57–80  ·  view source on GitHub ↗
(input *InvocationInput)

Source from the content-addressed store, hash-verified

55}
56
57func (s *RuntimeClient) createRequest(input *InvocationInput) *RequestInfo {
58 logs.V(5).Info("recv request.", zap.String("runtimeID", input.Runtime.RuntimeID))
59
60 if input.Configuration.FunctionArn == nil {
61 defaultFunctionArn := ""
62 input.Configuration.FunctionArn = &defaultFunctionArn
63 }
64 if input.Configuration.Timeout == nil || *(input.Configuration.Timeout) == 0 {
65 var dafaultTimeout int64 = 3
66 input.Configuration.Timeout = &dafaultTimeout
67 }
68
69 reqinfo := NewRequestInfo(input.RequestID, input.Runtime)
70 reqinfo.TriggerType = input.TriggerType
71 reqinfo.Input = input
72 reqinfo.Output = &InvocationOutput{
73 Output: &InvocationResponse{Response: input.Response},
74 Statistic: &InvocationStatistic{},
75 }
76 if input.EnableMetrics {
77 reqinfo.Output.Statistic.Metric = NewRtCtrlInvokeMetric(reqinfo.RequestID)
78 }
79 return reqinfo
80}
81
82func (s *RuntimeClient) makeInvokeRequest(input *InvocationInput) *InvokeRequest {
83 invokeReq := &InvokeRequest{

Callers 1

InvokeFunctionMethod · 0.95

Calls 5

VFunction · 0.92
NewRequestInfoFunction · 0.85
NewRtCtrlInvokeMetricFunction · 0.85
InfoMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected