Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cmd/server/main-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ func updateTelemetryCounts(lastCounts telemetrydata.TEventProps) telemetrydata.T
props.CountWorkspaces, _, _ = wstore.DBGetWSCounts(ctx)
props.CountSSHConn = conncontroller.GetNumSSHHasConnected()
props.CountWSLConn = wslconn.GetNumWSLHasConnected()
props.CountJobs = jobcontroller.GetNumJobsRunning()
props.CountJobsConnected = jobcontroller.GetNumJobsConnected()
props.CountViews, _ = wstore.DBGetBlockViewCounts(ctx)

fullConfig := wconfig.GetWatcher().GetFullConfig()
Expand Down
1 change: 1 addition & 0 deletions cmd/wsh/cmd/wshcmd-jobdebug.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ func jobDebugStartRun(cmd *cobra.Command, args []string) error {

data := wshrpc.CommandJobControllerStartJobData{
ConnName: jobConnFlag,
JobKind: "task",
Cmd: cmdToRun,
Args: cmdArgs,
Env: make(map[string]string),
Expand Down
33 changes: 33 additions & 0 deletions emain/emain-activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ let globalIsRelaunching = false;
let forceQuit = false;
let userConfirmedQuit = false;
let termCommandsRun = 0;
let termCommandsRemote = 0;
let termCommandsWsl = 0;
let termCommandsDurable = 0;

export function setWasActive(val: boolean) {
wasActive = val;
Expand Down Expand Up @@ -72,3 +75,33 @@ export function getAndClearTermCommandsRun(): number {
termCommandsRun = 0;
return count;
}

export function incrementTermCommandsRemote() {
termCommandsRemote++;
}

export function getAndClearTermCommandsRemote(): number {
const count = termCommandsRemote;
termCommandsRemote = 0;
return count;
}

export function incrementTermCommandsWsl() {
termCommandsWsl++;
}

export function getAndClearTermCommandsWsl(): number {
const count = termCommandsWsl;
termCommandsWsl = 0;
return count;
}

export function incrementTermCommandsDurable() {
termCommandsDurable++;
}

export function getAndClearTermCommandsDurable(): number {
const count = termCommandsDurable;
termCommandsDurable = 0;
return count;
}
25 changes: 21 additions & 4 deletions emain/emain-ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ import { RpcApi } from "../frontend/app/store/wshclientapi";
import { getWebServerEndpoint } from "../frontend/util/endpoints";
import * as keyutil from "../frontend/util/keyutil";
import { fireAndForget, parseDataUrl } from "../frontend/util/util";
import { incrementTermCommandsRun } from "./emain-activity";
import {
incrementTermCommandsDurable,
incrementTermCommandsRemote,
incrementTermCommandsRun,
incrementTermCommandsWsl,
} from "./emain-activity";
import { createBuilderWindow, getAllBuilderWindows, getBuilderWindowByWebContentsId } from "./emain-builder";
import { callWithOriginalXdgCurrentDesktopAsync, unamePlatform } from "./emain-platform";
import { getWaveTabViewByWebContentsId } from "./emain-tabview";
Expand Down Expand Up @@ -407,9 +412,21 @@ export function initIpcHandlers() {
console.log("fe-log", logStr);
});

electron.ipcMain.on("increment-term-commands", () => {
incrementTermCommandsRun();
});
electron.ipcMain.on(
"increment-term-commands",
(event, opts?: { isRemote?: boolean; isWsl?: boolean; isDurable?: boolean }) => {
incrementTermCommandsRun();
if (opts?.isRemote) {
incrementTermCommandsRemote();
}
if (opts?.isWsl) {
incrementTermCommandsWsl();
}
if (opts?.isDurable) {
incrementTermCommandsDurable();
}
}
);

electron.ipcMain.on("native-paste", (event) => {
event.sender.paste();
Expand Down
15 changes: 15 additions & 0 deletions emain/emain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import { fireAndForget, sleep } from "../frontend/util/util";
import { AuthKey, configureAuthKeyRequestInjection } from "./authkey";
import {
getActivityState,
getAndClearTermCommandsDurable,
getAndClearTermCommandsRemote,
getAndClearTermCommandsRun,
getAndClearTermCommandsWsl,
getForceQuit,
getGlobalIsRelaunching,
getUserConfirmedQuit,
Expand Down Expand Up @@ -182,6 +185,9 @@ function logActiveState() {
if (termCmdCount > 0) {
activity.termcommandsrun = termCmdCount;
}
const termCmdRemoteCount = getAndClearTermCommandsRemote();
const termCmdWslCount = getAndClearTermCommandsWsl();
const termCmdDurableCount = getAndClearTermCommandsDurable();

const props: TEventProps = {
"activity:activeminutes": activity.activeminutes,
Expand All @@ -191,6 +197,15 @@ function logActiveState() {
if (termCmdCount > 0) {
props["activity:termcommandsrun"] = termCmdCount;
}
if (termCmdRemoteCount > 0) {
props["activity:termcommands:remote"] = termCmdRemoteCount;
}
if (termCmdWslCount > 0) {
props["activity:termcommands:wsl"] = termCmdWslCount;
}
if (termCmdDurableCount > 0) {
props["activity:termcommands:durable"] = termCmdDurableCount;
}
if (astate.wasActive && isWaveAIOpen) {
props["activity:waveaiactiveminutes"] = 1;
}
Expand Down
3 changes: 2 additions & 1 deletion emain/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ contextBridge.exposeInMainWorld("api", {
clearWebviewStorage: (webContentsId: number) => ipcRenderer.invoke("clear-webview-storage", webContentsId),
setWaveAIOpen: (isOpen: boolean) => ipcRenderer.send("set-waveai-open", isOpen),
closeBuilderWindow: () => ipcRenderer.send("close-builder-window"),
incrementTermCommands: () => ipcRenderer.send("increment-term-commands"),
incrementTermCommands: (opts?: { isRemote?: boolean; isWsl?: boolean; isDurable?: boolean }) =>
ipcRenderer.send("increment-term-commands", opts),
nativePaste: () => ipcRenderer.send("native-paste"),
openBuilder: (appId?: string) => ipcRenderer.send("open-builder", appId),
setBuilderWindowAppId: (appId: string) => ipcRenderer.send("set-builder-window-appid", appId),
Expand Down
Loading
Loading