Commit Graph
2567 Commits
Author SHA1 Message Date
Antonio ScandurraandNathan Sobo 4f4829ba11 Use BTreeMap in Server so we release memory when maps are cleared
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-06-23 18:02:17 +02:00
Antonio Scandurra 3be9dd77ef Remove non-determinism from Peer caused by smol's timeout helper 2022-06-22 18:39:12 +02:00
Antonio Scandurra 167f14bf28 Ensure receive timeout is triggered before waiting on disconnection 2022-06-22 18:02:42 +02:00
Antonio Scandurra 6503c48787 Use Arc<Deterministic> to understand which await points are parking 2022-06-22 17:39:34 +02:00
Antonio Scandurra 5df2cf8bc5 💄 2022-06-22 15:06:22 +02:00
Antonio Scandurra 3f0cfb4ae6 Use a FuturesUnordered to process foreground messages
This prevents deadlocks when e.g., client A performs a request to client B and
client B performs a request to client A. If both clients stop processing further
messages until their respective request completes, they won't have a chance to
respond to the other client's request and cause a deadlock.

This arrangement ensures we will attempt to process earlier messages first, but fall
back to processing messages arrived later in the spirit of making progress.
2022-06-22 15:04:17 +02:00
Antonio Scandurra 2f9b21b943 Add test demonstrating hang when peers wait on each other's response 2022-06-22 14:41:14 +02:00
Antonio ScandurraandMax Brunsfeld e4981d98ab Report running language servers when sharing project for the first time
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-06-21 20:39:54 +02:00
Max BrunsfeldandAntonio Scandurra c47abf1d47 Add failing test for replication of lsp statuses
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-21 11:27:08 -07:00
Max BrunsfeldandAntonio Scandurra a9fa5ec14a Fix error when worktree has no file extensions
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-21 11:02:13 -07:00
Antonio Scandurra d240b4920a Expose project metadata via GET /project_metadata 2022-06-21 18:06:31 +02:00
Antonio Scandurra 0f30de23aa Exclude staff from activity recording 2022-06-21 16:07:59 +02:00
Antonio Scandurra 72f3ffe284 Accept a datetime range when querying project activity 2022-06-21 14:03:10 +02:00
Antonio Scandurra 7eb672c1e4 Unregister project from db when user disconnects or manually does so 2022-06-21 10:37:34 +02:00
Antonio Scandurra 12b3138de1 Register projects in the database and record worktree extensions 2022-06-21 10:29:26 +02:00
Max Brunsfeld 46d614d62f Add an API that returns the most active users and the projects where they've been active 2022-06-20 19:46:37 -07:00
Antonio Scandurra 5ad9e9e6c8 Determine Buffer::is_dirty based on the rope's fingerprint 2022-06-17 12:38:25 +02:00
Antonio Scandurra 21c730dd79 Fix tests 2022-06-15 11:16:26 +02:00
Antonio Scandurra 33c902540b Harvest the latest metrics when /metrics is requested
Now that we track active projects, if nothing happens to the store
during the activity timeout we would still serve some old metrics
that may not account for the staleness of a project.

