> `jcmd` provides great diagnostics but many commands lack a timestamp in their 
> output.
> Adding a timestamp to the output of some would add value for those debugging 
> JVM data.
> 
> With this MR I propose to introduce time-stamping to all diagnostic `jcmd` 
> commands in a form of an additional common flag "-t":
> 
> jcmd [pid | main-class] [-t] command... | PerfCounter.print | -f filename
>                         ^^^^
> 
> 
> This is a simplified approach to handle timestamp (v1 is 
> [here](https://github.com/openjdk/jdk/pull/27368))
> 
> Some diagnostic commands already provide timestamps information. For example 
> `Thread.print` already starts with a timestamp of "yyyy-MM-dd HH:mm:ss" 
> format.
> In that case the timestamp is printed twice if "-t" flag is passed to 
> `Thread.print`.
> 
> The time format for the generic timestamp is ISO 8601. Example: 
> `2026-01-21T16:58:49.518+0100`

Ivan Bereziuk has updated the pull request incrementally with three additional 
commits since the last revision:

 - change timestamp format to ISO 8601
 - lowercase flag
 - improve test. Assert new ISO 8601 format

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/29325/files
  - new: https://git.openjdk.org/jdk/pull/29325/files/eaea764d..1047677b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=29325&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=29325&range=00-01

  Stats: 21 lines in 6 files changed: 1 ins; 5 del; 15 mod
  Patch: https://git.openjdk.org/jdk/pull/29325.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/29325/head:pull/29325

PR: https://git.openjdk.org/jdk/pull/29325

Reply via email to