数据仓库服务 GAUSSDB(DWS)-其它函数:test_tsc_info(time float8, loops int)

时间:2024-09-05 10:32:17

test_tsc_info(time float8, loops int)

描述:测试当前节点通过TSC(TimeStamp-Counter)换算时间的准确性。该函数仅8.2.1及以上集群版本支持。

输入参数含义如下:

  • time:测试的时间差(单位s),测试时长需要小于或者等于60s
  • loops:测试次数,范围值[1,10]

返回值类型:record

返回值字段:

  • id:循环次数。
  • real_time_diff:通过gettimeofday获取的时间差(单位us)。
  • est_time_scalar:通过TSC换算信息转换得到的时间差(单位us)。
  • est_time_frequency:通过TSC频率转换得到的时间差(单位us)。

示例:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
SELECT * FROM test_tsc_info(0.01,10);
 id | real_time_diff | est_time_scalar | est_time_frequency
----+----------------+-----------------+--------------------
  1 |          10057 |                 |            10056.9
  2 |          10057 |                 |   10057.4816666667
  3 |          10056 |                 |   10055.2841666667
  4 |          10054 |                 |   10054.4908333333
  5 |          10055 |                 |         10054.2875
  6 |          10055 |                 |   10054.7483333333
  7 |          10055 |                 |         10054.4725
  8 |          10054 |                 |   10054.0766666667
  9 |          10058 |                 |   10058.1016666667
 10 |          10057 |                 |   10056.3733333333
(10 rows)
support.huaweicloud.com/sqlreference-830-dws/dws_06_0062.html