Skip to content

Commit ae9c7fe

Browse files
author
eloubersac
committed
xMerge branch 'develop' of github.com:signal18/replication-manager into develop
2 parents ca54a80 + f26ae7f commit ae9c7fe

File tree

5 files changed

+34
-49
lines changed

5 files changed

+34
-49
lines changed

cluster/cluster_set.go

+9
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,15 @@ func (cluster *Cluster) SetClusterHead(ClusterName string) {
907907
cluster.Conf.ClusterHead = ClusterName
908908
}
909909

910+
func (cluster *Cluster) SetSysbenchThreads(Threads string) {
911+
i, err := strconv.Atoi(Threads)
912+
if err == nil {
913+
cluster.Conf.SysbenchThreads = i
914+
} else {
915+
cluster.LogPrintf(LvlErr, "Error converting threads to int %s", err)
916+
}
917+
}
918+
910919
func (cluster *Cluster) SetServicePlan(theplan string) error {
911920
plans := cluster.GetServicePlans()
912921
for _, plan := range plans {

etc/opensvc/cluster-api/cluster-demo/stephane.d/mysql80.toml.no

-39
This file was deleted.

server/api_cluster.go

+4
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,10 @@ func (repman *ReplicationManager) handlerMuxClusterSysbench(w http.ResponseWrite
16381638
http.Error(w, "No valid ACL", 403)
16391639
return
16401640
}
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"))
1644+
}
16411645
go mycluster.RunSysbench()
16421646
}
16431647
return

share/dashboard/app/dashboard.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -1150,8 +1150,8 @@ function (
11501150
};
11511151

11521152

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

11571157
$scope.runonetest = function (test) {
@@ -1532,7 +1532,7 @@ function (
15321532
};
15331533

15341534

1535-
1535+
15361536

15371537
$scope.openCluster = function (clusterName) {
15381538
$timeout.cancel( $scope.promise);
@@ -1621,11 +1621,11 @@ function (
16211621
// $scope.callServices();
16221622
// $scope.setClusterCredentialDialog();
16231623
}
1624-
1624+
16251625
$mdSidenav('right').close();
16261626
$scope.menuOpened = false;
1627-
1628-
1627+
1628+
16291629
};
16301630
$scope.deleteClusterDialog = function () {
16311631
$scope.menuOpened = true;
@@ -1638,7 +1638,7 @@ function (
16381638
// escapeToClose: false,
16391639
});
16401640
};
1641-
1641+
16421642
$scope.cancelNewClusterDialog = function () {
16431643
$mdDialog.hide({contentElement: '#myNewClusterDialog',});
16441644
$mdSidenav('right').close();
@@ -1699,7 +1699,7 @@ function (
16991699
escapeToClose: false,
17001700
});
17011701
};
1702-
1702+
17031703
$scope.closeClusterCredentialDialog = function (user,pass) {
17041704
$mdDialog.hide({contentElement: '#myClusterCredentialDialog',});
17051705
if (confirm("Confirm set user/password")) httpGetWithoutResponse(getClusterUrl() + '/settings/actions/set/db-servers-credential/' + user + ':' + pass);

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,23 @@
1414
ng-repeat="element in settings.tests" value="{{element}}">{{element}}</md-option>
1515
</md-select>
1616
</td> <td>
17+
1718
<md-button type="button" class="btn btn-primary" ng-click="test()">Run Tests</md-button>
1819
</td>
1920
</tr>
2021
<tr>
21-
<td colspan=3>
22-
<md-button type="button" class="btn btn-primary" ng-click="sysbench()">Sysbench</md-button>
22+
<td >
23+
<md-select name="selectedThreads" id="selectedThreads" ng-model="selectedThreads" >
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>
31+
</md-select>
32+
</td><td colspan=2>
33+
<md-button type="button" class="btn btn-primary" ng-click="sysbench(selectedThreads)">Sysbench</md-button>
2334
</td>
2435
</tr>
2536
<tr>

0 commit comments

Comments
 (0)