Skip to content

Commit

Permalink
support record terminal command audit
Browse files Browse the repository at this point in the history
  • Loading branch information
chengjoey committed Jul 29, 2024
1 parent 8acba2d commit 78480c2
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/apps/msp/apm/service/view/card/avg_duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type AvgDurationCard struct {
}

func (r *AvgDurationCard) GetCard(ctx context.Context) (*ServiceCard, error) {
statement := fmt.Sprintf("SELECT avg(elapsed_sum::field) "+
statement := fmt.Sprintf("SELECT avg(elapsed_mean::field) "+
"FROM %s "+
"WHERE (target_terminus_key::tag=$terminus_key OR source_terminus_key::tag=$terminus_key) "+
"%s "+
Expand Down
2 changes: 1 addition & 1 deletion internal/apps/msp/apm/service/view/chart/avg_duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type AvgDurationChart struct {
}

func (avgDuration *AvgDurationChart) GetChart(ctx context.Context) (*pb.ServiceChart, error) {
statement := fmt.Sprintf("SELECT avg(elapsed_sum::field) "+
statement := fmt.Sprintf("SELECT avg(elapsed_mean::field) "+
"FROM %s "+
"WHERE (target_terminus_key::tag=$terminus_key OR source_terminus_key::tag=$terminus_key) "+
"%s "+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type AvgDurationDistributionChart struct {
}

func (avgDuration *AvgDurationDistributionChart) GetChart(ctx context.Context) (*pb.ServiceChart, error) {
statement := fmt.Sprintf("SELECT avg(elapsed_sum::field), sum(elapsed_count::field) "+
statement := fmt.Sprintf("SELECT avg(elapsed_mean::field), sum(elapsed_count::field) "+
"FROM %s "+
"WHERE (target_terminus_key::tag=$terminus_key OR source_terminus_key::tag=$terminus_key) "+
"%s "+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type ErrorDurationDistributionChart struct {
}

func (avgDuration *ErrorDurationDistributionChart) GetChart(ctx context.Context) (*pb.ServiceChart, error) {
statement := fmt.Sprintf("SELECT avg(elapsed_sum::field), sum(elapsed_count::field) "+
statement := fmt.Sprintf("SELECT avg(elapsed_mean::field), sum(elapsed_count::field) "+
"FROM %s_error "+
"WHERE (target_terminus_key::tag=$terminus_key OR source_terminus_key::tag=$terminus_key) "+
"%s "+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type SlowDurationDistributionChart struct {
}

func (avgDuration *SlowDurationDistributionChart) GetChart(ctx context.Context) (*pb.ServiceChart, error) {
statement := fmt.Sprintf("SELECT avg(elapsed_sum::field), sum(elapsed_count::field) "+
statement := fmt.Sprintf("SELECT avg(elapsed_mean::field), sum(elapsed_count::field) "+
"FROM %s_slow "+
"WHERE (target_terminus_key::tag=$terminus_key OR source_terminus_key::tag=$terminus_key) "+
"%s "+
Expand Down
4 changes: 2 additions & 2 deletions internal/apps/msp/apm/service/view/table/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var (
var TransactionTableSortFieldSqlMap = map[string]string{
columnReqCount.Key: "sum(elapsed_count::field)",
columnErrorCount.Key: "sum(if(eq(error::tag, 'true'),elapsed_count::field,0))",
columnAvgDuration.Key: "avg(elapsed_sum::field)",
columnAvgDuration.Key: "avg(elapsed_mean::field)",
}

type TransactionTableRow struct {
Expand Down Expand Up @@ -123,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)),"+
"avg(elapsed_sum::field) "+
"avg(elapsed_mean::field) "+
"FROM %s "+
"WHERE (target_terminus_key::tag=$terminus_key OR source_terminus_key::tag=$terminus_key) "+
"%s "+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ import (
"regexp"
"sync"

"github.com/erda-project/erda/internal/tools/orchestrator/scheduler/executor/executortypes"

"github.com/gorilla/websocket"
"github.com/sirupsen/logrus"

"github.com/erda-project/erda/apistructs"
"github.com/erda-project/erda/internal/tools/orchestrator/conf"
"github.com/erda-project/erda/internal/tools/orchestrator/scheduler/executor/executortypes"
"github.com/erda-project/erda/pkg/clusterdialer"
)

Expand Down

0 comments on commit 78480c2

Please sign in to comment.