mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 20:15:54 +08:00
chore: modify producer output
This commit is contained in:
parent
f508ee7521
commit
90cb8ba9a1
@ -122,7 +122,7 @@ Response in query range `table` format
|
||||
"isValueColumn": false
|
||||
},
|
||||
{
|
||||
"name": "rps",
|
||||
"name": "throughput",
|
||||
"queryName": "",
|
||||
"isValueColumn": false
|
||||
}
|
||||
@ -132,7 +132,7 @@ Response in query range `table` format
|
||||
"data": {
|
||||
"error_percentage": "0",
|
||||
"p99": "5.51359028",
|
||||
"rps": "39.86888888888889",
|
||||
"throughput": "39.86888888888889",
|
||||
"service_name": "producer-svc"
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ WITH consumer_query AS (
|
||||
GROUP BY serviceName
|
||||
)
|
||||
|
||||
-- Main query to select all metrics
|
||||
SELECT
|
||||
serviceName AS service_name,
|
||||
p99,
|
||||
@ -65,7 +64,7 @@ SELECT
|
||||
serviceName AS service_name,
|
||||
p99,
|
||||
COALESCE((error_count * 100.0) / total_count, 0) AS error_percentage,
|
||||
COALESCE(total_count / %d, 0) AS rps -- Convert nanoseconds to seconds
|
||||
COALESCE(total_count / %d, 0) AS throughput -- Convert nanoseconds to seconds
|
||||
FROM
|
||||
producer_query
|
||||
ORDER BY
|
||||
@ -78,12 +77,11 @@ ORDER BY
|
||||
func generateNetworkLatencyThroughputSQL(start, end int64, consumerGroup, queueType string) string {
|
||||
timeRange := (end - start) / 1000000000
|
||||
query := fmt.Sprintf(`
|
||||
--- Subquery for RPS calculation, desc sorted by rps
|
||||
SELECT
|
||||
stringTagMap['messaging.client_id'] AS client_id,
|
||||
stringTagMap['service.instance.id'] AS service_instance_id,
|
||||
serviceName AS service_name,
|
||||
count(*) / %d AS rps -- Convert nanoseconds to seconds
|
||||
count(*) / %d AS throughput -- Convert nanoseconds to seconds
|
||||
FROM signoz_traces.distributed_signoz_index_v2
|
||||
WHERE
|
||||
timestamp >= '%d'
|
||||
@ -92,7 +90,7 @@ WHERE
|
||||
AND msgSystem = '%s'
|
||||
AND stringTagMap['messaging.kafka.consumer.group'] = '%s'
|
||||
GROUP BY service_name, client_id, service_instance_id
|
||||
ORDER BY rps DESC
|
||||
ORDER BY throughput DESC
|
||||
`, timeRange, start, end, queueType, consumerGroup)
|
||||
return query
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user