Skip to content

Commit

Permalink
Fr 14 (#16)
Browse files Browse the repository at this point in the history
* start modification

* DONE  Add constants as idioms
DONE  Functions to get params as string directly from Family object

* Implementing also the auto calculation for the connections

* Update README.md

* Update README.md

* Update README.md

* Update help

* grouping constants

* Adjust several calculation to better represent the load scenarios.
add the CpuConncetionMillFactor const which is the key to tune the load factor

* Adjust several calculation to better represent the load scenarios.
add the CpuConncetionMillFactor const which is the key to tune the load factor

* some comments for future development

* Version fix

* missing go.mod :/

* readme fix

* Update README.md
  • Loading branch information
Tusamarco authored Oct 18, 2023
1 parent 450a902 commit 507d091
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,14 @@ func testGetconfiguration(moc MO.MysqlOperatorCalculator) {
var err error

myRequest.LoadType = MO.LoadType{Id: 2}
myRequest.Dimension = MO.Dimension{Id: 999, Cpu: 4000, Memory: 2.5}
myRequest.Dimension = MO.Dimension{Id: 999, Cpu: 4000, Memory: "2.5GB"}
var errConv error
myRequest.Dimension.MemoryBytes, errConv = myRequest.Dimension.ConvertMemoryToBytes(myRequest.Dimension.Memory)
// If any error then do what you want ...
if errConv != nil {
println(errConv.Error())
syscall.Exit(1)
}
myRequest.DBType = "group_replication" //"pxc"
myRequest.Output = "human" //"human"
myRequest.Connections = 70
Expand Down Expand Up @@ -591,7 +598,7 @@ The first object we need to create is the ConfigurationRequest:
then we can populate it, in this case we DO NOT set a supported environment but an open scope:
```go
myRequest.LoadType = MO.LoadType{Id: 2}
myRequest.Dimension = MO.Dimension{Id: 999, Cpu: 4000, Memory: 2.5}
myRequest.Dimension = MO.Dimension{Id: 999, Cpu: 4000, MemoryBytes: 2684354560}
myRequest.DBType = "group_replication" //"pxc"
myRequest.Output = "human" //"human"
myRequest.Connections = 70
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
module github.com/Tusamarco/mysqloperatorcalculator

go 1.20
go 1.21

require github.com/sirupsen/logrus v1.9.0
require github.com/sirupsen/logrus v1.9.3

require (
code.cloudfoundry.org/bytefmt v0.0.0-20230612151507-41ef4d1f67a4 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf // indirect
golang.org/x/sys v0.13.0 // indirect
)

//require golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
code.cloudfoundry.org/bytefmt v0.0.0-20230612151507-41ef4d1f67a4 h1:9G5F8zgma5v0GdDvNz6iZwwJp3RS/z0SY/aHGfVwvTo=
code.cloudfoundry.org/bytefmt v0.0.0-20230612151507-41ef4d1f67a4/go.mod h1:wYHCXH/gI19ujoFVuMkY48qPpPCoHLKBKXPkn67h/Yc=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf h1:FtEj8sfIcaaBfAKrE1Cwb61YDtYq9JxChK1c7AKce7s=
github.com/inhies/go-bytesize v0.0.0-20220417184213-4913239db9cf/go.mod h1:yrqSXGoD/4EKfF26AOGzscPOgTTJcyAwM2rpixWT+t4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit 507d091

Please sign in to comment.