Skip to content

Commit f26ae7f

Browse files
committed
add threads in sysbench gui
1 parent bdd2ba6 commit f26ae7f

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

cluster/cluster_set.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,8 @@ func (cluster *Cluster) SetSysbenchThreads(Threads string) {
911911
i, err := strconv.Atoi(Threads)
912912
if err == nil {
913913
cluster.Conf.SysbenchThreads = i
914+
} else {
915+
cluster.LogPrintf(LvlErr, "Error converting threads to int %s", err)
914916
}
915917
}
916918

server/api_cluster.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,9 +1638,9 @@ func (repman *ReplicationManager) handlerMuxClusterSysbench(w http.ResponseWrite
16381638
http.Error(w, "No valid ACL", 403)
16391639
return
16401640
}
1641-
vars := mux.Vars(r)
1642-
if _, ok := vars["theads"]; ok {
1643-
mycluster.SetSysbenchThreads(vars["theads"])
1641+
if r.URL.Query().Get("threads") != "" {
1642+
mycluster.LogPrintf(cluster.LvlInfo, "Setting Sysbench threads to %s", r.URL.Query().Get("threads"))
1643+
mycluster.SetSysbenchThreads(r.URL.Query().Get("threads"))
16441644
}
16451645
go mycluster.RunSysbench()
16461646
}

share/dashboard/app/dashboard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ function (
11511151

11521152

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

11571157
$scope.runonetest = function (test) {

share/dashboard/static/card-cluster-test.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
<tr>
2222
<td >
2323
<md-select name="selectedThreads" id="selectedThreads" ng-model="selectedThreads" >
24-
<md-option> 1 </md-option>
25-
<md-option> 4 </md-option>
26-
<md-option> 8 </md-option>
27-
<md-option> 16 </md-option>
28-
<md-option> 32 </md-option>
29-
<md-option> 64 </md-option>
30-
<md-option> 128 </md-option>
24+
<md-option ng-value="1" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}" > 1 </md-option>
25+
<md-option ng-value="4" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}"> 4 </md-option>
26+
<md-option ng-value="8" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}" > 8 </md-option>
27+
<md-option ng-value="16" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}"> 16 </md-option>
28+
<md-option ng-value="32" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}"> 32 </md-option>
29+
<md-option ng-value="64" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}"> 64 </md-option>
30+
<md-option ng-value="128" ng-selected="{{element == selectedCluster.config.sysbenchThreads}}"> 128 </md-option>
3131
</md-select>
3232
</td><td colspan=2>
3333
<md-button type="button" class="btn btn-primary" ng-click="sysbench(selectedThreads)">Sysbench</md-button>

0 commit comments

Comments
 (0)