MCPcopy
hub / github.com/wavetermdev/waveterm / MakePlotData

Function MakePlotData

pkg/wshrpc/wshserver/wshserver.go:116–126  ·  view source on GitHub ↗
(ctx context.Context, blockId string)

Source from the content-addressed store, hash-verified

114}
115
116func MakePlotData(ctx context.Context, blockId string) error {
117 block, err := wstore.DBMustGet[*waveobj.Block](ctx, blockId)
118 if err != nil {
119 return err
120 }
121 viewName := block.Meta.GetString(waveobj.MetaKey_View, "")
122 if viewName != "cpuplot" && viewName != "sysinfo" {
123 return fmt.Errorf("invalid view type: %s", viewName)
124 }
125 return filestore.WFS.MakeFile(ctx, blockId, "cpuplotdata", nil, wshrpc.FileOpts{})
126}
127
128func SavePlotData(ctx context.Context, blockId string, history string) error {
129 block, err := wstore.DBMustGet[*waveobj.Block](ctx, blockId)

Callers

nothing calls this directly

Calls 3

DBMustGetFunction · 0.92
GetStringMethod · 0.80
MakeFileMethod · 0.80

Tested by

no test coverage detected