recordModelLoadFailure records a backend trace when model loading fails.
(appConfig *config.ApplicationConfig, modelName, backend string, err error, data map[string]any)
| 54 | |
| 55 | // recordModelLoadFailure records a backend trace when model loading fails. |
| 56 | func recordModelLoadFailure(appConfig *config.ApplicationConfig, modelName, backend string, err error, data map[string]any) { |
| 57 | if !appConfig.EnableTracing { |
| 58 | return |
| 59 | } |
| 60 | trace.InitBackendTracingIfEnabled(appConfig.TracingMaxItems, appConfig.TracingMaxBodyBytes) |
| 61 | trace.RecordBackendTrace(trace.BackendTrace{ |
| 62 | Timestamp: time.Now(), |
| 63 | Type: trace.BackendTraceModelLoad, |
| 64 | ModelName: modelName, |
| 65 | Backend: backend, |
| 66 | Summary: "Model load failed", |
| 67 | Error: err.Error(), |
| 68 | Data: data, |
| 69 | }) |
| 70 | } |
| 71 | |
| 72 | // estimateModelSizeBytes uses the unified EstimateModel entry point to compute |
| 73 | // the total weight-file size for a model config. It collects all weight files |
no test coverage detected