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