Skip to content

Commit

Permalink
fix transaction-http-analysis failed to order by avgDuration
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjoey committed Jun 19, 2024
1 parent 52c72a9 commit 47d87a4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/apps/msp/apm/service/view/table/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ var (
)

var TransactionTableSortFieldSqlMap = map[string]string{
columnReqCount.Key: "sum(elapsed_count::field)",
columnErrorCount.Key: "sum(if(eq(error::tag, 'true'),elapsed_count::field,0))",
columnReqCount.Key: "sum(elapsed_count::field)",
columnErrorCount.Key: "sum(if(eq(error::tag, 'true'),elapsed_count::field,0))",
columnAvgDuration.Key: "avg(elapsed_sum::field)",
}

type TransactionTableRow struct {
Expand Down Expand Up @@ -122,7 +123,7 @@ func (t *TransactionTableBuilder) GetTable(ctx context.Context) (*Table, error)
"%s,"+
"sum(elapsed_count::field),"+
"sum(if(eq(error::tag, 'true'),elapsed_count::field,0)),"+
"sum(elapsed_sum::field)/sum(elapsed_count::field) "+
"avg(elapsed_sum::field) "+
"FROM %s "+
"WHERE (target_terminus_key::tag=$terminus_key OR source_terminus_key::tag=$terminus_key) "+
"%s "+
Expand Down

0 comments on commit 47d87a4

Please sign in to comment.