Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarking the reflection API #150

Open
advancedwebdeveloper opened this issue Mar 18, 2021 · 1 comment
Open

Benchmarking the reflection API #150

advancedwebdeveloper opened this issue Mar 18, 2021 · 1 comment

Comments

@advancedwebdeveloper
Copy link

I have modified the source files as follows:

diff --git a/go.mod b/go.mod
index 0491f2d..eb9c282 100644
--- a/go.mod
+++ b/go.mod
@@ -1,12 +1,13 @@
module github.com/apache/openwhisk-client-go

-go 1.15
+go 1.16

require (
github.com/BurntSushi/toml v0.3.1 // indirect
github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fatih/color v1.10.0

  •   github.com/goccy/go-reflect v1.1.0
      github.com/google/go-querystring v1.0.0
      github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519
      github.com/nicksnyder/go-i18n v1.10.1
    

diff --git a/go.sum b/go.sum
index 25fcb1b..86cd625 100644
--- a/go.sum
+++ b/go.sum
@@ -11,6 +11,8 @@ github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGE
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
+github.com/goccy/go-reflect v1.1.0 h1:kiT3+exv9ULtdpawlMzCGT1y5bWOmuY3jgS86GB9t1s=
+github.com/goccy/go-reflect v1.1.0/go.mod h1:n0oYZn8VcV2CkWTxi8B9QjkCoq6GTtCEdfmR66YhFtE=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
diff --git a/whisk/client.go b/whisk/client.go
index 0bd25cd..5f18a8f 100644
--- a/whisk/client.go
+++ b/whisk/client.go
@@ -29,12 +29,13 @@ import (
"net"
"net/http"
"net/url"

  •   "reflect"
      "regexp"
      "runtime"
      "strings"
      "time"
    
  •   reflect "github.com/goccy/go-reflect"
    
  •   "github.com/apache/openwhisk-client-go/wski18n"
    

)

diff --git a/whisk/util.go b/whisk/util.go
index 683c680..32e7a09 100644
--- a/whisk/util.go
+++ b/whisk/util.go
@@ -21,9 +21,10 @@ import (
"errors"
"fmt"
"net/url"

  •   "reflect"
      "strings"
    
  •   reflect "github.com/goccy/go-reflect"
    
  •   "github.com/apache/openwhisk-client-go/wski18n"
      "github.com/fatih/color"
      "github.com/google/go-querystring/query"
    
@advancedwebdeveloper
Copy link
Author

Looks like the project is compiling and tests are running.

I was suggesting to benchmark these API calls:

v := reflect.ValueOf(options)

if v.Kind() == reflect.Ptr && v.IsNil() {

Debug(DbgInfo, "Parsing HTTP response into struct type: %s\n", reflect.TypeOf(v))

Debug(DbgInfo, "Successful parse of HTTP response into struct type: %s\n", reflect.TypeOf(v))

Debug(DbgWarn, "Unsuccessful parse of HTTP response into struct type: %s; parse error '%v'\n", reflect.TypeOf(v), err)

!strings.Contains(reflect.TypeOf(v).String(), "Activation") && // Request is not `wsk activation get`

I saw thinking about a test suite, containing a test-function-per-callee.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant