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

Method WriteFunctionReportLog

pkg/controller/rtctrl/logstore.go:294–321  ·  view source on GitHub ↗
(log string, params *reportParameters)

Source from the content-addressed store, hash-verified

292}
293
294func (s *kunLogStatStore) WriteFunctionReportLog(log string, params *reportParameters) error {
295 if s.flags.Has(flagClosed) {
296 return errReceiverClosed
297 }
298 s.appendLogbuf([]byte(log), true)
299 logfile := s.logfile
300 if logfile == nil {
301 return nil
302 }
303 l := &userlog.UserLog{
304 Created: time.Now(),
305 TriggerType: s.triggerType,
306 RuntimeID: s.runtimeID,
307 RequestID: s.requestID,
308 Source: logSource[easyfaasSysLog],
309 Message: []byte(log),
310 UserID: s.userID,
311 FuncName: s.funcName,
312 FunctionBrn: s.funcBrn,
313 Version: s.funcVersion,
314 InvocationTime: params.InvocationTime,
315 MemoryUsage: params.MemUsage,
316 Mode: params.Mode,
317 ResponseStatus: params.Status,
318 }
319 _, err := logfile.Write(l, []byte(log))
320 return err
321}
322
323func (s *kunLogStatStore) SetMemUsed(used int64) {
324 if s.maxMem < used {

Callers

nothing calls this directly

Calls 3

appendLogbufMethod · 0.95
WriteMethod · 0.65
HasMethod · 0.45

Tested by

no test coverage detected