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

Function sendDiagnosticPing

cmd/server/main-server.go:157–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155}
156
157func sendDiagnosticPing() bool {
158 ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
159 defer cancelFn()
160
161 rpcClient := wshclient.GetBareRpcClient()
162 isOnline, err := wshclient.NetworkOnlineCommand(rpcClient, &wshrpc.RpcOpts{Route: "electron", Timeout: 2000})
163 if err != nil || !isOnline {
164 return false
165 }
166 clientId := wstore.GetClientId()
167 usageTelemetry := telemetry.IsTelemetryEnabled()
168 wcloud.SendDiagnosticPing(ctx, clientId, usageTelemetry)
169 return true
170}
171
172func setupTelemetryConfigHandler() {
173 watcher := wconfig.GetWatcher()

Callers 1

diagnosticLoopFunction · 0.85

Calls 5

GetBareRpcClientFunction · 0.92
NetworkOnlineCommandFunction · 0.92
GetClientIdFunction · 0.92
IsTelemetryEnabledFunction · 0.92
SendDiagnosticPingFunction · 0.92

Tested by

no test coverage detected