mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 16:16:00 +08:00
fix: update all latency and duration to milliseconds precision
Signed-off-by: Shivanshu Raj Shrivastava <shivanshu1333@gmail.com>
This commit is contained in:
parent
bfa7a06e90
commit
40ca9adbfc
@ -187,8 +187,8 @@ WITH
|
|||||||
countIf(t1_time>0 AND t2_time>0) AS total_s2_raw_spans,
|
countIf(t1_time>0 AND t2_time>0) AS total_s2_raw_spans,
|
||||||
sum(s1_error) AS sum_s1_error,
|
sum(s1_error) AS sum_s1_error,
|
||||||
sum(s2_error) AS sum_s2_error,
|
sum(s2_error) AS sum_s2_error,
|
||||||
avg(dateDiff('microseconds', t1_time, t2_time)/1000.0) AS avg_duration,
|
avg((toUnixTimestamp64Nano(t2_time) - toUnixTimestamp64Nano(t1_time)) / 1e6) AS avg_duration,
|
||||||
quantile(0.99)(dateDiff('microseconds', t1_time, t2_time)/1000.0) AS latency
|
quantile(0.99)((toUnixTimestamp64Nano(t2_time) - toUnixTimestamp64Nano(t1_time)) / 1e6) AS latency
|
||||||
FROM funnel
|
FROM funnel
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -279,15 +279,13 @@ WITH
|
|||||||
sum(s1_error) AS sum_s1_error,
|
sum(s1_error) AS sum_s1_error,
|
||||||
sum(s2_error) AS sum_s2_error,
|
sum(s2_error) AS sum_s2_error,
|
||||||
sum(s3_error) AS sum_s3_error,
|
sum(s3_error) AS sum_s3_error,
|
||||||
avg(dateDiff('microseconds', t1_time, t2_time)/1000.0) AS avg_duration,
|
avg((toUnixTimestamp64Nano(t2_time) - toUnixTimestamp64Nano(t1_time)) / 1e6) AS avg_duration,
|
||||||
quantile(0.99)(dateDiff('microseconds', t1_time, t2_time)/1000.0) AS latency
|
quantile(0.99)((toUnixTimestamp64Nano(t2_time) - toUnixTimestamp64Nano(t1_time)) / 1e6) AS latency
|
||||||
FROM funnel
|
FROM funnel
|
||||||
)
|
)
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
-- compute conversion_rate before dropping any “failures”
|
|
||||||
round(total_s3_spans * 100.0 / total_s1_spans, 2) AS conversion_rate,
|
round(total_s3_spans * 100.0 / total_s1_spans, 2) AS conversion_rate,
|
||||||
-- avg_rate remains step-2 hits per second
|
|
||||||
total_s2_spans / time_window_sec AS avg_rate,
|
total_s2_spans / time_window_sec AS avg_rate,
|
||||||
greatest(sum_s1_error, sum_s2_error, sum_s3_error) AS errors,
|
greatest(sum_s1_error, sum_s2_error, sum_s3_error) AS errors,
|
||||||
avg_duration,
|
avg_duration,
|
||||||
@ -473,7 +471,7 @@ WITH
|
|||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
trace_id,
|
trace_id,
|
||||||
dateDiff('microseconds', t1_time, t2_time)/1000.0 AS duration_ms,
|
(toUnixTimestamp64Nano(t2_time) - toUnixTimestamp64Nano(t1_time)) / 1e6 AS duration_ms,
|
||||||
span_count
|
span_count
|
||||||
FROM (
|
FROM (
|
||||||
SELECT
|
SELECT
|
||||||
@ -532,7 +530,7 @@ WITH
|
|||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
trace_id,
|
trace_id,
|
||||||
dateDiff('microseconds', t1_time, t2_time)/1000.0 AS duration_ms,
|
(toUnixTimestamp64Nano(t2_time) - toUnixTimestamp64Nano(t1_time)) / 1e6 AS duration_ms,
|
||||||
span_count
|
span_count
|
||||||
FROM (
|
FROM (
|
||||||
SELECT
|
SELECT
|
||||||
@ -619,8 +617,8 @@ WITH
|
|||||||
countIf(t1_time > 0) AS total_s1_spans,
|
countIf(t1_time > 0) AS total_s1_spans,
|
||||||
countIf(t1_time > 0 AND t2_time > t1_time) AS total_s2_spans,
|
countIf(t1_time > 0 AND t2_time > t1_time) AS total_s2_spans,
|
||||||
greatest(sum(s1_error), sum(s2_error)) AS errors,
|
greatest(sum(s1_error), sum(s2_error)) AS errors,
|
||||||
avg(dateDiff('microseconds', t1_time, t2_time)/1000.0) AS avg_duration,
|
avg((toUnixTimestamp64Nano(t2_time) - toUnixTimestamp64Nano(t1_time)) / 1e6) AS avg_duration,
|
||||||
quantile(%[13]s)(dateDiff('microseconds', t1_time, t2_time)/1000.0) AS latency
|
quantile(%[13]s)((toUnixTimestamp64Nano(t2_time) - toUnixTimestamp64Nano(t1_time)) / 1e6) AS latency
|
||||||
FROM funnel
|
FROM funnel
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -714,10 +712,10 @@ WITH
|
|||||||
sum(s1_error) AS sum_s1_error,
|
sum(s1_error) AS sum_s1_error,
|
||||||
sum(s2_error) AS sum_s2_error,
|
sum(s2_error) AS sum_s2_error,
|
||||||
sum(s3_error) AS sum_s3_error,
|
sum(s3_error) AS sum_s3_error,
|
||||||
avg(dateDiff('microseconds', t1_time, t2_time)/1000.0) AS avg_duration_12,
|
avg((toUnixTimestamp64Nano(t2_time) - toUnixTimestamp64Nano(t1_time)) / 1e6) AS avg_duration_12,
|
||||||
quantile(%[18]s)(dateDiff('microseconds', t1_time, t2_time)/1000.0) AS latency_12,
|
quantile(%[18]s)((toUnixTimestamp64Nano(t2_time) - toUnixTimestamp64Nano(t1_time)) / 1e6) AS latency_12,
|
||||||
avg(dateDiff('microseconds', t2_time, t3_time)/1000.0) AS avg_duration_23,
|
avg((toUnixTimestamp64Nano(t3_time) - toUnixTimestamp64Nano(t2_time)) / 1e6) AS avg_duration_23,
|
||||||
quantile(%[19]s)(dateDiff('microseconds', t2_time, t3_time)/1000.0) AS latency_23
|
quantile(%[19]s)((toUnixTimestamp64Nano(t3_time) - toUnixTimestamp64Nano(t2_time)) / 1e6) AS latency_23
|
||||||
FROM funnel
|
FROM funnel
|
||||||
)
|
)
|
||||||
`
|
`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user