Skip to content

Commit 2bb3154

Browse files
authored
Merge pull request #804 Add fields to result stat
2 parents 2b953aa + d957da3 commit 2bb3154

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Add method to QueryStats interface for add new stat fields
12
* Added check if commit order is bad in sync mode
23

34
## v3.49.1

internal/table/scanner/stats.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ func (s *queryStats) QueryAST() string {
3838
return s.stats.GetQueryAst()
3939
}
4040

41+
func (s *queryStats) TotalCPUTime() time.Duration {
42+
return time.Microsecond * time.Duration(s.stats.TotalCpuTimeUs)
43+
}
44+
45+
func (s *queryStats) TotalDuration() time.Duration {
46+
return time.Microsecond * time.Duration(s.stats.TotalDurationUs)
47+
}
48+
4149
// NextPhase returns next execution phase within query.
4250
// If ok flag is false, then there are no more phases and p is invalid.
4351
func (s *queryStats) NextPhase() (p stats.QueryPhase, ok bool) {

table/stats/stats.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ type QueryStats interface {
1919
Compilation() (c *CompilationStats)
2020
QueryPlan() string
2121
QueryAST() string
22+
TotalCPUTime() time.Duration
23+
TotalDuration() time.Duration
24+
2225
// NextPhase returns next execution phase within query.
2326
// If ok flag is false, then there are no more phases and p is invalid.
2427
NextPhase() (p QueryPhase, ok bool)

0 commit comments

Comments
 (0)