This commit changes it so that we grab a mutable reference to the store
before serving the metrics, which has the side effect of updating
all the metrics.
2022-06-15 10:54:51 +02:00
Antonio Scandurra e4a45db02c 🎨 2022-06-15 10:42:37 +02:00
Antonio Scandurra e627636760 Track active projects in metrics
An active project is defined as a project where there has been at
least a buffer edit, a join request/response, or a follow update
in the last minute.
2022-06-15 10:33:20 +02:00
Antonio Scandurra 95a5094487 Exclude admins from collected metrics 2022-06-14 16:26:00 +02:00
Antonio Scandurra 297842b911 Broadcast only visible worktree root names 2022-06-14 15:15:23 +02:00
Antonio Scandurra a92e888419 Merge branch 'main' into users-api 2022-06-14 11:14:16 +02:00
Antonio Scandurra 6988a24297 Allow specifying query, limit and page when hitting /api/users
This is needed to introduce pagination and search in our admin panel.
2022-06-13 17:30:01 +02:00
Antonio Scandurra ce8444afb7 Expose a new POST /api/bulk_users API to create many users at once
This API will accept a vector of JSON entries containing the GitHub login,
the email address and the invite count. If that user already exist, the
invite count will be updated to the new one.
2022-06-13 15:18:18 +02:00
Antonio Scandurra c9943d6f39 Merge pull request #1172 from zed-industries/more-logs
Add more logging to `collab` to better understand user behavior
2022-06-13 09:22:37 +02:00
Antonio Scandurra 217385e726 Exclude ignored files from the logged extension count 2022-06-13 09:16:16 +02:00
Antonio Scandurra a6cc293327 Don't retain message payloads in span, just log the payload instead 2022-06-13 09:06:58 +02:00
Antonio Scandurra b1cfad4d4a Log extension counts when worktree is updated 2022-06-13 08:57:21 +02:00
Max Brunsfeld edc9277f33 Move prometheus annotations from deployment to pod spec 2022-06-10 14:32:36 -07:00
Max BrunsfeldandAntonio Scandurra 20e6ab92ee Add DataDog OpenMetrics annotations to collab k8s deployment
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-10 13:35:52 -07:00
Max BrunsfeldandAntonio Scandurra 3a4c8743f3 Add OpenMetrics endpoint exposing the basic RPC store metrics as guages
Co-authored-by: Antonio Scandurra <me@as-cii.com>
2022-06-10 13:32:56 -07:00
Antonio Scandurra 18a5f6e96f WIP: Start adding more logs 2022-06-10 18:17:02 +02:00
Antonio Scandurra 8b3a50ee7f Reduce log level on collab
This is generating way too much data and doesn't seem very cost-effective
to investigate the issues we've had with the stale contacts panel.
2022-06-08 09:06:13 +02:00
Keith Simmons 69bc9489f6 Add integration test and fix hovering over the wire 2022-06-07 14:22:02 -07:00
Max Brunsfeld 5b61e763be Update connected users' invite info when they are granted invite codes 2022-06-06 11:14:01 -07:00
Max Brunsfeld 6830c4ef76 Add setting to make projects online/offline by default 2022-06-03 17:01:15 -07:00
Max Brunsfeld 070c108f4a Avoid persisting project's state before it has been initialized 2022-06-03 16:40:16 -07:00
Max Brunsfeld 20565017ec Rename project's 'public'/'private' flag to 'online'/'offline' 2022-06-03 14:39:06 -07:00
Max Brunsfeld 4dbdb7f479 Store a FakeFs on TestClient 2022-06-03 13:49:47 -07:00
Max Brunsfeld 06718b304e Don't store Project on TestClient in integration tests 2022-06-03 13:00:56 -07:00
Max Brunsfeld 26063722ed Don't update contacts when a project is first registered
Until the host has sent an UpdateProject message to populate the project's
metadata, there is no reason to update contacts.
2022-06-02 17:41:21 -07:00
Max Brunsfeld 6263737ec8 Use rocksdb to store project paths' public/private state 2022-06-02 17:38:33 -07:00
Max Brunsfeld 54eb6fa94b Upgrade deps to avoid multiple versions of transitive deps
* env_logger
* prost-build
* bindgen
2022-06-02 17:38:33 -07:00
Max Brunsfeld 0591ddd47a Change project registration RPC APIs to smooth out UI updates
* Make `UnregisterProject` a request. This way the client-side project can wait
  to clear out its remote id until the request has completed, so that the
  contacts panel can avoid showing duplicate private/public projects in the
  brief time after unregistering a project, before the next UpdateCollaborators
  message is received.
* Remove the `RegisterWorktree` and `UnregisterWorktree` methods and replace
  them with a single `UpdateProject` method that idempotently updates the
  Project's list of worktrees.
2022-06-02 17:32:43 -07:00
Max Brunsfeld c05a8274fc Remove stray println 2022-06-02 17:32:43 -07:00
Max Brunsfeld 4bb17889e8 Allow making projects private 2022-06-02 17:32:42 -07:00
Max Brunsfeld 54e5583ea4 Fix mismatched client/context in integration test 2022-06-02 17:29:11 -07:00
Max Brunsfeld f04e05f966 Show private projects in the contacts panel
Introduce a ProjectStore that lets you iterate through all open projects.
Allow projects to be made public by clicking the lock.
2022-06-02 17:29:11 -07:00