Skip to content

Commit

Permalink
Add Admin Telemetry Statement (#908)
Browse files Browse the repository at this point in the history
* Add telemetry tokens to admin statement

Signed-off-by: Breezewish <[email protected]>

* Merge ADMIN SHOW TELMETRY_ID and ADMIN SHOW TELEMETRY_DATA

Signed-off-by: Breezewish <[email protected]>
  • Loading branch information
breezewish authored Jun 23, 2020
1 parent 8be0c27 commit b74301a
Show file tree
Hide file tree
Showing 5 changed files with 7,784 additions and 7,722 deletions.
6 changes: 6 additions & 0 deletions ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1626,6 +1626,8 @@ const (
AdminCaptureBindings
AdminEvolveBindings
AdminReloadBindings
AdminShowTelemetry
AdminResetTelemetryID
)

// HandleRange represents a range where handle value >= Begin and < End.
Expand Down Expand Up @@ -1834,6 +1836,10 @@ func (n *AdminStmt) Restore(ctx *format.RestoreCtx) error {
ctx.WriteKeyWord("EVOLVE BINDINGS")
case AdminReloadBindings:
ctx.WriteKeyWord("RELOAD BINDINGS")
case AdminShowTelemetry:
ctx.WriteKeyWord("SHOW TELEMETRY")
case AdminResetTelemetryID:
ctx.WriteKeyWord("RESET TELEMETRY_ID")
default:
return errors.New("Unsupported AdminStmt type")
}
Expand Down
3 changes: 3 additions & 0 deletions misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ var tokenMap = map[string]int{
"REPLICA": replica,
"REPLICATION": replication,
"REQUIRE": require,
"RESET": reset,
"RESPECT": respect,
"RESTORE": restore,
"RESTORES": restores,
Expand Down Expand Up @@ -643,6 +644,8 @@ var tokenMap = map[string]int{
"TABLE": tableKwd,
"TABLES": tables,
"TABLESPACE": tablespace,
"TELEMETRY": telemetry,
"TELEMETRY_ID": telemetryID,
"TEMPORARY": temporary,
"TEMPTABLE": temptable,
"TERMINATED": terminated,
Expand Down
Loading

0 comments on commit b74301a

Please sign in to comment.