github.com/GuanceCloud/cliutils@v1.1.21/pipeline/ptinput/funcs/md/duration_precision.md (about) 1 ### `duration_precision()` {#fn-duration-precision} 2 3 函数原型:`fn duration_precision(key, old_precision: str, new_precision: str)` 4 5 函数说明:进行 duration 精度的转换,通过参数指定当前精度和目标精度。支持在 s, ms, us, ns 间转换。 6 7 ```python 8 # in << {"ts":12345} 9 json(_, ts) 10 cast(ts, "int") 11 duration_precision(ts, "ms", "ns") 12 13 # Extracted data(drop: false, cost: 33.279µs): 14 # { 15 # "message": "{\"ts\":12345}", 16 # "ts": 12345000000 17 # } 18 ```