Skip to content

Add heartbeat file #1115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2019
Merged

Add heartbeat file #1115

merged 1 commit into from
Oct 28, 2019

Conversation

code-asher
Copy link
Member

Fixes #1050.

@antofthy this will touch ~/.local/share/code-server/heartbeat (or wherever the user data directory is located) once a minute as long as there is an active browser connection. No need to review the code (although I would welcome it if you feel like it) but I'm pinging you to verify this'll work out for your use case.

@code-asher code-asher requested a review from kylecarbs as a code owner October 25, 2019 20:40
@antofthy
Copy link

That would be perfect. Look forward to seeing this on the next code-server release.

@code-asher code-asher merged commit 3a9b032 into master Oct 28, 2019
@code-asher code-asher deleted the heartbeat branch October 28, 2019 14:59
@antofthy
Copy link

Confirmed heartbeat working as expected in the last release v2.1655-vsc1.39.2

@shivanik6z
Copy link

currently, if I deploy code-server for the first time, till the time I don't open it heartbeat shows a very old time. Is it intended? shouldn't heartbeat time be the creation time?

@antofthy
Copy link

Until it is updated heartbeat should either not exist or remain whatever it had been until then.

It is important that any monitoring also look at some other indicator that the user has only just started code-server, and perhaps has not opened there browser to connect to code-server. In my own case we have another file that gets updated whenever the user starts up.

I also now have a log monitor that also updates that secondary file with date/time of last logged web activity for the users 'environment'. This is different as code-server holds many of its web connections open. As such code-server activity does NOT always mean new web-activity, that a proxy 'ingress' service can log, though code-server updated its heartbeat while such a connection is open. Heartbeat is very important to monitor use of code-server!

NOTE Heartbeat is not strictly 'idle time', only a indication the user has code-server open on there browser. Other software (Jupyter for example) does not report connections, only real idleness, which can cause users to become disconnected if they don't do anything substantial in there browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[v2] discovering if user is actually using code-server (for idle check - can do in v1)
5 participants