feat: add errorCount in top_operations API (#2636)

This commit is contained in:
Vishal Sharma 2023-04-26 18:23:54 +05:30 committed by GitHub
parent 5ad367a0fc
commit 33ac5b79be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -1854,6 +1854,7 @@ func (r *ClickHouseReader) GetTopOperations(ctx context.Context, queryParams *mo
quantile(0.95)(durationNano) as p95,
quantile(0.99)(durationNano) as p99,
COUNT(*) as numCalls,
countIf(statusCode=2) as errorCount,
name
FROM %s.%s
WHERE serviceName = @serviceName AND timestamp>= @start AND timestamp<= @end`,

View File

@ -272,6 +272,7 @@ type TopOperationsItem struct {
Percentile95 float64 `json:"p95" ch:"p95"`
Percentile99 float64 `json:"p99" ch:"p99"`
NumCalls uint64 `json:"numCalls" ch:"numCalls"`
ErrorCount uint64 `json:"errorCount" ch:"errorCount"`
Name string `json:"name" ch:"name"`
}