This is an automated email from the ASF dual-hosted git repository.

vladi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack-csbench.git


The following commit(s) were added to refs/heads/main by this push:
     new 07cb8c5  Add description for parameters in config file (#2)
07cb8c5 is described below

commit 07cb8c5417085b1d8079fa43611ffe78b323b018
Author: Vishesh <vishes...@gmail.com>
AuthorDate: Mon Dec 18 17:31:38 2023 +0530

    Add description for parameters in config file (#2)
    
    Merging on behalf of @vishesh92
---
 README.md              | 54 +++++++++++++++++++++++++++++++++++++++++++-------
 config/config          | 37 ++++++++++++++++------------------
 config/configreader.go |  7 -------
 csbench.go             | 12 +++++------
 4 files changed, 70 insertions(+), 40 deletions(-)

diff --git a/README.md b/README.md
index 1bb62dd..ad61a82 100644
--- a/README.md
+++ b/README.md
@@ -22,8 +22,48 @@ go build
 
 Setup a config file. Check the sample config file [here](./config/config).
 
+```toml
+# URL of the CloudStack API endpoint
+url = http://localhost:8080/client/api/
+# Number of times to run the test. Used only for -benchmark
+iterations = 1
+# Page of results to start on. Used only for -benchmark
+page = 0
+# Max number of items to return per API call
+pagesize = 5
+# Zone to use for VMs. Used only for -create
+zoneid = <zone id>
+# Template to use for VMs. Used only for -create
+templateid = <template id>
+# Service offering to use for VMs. Used only for -create
+serviceofferingid = <service offering id>
+# Disk offering to use for volumes. Used only for -create
+diskofferingid = <disk offering id>
+# Shared network offering ID. Used only for -create
+networkofferingid = <network offering id>
+# Domain ID of the parent domain to create the subdomains under. Used only for 
-create
+parentdomainid = <domain id>
+# Number of domains to create. Creates a shared network for each domain. Used 
only for -create
+numdomains = 2
+# Number of VMs to create per domain. Used only for -create
+numvms = 2
+# Number of volumes to create & attach per VM. Used only for -create
+numvolumes = 2
+
+# Credentials to use to run -benchmark & -create. Name should be "admin" for 
-create
+# Multiple profiles can be added and they will be used for -benchmark
+[admin]
+apikey = <api key>
+secretkey = <secret key>
+# Duration after which the signature included in the request is expired
+expires = 600
+# Signature version to allow the client to force a specific signature version
+signatureversion = 3
+```
+
+
 ```bash
-/csbench$ ./csbench -h
+$ csbench -h
 Usage: go run csmetrictool.go -dbprofile <DB profile number>
 Options:
   -benchmark
@@ -35,23 +75,23 @@ Options:
   -dbprofile int
         DB profile number
   -domain
-        Create domain
+        Create subdomains and accounts
   -format string
         Format of the report (csv, tsv, table). Valid only for create (default 
"table")
   -limits
-        Update limits to -1
+        Update limits to -1 for subdomains and accounts
   -network
-        Create shared network
+        Create shared network in all subdomains
   -output string
         Path to output file. Valid only for create
   -teardown
         Tear down all subdomains
   -vm
-        Deploy VMs
+        Deploy VMs in all networks in the subdomains
   -volume
-        Attach Volumes to VMs
+        Create and attach Volumes to VMs
   -workers int
-        number of workers to use while creating resources (default 10)
+        Number of workers to use while creating resources (default 10)
 ```
 
 ## Setting up an environment for benchmarking
diff --git a/config/config b/config/config
index a44b543..8d5a1b6 100644
--- a/config/config
+++ b/config/config
@@ -1,35 +1,32 @@
-url = http://localhost:8080/client/api/
-iterations = 1
-page = 0
-pagesize = 1000
-zoneid = d6beefe6-655e-4980-a7fe-b8e954d37029
-templateid = 5b958213-73d9-11ee-8150-7404f10c2178
-serviceofferingid = 39f91d73-0491-43e6-9d2a-1731de959044
-diskofferingid = d645f7ff-0a4d-4c34-a127-74bc1b61777a
-networkofferingid = b3161697-b891-4708-ab10-696c44472764
-parentdomainid = e9fe9167-73d8-11ee-8150-7404f10c2178
-numdomains = 2
-numvms = 2
-numvolumes = 2
+url = http://localhost:8080/client/api/                  # URL of the 
CloudStack API endpoint
+iterations = 1                                           # Number of times to 
run the test. Used only for -benchmark
+page = 0                                                 # Page of results to 
start on. Used only for -benchmark
+pagesize = 500                                           # Max number of items 
to return per API call
+zoneid = d6beefe6-655e-4980-a7fe-b8e954d37029            # Zone to use for 
VMs. Used only for -create
+templateid = 5b958213-73d9-11ee-8150-7404f10c2178        # Template to use for 
VMs. Used only for -create
+serviceofferingid = 39f91d73-0491-43e6-9d2a-1731de959044 # Service offering to 
use for VMs. Used only for -create
+diskofferingid = d645f7ff-0a4d-4c34-a127-74bc1b61777a    # Disk offering to 
use for volumes. Used only for -create
+networkofferingid = b3161697-b891-4708-ab10-696c44472764 # Shared network 
offering ID. Used only for -create
+parentdomainid = e9fe9167-73d8-11ee-8150-7404f10c2178    # Domain ID of the 
parent domain to create the subdomains under. Used only for -create
+numdomains = 2                                           # Number of domains 
to create. Creates a shared network for each domain. Used only for -create
+numvms = 2                                               # Number of VMs to 
create per domain. Used only for -create
+numvolumes = 2                                           # Number of volumes 
to create & attach per VM. Used only for -create
 
-[admin]
+[admin]                                                  # Keys to use to run 
-benchmark & -create. Name should be "admin" for -create
 apikey = 
j3oGqk6f0cCwLCM8H5aCTZc6pZhu6wqSP0cg5k7hTP50adMmN00s5meQp83WE1oLBVAw1k0jb6z0-4kFofzAIg
 secretkey = 
RkDYbrzy70McncZXtPEtto3mLacjOVDeOYAQ5gTYefSdlznYm_WLZEgKc8O-GIKTzK_WpwtdtQjQhjkoybrbFA
-expires = 600
-signatureversion = 3
-timeout = 3600
+expires = 600                                            # Specifies duration 
after which the signature included in the request is expired
+signatureversion = 3                                     # Specifies the 
signature version to allow the client to force a specific signature version
 
-[user]
+[user]                                                   # Profile name. If 
the name is not "admin", then the profile will be ignored for -create
 apikey = 
 secretkey = 
 expires = 600
 signatureversion = 3
-timeout = 3600
 
 [domainadmin]
 apikey = 
 secretkey = 
 expires = 600
 signatureversion = 3
-timeout = 3600
 
diff --git a/config/configreader.go b/config/configreader.go
index 866168d..0d12453 100644
--- a/config/configreader.go
+++ b/config/configreader.go
@@ -33,7 +33,6 @@ type Profile struct {
        SecretKey        string
        Expires          int `default:"600"`
        SignatureVersion int `default:"3"`
-       Timeout          int `default:"3600"`
 }
 
 var URL = "http://localhost:8080/client/api/";
@@ -120,12 +119,6 @@ func ReadProfiles(filePath string) (map[int]*Profile, 
error) {
                                        if err == nil {
                                                profiles[i].SignatureVersion = 
signatureVersion
                                        }
-                               case "timeout":
-                                       var timeout int
-                                       _, err := fmt.Sscanf(value, "%d", 
&timeout)
-                                       if err == nil {
-                                               profiles[i].Timeout = timeout
-                                       }
                                case "zoneid":
                                        ZoneId = value
                                case "networkofferingid":
diff --git a/csbench.go b/csbench.go
index 5ab84af..800e1ca 100644
--- a/csbench.go
+++ b/csbench.go
@@ -193,13 +193,13 @@ func main() {
        dbprofile := flag.Int("dbprofile", 0, "DB profile number")
        create := flag.Bool("create", false, "Create resources")
        benchmark := flag.Bool("benchmark", false, "Benchmark list APIs")
-       domainFlag := flag.Bool("domain", false, "Create domain")
-       limitsFlag := flag.Bool("limits", false, "Update limits to -1")
-       networkFlag := flag.Bool("network", false, "Create shared network")
-       vmFlag := flag.Bool("vm", false, "Deploy VMs")
-       volumeFlag := flag.Bool("volume", false, "Attach Volumes to VMs")
+       domainFlag := flag.Bool("domain", false, "Create subdomains and 
accounts")
+       limitsFlag := flag.Bool("limits", false, "Update limits to -1 for 
subdomains and accounts")
+       networkFlag := flag.Bool("network", false, "Create shared network in 
all subdomains")
+       vmFlag := flag.Bool("vm", false, "Deploy VMs in all networks in the 
subdomains")
+       volumeFlag := flag.Bool("volume", false, "Create and attach Volumes to 
VMs")
        tearDown := flag.Bool("teardown", false, "Tear down all subdomains")
-       workers := flag.Int("workers", 10, "number of workers to use while 
creating resources")
+       workers := flag.Int("workers", 10, "Number of workers to use while 
creating resources")
        format := flag.String("format", "table", "Format of the report (csv, 
tsv, table). Valid only for create")
        outputFile := flag.String("output", "", "Path to output file. Valid 
only for create")
        configFile := flag.String("config", "config/config", "Path to config 
file")

Reply via email to