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

Function recordBlockCreationTelemetry

pkg/wcore/block.go:108–127  ·  view source on GitHub ↗
(blockView string, blockController string)

Source from the content-addressed store, hash-verified

106}
107
108func recordBlockCreationTelemetry(blockView string, blockController string) {
109 defer func() {
110 panichandler.PanicHandler("CreateBlock:telemetry", recover())
111 }()
112 if blockView == "" {
113 return
114 }
115 tctx, cancelFn := context.WithTimeout(context.Background(), 2*time.Second)
116 defer cancelFn()
117 telemetry.UpdateActivity(tctx, wshrpc.ActivityUpdate{
118 Renderers: map[string]int{blockView: 1},
119 })
120 telemetry.RecordTEvent(tctx, &telemetrydata.TEvent{
121 Event: "action:createblock",
122 Props: telemetrydata.TEventProps{
123 BlockView: blockView,
124 BlockController: blockController,
125 },
126 })
127}
128
129func createBlockObj(ctx context.Context, tabId string, blockDef *waveobj.BlockDef, rtOpts *waveobj.RuntimeOpts) (*waveobj.Block, error) {
130 return wstore.WithTxRtn(ctx, func(tx *wstore.TxWrap) (*waveobj.Block, error) {

Callers 1

CreateBlockWithTelemetryFunction · 0.85

Calls 3

PanicHandlerFunction · 0.92
UpdateActivityFunction · 0.92
RecordTEventFunction · 0.92

Tested by

no test coverage detected