Skip to content

Commit

Permalink
add threads in sysbench gui
Browse files Browse the repository at this point in the history
  • Loading branch information
svaroqui committed Jun 8, 2023
1 parent bdd2ba6 commit f26ae7f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 2 additions & 0 deletions cluster/cluster_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,8 @@ func (cluster *Cluster) SetSysbenchThreads(Threads string) {
i, err := strconv.Atoi(Threads)
if err == nil {
cluster.Conf.SysbenchThreads = i
} else {
cluster.LogPrintf(LvlErr, "Error converting threads to int %s", err)
}
}

Expand Down
6 changes: 3 additions & 3 deletions server/api_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1638,9 +1638,9 @@ func (repman *ReplicationManager) handlerMuxClusterSysbench(w http.ResponseWrite
http.Error(w, "No valid ACL", 403)
return
}
vars := mux.Vars(r)
if _, ok := vars["theads"]; ok {
mycluster.SetSysbenchThreads(vars["theads"])
if r.URL.Query().Get("threads") != "" {
mycluster.LogPrintf(cluster.LvlInfo, "Setting Sysbench threads to %s", r.URL.Query().Get("threads"))
mycluster.SetSysbenchThreads(r.URL.Query().Get("threads"))
}
go mycluster.RunSysbench()
}
Expand Down
2 changes: 1 addition & 1 deletion share/dashboard/app/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ function (


$scope.sysbench = function (threads) {
if (confirm("Confirm sysbench run !")) httpGetWithoutResponse(getClusterUrl() + '/actions/sysbench?threads='+threads);
if (confirm("Confirm sysbench run !"+ threads)) httpGetWithoutResponse(getClusterUrl() + '/actions/sysbench?threads='+threads);
};

$scope.runonetest = function (test) {
Expand Down
14 changes: 7 additions & 7 deletions share/dashboard/static/card-cluster-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<tr>
<td >
<md-select name="selectedThreads" id="selectedThreads" ng-model="selectedThreads" >
<md-option> 1 </md-option>
<md-option> 4 </md-option>
<md-option> 8 </md-option>
<md-option> 16 </md-option>
<md-option> 32 </md-option>
<md-option> 64 </md-option>
<md-option> 128 </md-option>
<md-option ng-value="1" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}" > 1 </md-option>
<md-option ng-value="4" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}"> 4 </md-option>
<md-option ng-value="8" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}" > 8 </md-option>
<md-option ng-value="16" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}"> 16 </md-option>
<md-option ng-value="32" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}"> 32 </md-option>
<md-option ng-value="64" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}"> 64 </md-option>
<md-option ng-value="128" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}"> 128 </md-option>
</md-select>
</td><td colspan=2>
<md-button type="button" class="btn btn-primary" ng-click="sysbench(selectedThreads)">Sysbench</md-button>
Expand Down

0 comments on commit f26ae7f

Please sign in to comment.