Git Product home page Git Product logo

eclipse-cdt-cloud / vscode-trace-server Goto Github PK

View Code? Open in Web Editor NEW
0.0 7.0 5.0 276 KB

Extension to start and stop a trace server used by the vscode-trace-extension. This extension can run in Eclipse Theia and VSCode compatible applications

License: MIT License

TypeScript 88.66% JavaScript 11.34%
vscode vscode-extension typescript tsp trace-viewer eclipse eclipse-foundation eclipse-theia javascript open-vsx

vscode-trace-server's Introduction

VSCode Trace Server extension

This is a companion extension to the Trace Viewer for VSCode, that helps you manage the life-cycle (starting/stopping) of the trace server, that it needs to analyze and open traces.

The extension, once configured, can automatically start and stop your trace server for you, letting you enjoy using the Trace Viewer, without having to worry about that aspect. It also registers VSCode Trace Server: start/stop commands, that you can invoke as needed.

Note: It's assumed you already have a trace server installed locally. If that's not yet the case, please see here for more details about obtaining and installing the Eclipse Trace Compass server.

For information about building this extension from source, debugging it, and so on, please see the developer's documentation: README-dev

Configuration

The following preference settings can be used, under Trace Server.

  • trace server path : enter the absolute path and filename of your trace server
    • default value: /usr/bin/tracecompass-server
  • Command-line arguments: Enter any CLI arguments you want passed to your trace server. See here for valid options for the incubator version of the Trace Compass server
    • Multiple arguments have to be separated by a space character

Usage

Starting the Trace Server

Automatic start:

If this extension is configured correctly, it will automatically start the trace server, if needed, upon a trace being opened in the trace viewer.

Manual start:

Use the Trace Server: start (if stopped) command to launch the trace server instance. The latter should be made of two related processes; to find them, grep for tracecompass or the like.

Note: this extension is only aware of a running trace server if it started of helped start it, as per above. It will not know if you started the server on the CLI or outside using other means than described above.

Stopping the Trace Server

Use the Trace Server: stop or reset command to kill both processes, stopping the server. If the server was stopped outside the application (e.g. killed), using this command will reset the known pid and allow to start it again.

Note that exiting the application should automatically stop the started server if started through it.

Acknowledgments

This extension was started from VSCode's guide and related samples

vscode-trace-server's People

Contributors

bhufmann avatar colin-grant-work avatar marcdumais-work avatar marco-miller avatar patricktasse avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-trace-server's Issues

Rename "Trace Server: Start (if stopped)" command

Trace Server: Start (if stopped) command to trace server should be renamed to Trace Server: Start. The add-on if stopped is not relevant for the user and requires the user to know implementation details to understand. Instead the error messages for failing start command should indicate why the trace server couldn't be started.

image

Update to Node 18

Node 16 end-of-life was last September 11th.

This repo will need a quick update, to use node 18 (currently 16.x). Potential references to node version:

  • GitHub workflows: add at least node 18 in the "matrix" (we may keep 16 for now).
  • package.json "engines.node" version ranges may need updating. e.g. ">=16 <=20 " could work for now
  • dockerfiles
  • documentation, e.g. README, guides

Better handling of dependent extension's "enablement"

This extension (vscode-trace-server) is a companion to extension eclipse-cdt.vscode-trace-extension (Trace Viewer for VSCode) and depends on it.

At activation, this extension obtains a reference to the trace viewer's exported API object, and uses it to provide helper functionality. This work well normally, but there may be a corner-case that we should handle better: if/when the Trace Viewer extension becomes disabled, we probably should not use its API object any more, and if/when it becomes enabled again, we should obtain a fresh API object and redo the activation steps.

One scenario where the above might happen (to be confirmed) is when the Trace Viewer extension is updated to a new version.

As a starting point, here is how it seems the built-in vscode.github extension monitors the "enablement" of vscode.git-base it depends-on, and "refreshes" its API object when needed:

image

Heath check uses hardcoded URL

When the extension doing a heath check (HTTP query) to the server to check if the server is available it uses hard-coded URL http://localhost:8080. Since it's possible to change the port on the server, the client site needs to be configurable as well.

When using this extension with vscode-trace-extension, use the URL from that extension.

Trace Server not stopped when deactivating extension during shutdown

The trace server is not stopped when running this extension with vscode/codium remote. I have noticed this behaviour in local install as well, but very rarely.

I did some investigation and with some logging (to file) I was able to confirm, that the deactivate() method of the vscode-trace-server is being called. However, the call to tree-kill(pid) has no effect. More investigation needed to fix stopping the trace server on exit.

I did some more digging to figure out what's going on. I think what's happening is that VsCode exits before the treeKill() command is executed. treeKill() spawns external processes to get all the children pids from the parent pid of the trace server launcher. It reads the stdout of the command ps -o pid --no-headers --ppid $ppid and then uses the collected list of pids to call process.kill on it. This is done in a callback, but the parent VsCode application already exited and the hence the no process is killed. I was able to make it work by adding some async/wait/timeout call to delay the execution.

Please note that this can also happen in the local case. I guess, that the shutdown of a local VsCode application takes longer than closing the remote processes.

Originally posted by @bhufmann in eclipse-cdt-cloud/vscode-trace-extension#173 (comment)

Error Message after starting/stoping server when vscode-trace-extension is not installed.

rejected promise not handled within 1 second: Error: command 'serverStatus.started' not found
extensionHostProcess.js:104
stack trace: Error: command 'serverStatus.started' not found
at e.CommandService._tryExecuteCommand (vscode-file://vscode-app/usr/share/codium/resources/app/out/vs/workbench/workbench.desktop.main.js:1515:15998)
at e.CommandService.executeCommand (vscode-file://vscode-app/usr/share/codium/resources/app/out/vs/workbench/workbench.desktop.main.js:1515:15880)

Perform automated 3PP license check as part of CI for PRs

At a minimum, a 3PP license check needs to be performed before any release of an Eclipse Foundation project component, but ideally it should be done for each PR before merging, to catch 3PPs with incompatible or unclear licenses as early as possible.

We have been working on a standalone nodejs wrapper for Eclipse Foundation's dash-licenses, that can be used to easily add 3PP license checks in JS/TS repositories:

https://github.com/eclipse-dash/nodejs-wrapper

We will soon have its first release to npm, and thereafter it can be easily be added as a devDependency and used in this repo and others in this organization.

Consider a Docker (potentially remote) deployment alongside linux-based only

Consider initializing support for an implementation based on [1] below.

  • This would be alongside the currently proposed #3, which is mainly Linux-based [2].
  • Below [3] might also have to be considered eventually or alongside [1,2].

[1] https://github.com/gitpod-io/openvscode-server#docker
[2] https://github.com/gitpod-io/openvscode-server#linux
[3] https://github.com/gitpod-io/openvscode-server#securing-access-to-your-ide

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.