Skip to content

Commit

Permalink
update constraints
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <jinhao.hu@pingcap.com>
  • Loading branch information
HuSharp committed Apr 20, 2023
1 parent ead3886 commit 5e0e27a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion pkg/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ var Modules = fx.Options(
slowquery.Module,
debugapi.Module,
topsql.Module,
resourcemanager.Module,
visualplan.Module,
deadlock.Module,
resourcemanager.Module,
Expand Down
9 changes: 5 additions & 4 deletions pkg/apiserver/resource_manager/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ package resourcemanager

import (
"fmt"
"net/http"

"github.com/gin-gonic/gin"
"go.uber.org/fx"
"net/http"

"github.com/pingcap/tidb-dashboard/pkg/apiserver/user"
"github.com/pingcap/tidb-dashboard/pkg/apiserver/utils"
Expand All @@ -27,7 +28,7 @@ type Service struct {
}

func newService(p ServiceParams, ff *featureflag.Registry) *Service {
return &Service{params: p, FeatureResourceManager: ff.Register("resource_manager", ">= 5.0.0")}
return &Service{params: p, FeatureResourceManager: ff.Register("resource_manager", ">= 6.5.0")}
}

func registerRouter(r *gin.RouterGroup, auth *user.AuthService, s *Service) {
Expand Down Expand Up @@ -109,7 +110,7 @@ func (s *Service) GetCalibrateByHardware(c *gin.Context) {

db := utils.GetTiDBConnection(c)
resp := &CalibrateResponse{}
err := db.Exec(fmt.Sprintf("calibrate resource workload %s", w)).Scan(resp).Error
err := db.Raw(fmt.Sprintf("calibrate resource workload %s", w)).Scan(resp).Error
if err != nil {
rest.Error(c, err)
return
Expand Down Expand Up @@ -139,7 +140,7 @@ func (s *Service) GetCalibrateByActual(c *gin.Context) {

db := utils.GetTiDBConnection(c)
resp := &CalibrateResponse{}
err := db.Exec(fmt.Sprintf("calibrate resource start_time '%s' end_time '%s'", sTime, eTime)).Scan(resp).Error
err := db.Raw(fmt.Sprintf("calibrate resource start_time '%s' end_time '%s'", sTime, eTime)).Scan(resp).Error
if err != nil {
rest.Error(c, err)
return
Expand Down

0 comments on commit 5e0e27a

Please sign in to comment.