Skip to content

Conversation

@Tim-ats-d
Copy link
Contributor

@Tim-ats-d Tim-ats-d commented Oct 16, 2025

Previously, current time was gathered with Unix.time which has a resolution of one second. Since each LSP request responds take less than one second to be computed, the "dur" filed is always set to 0 in reported metrics.
This patch uses Unix.gettimeofday to compute more precise timestamps.

cc @voodoos

@Tim-ats-d Tim-ats-d changed the title Improve precision of collected metrics Improve precision of duration field in view-metrics Oct 16, 2025
Copy link
Collaborator

@voodoos voodoos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but the changelog is wrong.

@Tim-ats-d Tim-ats-d force-pushed the master branch 3 times, most recently from 7c6fc4b to 3be1268 Compare October 16, 2025 12:05
@Tim-ats-d
Copy link
Contributor Author

Thank you 👍

@voodoos voodoos merged commit d8c268d into ocaml:master Oct 23, 2025
1 of 6 checks passed
davesnx added a commit to davesnx/ocaml-lsp that referenced this pull request Nov 3, 2025
…rmat-mlx

* 'master' of github.com:/ocaml/ocaml-lsp:
  Rename parameter used to configure nested bindings. (ocaml#1568)
  Upgrade to ocamlformat 0.28.1 (ocaml#1569)
  Improve precision of duration field in `view-metrics` (ocaml#1565)
  Make `code-lens` for toplevel let binding configurable (ocaml#1567)
  Fix 5.4 CI
  Enable support for OCaml 5.4 and prepare release 1.24.0 (ocaml#1559)
  Prepare release 1.23.1 (ocaml#1558)
davesnx pushed a commit to davesnx/ocaml-lsp that referenced this pull request Nov 26, 2025
* Improve precision of metrics timestamp.

* Add change entry.

---------

Co-authored-by: Ulysse <[email protected]>
davesnx pushed a commit to davesnx/ocaml-lsp that referenced this pull request Nov 26, 2025
* Improve precision of metrics timestamp.

* Add change entry.

---------

Co-authored-by: Ulysse <[email protected]>
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.

2 participants