performance-analyzer icon indicating copy to clipboard operation
performance-analyzer copied to clipboard

Replacement for CLK_TCK on Windows build

Open ryanbogan opened this issue 3 years ago • 4 comments

Child of https://github.com/opensearch-project/performance-analyzer/issues/75

I am currently writing an install script for a Windows build for issue #828. What should the replacement be for this section of opensearch-tar-install.sh on a Windows build?

CLK_TCK=`/usr/bin/getconf CLK_TCK`
echo "-Dclk.tck=$CLK_TCK" >> $OPENSEARCH_HOME/config/jvm.options

ryanbogan avatar Jan 13 '22 21:01 ryanbogan

Looks like this is used by performance-analyzer, let's move this issue into that repo.

Without this variable set PA will not start.

dblock avatar Jan 14 '22 15:01 dblock

@ryanbogan Note that PA is currently not included in the Windows distribution, so it's safe to skip this variable altogether for Windows right now.

dblock avatar Jan 14 '22 15:01 dblock

@ryanbogan hey can we get an update on this?

CEHENKLE avatar Jan 27 '22 19:01 CEHENKLE

TLDR: Set any value you want, Windows doesn't use this constant, but 10,000,000 is probably the best option.

Short answer: If you have to pick a value, choose 10,000,000, which represents the number of increments of the displayed "ticks" value per second, which correlates directly to the practical usage (converting "jiffies" to a unit of time) of Linux CLK_TCK (ticks per second) and matches TimeSpan.TicksPerSecond in .NET.

Long answer:

Arguably, you could choose 64, which is the actual number of clock ticks per second, although it's never used in any calculation and while accurate, is useless. The windows clock changes in 1/64 of a second increments, which equates to 15.625 milliseconds. (This is roughly comparable to the 10 millisecond ticks of most Linux distributions with CLK_TCK of 100.) However, that value is never actually used in userspace.

However, the unit displayed to users for the System clock and any time-related metrics is in 100 nanosecond units. (This is amusing as it appears to give an artificial precision, but the values increment in multiple of 156250.).

dbwiddis avatar Oct 15 '22 03:10 dbwiddis