From 149aedabb4eb762851216a484e36de12d5ecdb8f Mon Sep 17 00:00:00 2001 From: Jason Collins <47123298+jcollins-axway@users.noreply.github.com> Date: Thu, 10 Aug 2023 12:25:11 -0700 Subject: [PATCH] INT - update model (#135) --- discovery/go.mod | 2 +- discovery/go.sum | 4 ++-- go.work.sum | 5 +++-- traceability/go.mod | 2 +- traceability/go.sum | 4 ++-- traceability/pkg/apigee/pollapigeestats.go | 5 +++-- traceability/pkg/apigee/pollapigeestats_test.go | 3 ++- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/discovery/go.mod b/discovery/go.mod index fb6445f..d1b6073 100644 --- a/discovery/go.mod +++ b/discovery/go.mod @@ -5,7 +5,7 @@ go 1.18 // replace github.com/Axway/agent-sdk => /home/ubuntu/go/src/github.com/Axway/agent-sdk require ( - github.com/Axway/agent-sdk v1.1.57 + github.com/Axway/agent-sdk v1.1.60 github.com/Axway/agents-apigee/client v0.0.0-00010101000000-000000000000 github.com/stretchr/testify v1.8.4 ) diff --git a/discovery/go.sum b/discovery/go.sum index 4f34661..49a553b 100644 --- a/discovery/go.sum +++ b/discovery/go.sum @@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Axway/agent-sdk v1.1.57 h1:i8wa8abL4Oxee/zUAZ+tkJhvsHDmGEPt2YFGhVLjlZU= -github.com/Axway/agent-sdk v1.1.57/go.mod h1:xe6dIpQxE0LcSR+ssGKL4mfyLFbrLohdrB9iMYFUCdU= +github.com/Axway/agent-sdk v1.1.60 h1:an2Gr98pltPbFuKBdPOk92TBQPokyuqzZrftiTJQ8Tc= +github.com/Axway/agent-sdk v1.1.60/go.mod h1:xe6dIpQxE0LcSR+ssGKL4mfyLFbrLohdrB9iMYFUCdU= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= diff --git a/go.work.sum b/go.work.sum index e6cb4e9..28654f3 100644 --- a/go.work.sum +++ b/go.work.sum @@ -10,12 +10,15 @@ github.com/Axway/agent-sdk v1.1.41 h1:JLC9ykNQCSIIdzEjFnipBIGD+GUVjv4jRFEZpzCUw6 github.com/Axway/agent-sdk v1.1.41/go.mod h1:Ktgg4H7Y8FigvURTmHNhDdPFJgsITJ5XzB9++sMiOqw= github.com/Axway/agent-sdk v1.1.43 h1:19OtA+uL1W926v7Qij29TfqBnA1hxOcz/oJEZZN0Gpg= github.com/Axway/agent-sdk v1.1.43/go.mod h1:Ktgg4H7Y8FigvURTmHNhDdPFJgsITJ5XzB9++sMiOqw= +github.com/Axway/agent-sdk v1.1.60 h1:an2Gr98pltPbFuKBdPOk92TBQPokyuqzZrftiTJQ8Tc= +github.com/Axway/agent-sdk v1.1.60/go.mod h1:xe6dIpQxE0LcSR+ssGKL4mfyLFbrLohdrB9iMYFUCdU= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= @@ -42,7 +45,6 @@ go.etcd.io/etcd/api/v3 v3.5.4/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dY go.etcd.io/etcd/client/pkg/v3 v3.5.4/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.4/go.mod h1:Ud+VUwIi9/uQHOMA+4ekToJ12lTxlv0zB/+DHwTGEbU= go.etcd.io/etcd/client/v3 v3.5.4/go.mod h1:ZaRkVgBZC+L+dLCjTcF1hRXpgZXQPOvnA/Ak/gq3kiY= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220325170049-de3da57026de/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= @@ -61,7 +63,6 @@ golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220502124256-b6088ccd6cba/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= google.golang.org/api v0.67.0/go.mod h1:ShHKP8E60yPsKNw/w8w+VYaj9H6buA5UqDp8dhbQZ6g= diff --git a/traceability/go.mod b/traceability/go.mod index a5c3df6..075b3df 100644 --- a/traceability/go.mod +++ b/traceability/go.mod @@ -7,7 +7,7 @@ go 1.18 replace github.com/Axway/agents-apigee/client => ../client require ( - github.com/Axway/agent-sdk v1.1.57 + github.com/Axway/agent-sdk v1.1.60 github.com/Axway/agents-apigee/client v0.0.0-00010101000000-000000000000 github.com/elastic/beats/v7 v7.17.5 github.com/gofrs/uuid v4.2.0+incompatible diff --git a/traceability/go.sum b/traceability/go.sum index a517b28..65d7f6b 100644 --- a/traceability/go.sum +++ b/traceability/go.sum @@ -36,8 +36,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Axway/agent-sdk v1.1.57 h1:i8wa8abL4Oxee/zUAZ+tkJhvsHDmGEPt2YFGhVLjlZU= -github.com/Axway/agent-sdk v1.1.57/go.mod h1:xe6dIpQxE0LcSR+ssGKL4mfyLFbrLohdrB9iMYFUCdU= +github.com/Axway/agent-sdk v1.1.60 h1:an2Gr98pltPbFuKBdPOk92TBQPokyuqzZrftiTJQ8Tc= +github.com/Axway/agent-sdk v1.1.60/go.mod h1:xe6dIpQxE0LcSR+ssGKL4mfyLFbrLohdrB9iMYFUCdU= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-autorest v12.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= diff --git a/traceability/pkg/apigee/pollapigeestats.go b/traceability/pkg/apigee/pollapigeestats.go index 6855e08..09ff200 100644 --- a/traceability/pkg/apigee/pollapigeestats.go +++ b/traceability/pkg/apigee/pollapigeestats.go @@ -11,6 +11,7 @@ import ( "github.com/Axway/agent-sdk/pkg/cache" "github.com/Axway/agent-sdk/pkg/jobs" "github.com/Axway/agent-sdk/pkg/transaction/metric" + metricModels "github.com/Axway/agent-sdk/pkg/transaction/models" "github.com/Axway/agent-sdk/pkg/transaction/util" "github.com/Axway/agent-sdk/pkg/util/log" "github.com/Axway/agents-apigee/client/pkg/apigee" @@ -356,7 +357,7 @@ func (j *pollApigeeStats) processMetric(logger log.FieldLogger, metData *metricD apiID = util.FormatProxyID(metData.name) } - apiDetail := metric.APIDetails{ + apiDetail := metricModels.APIDetails{ ID: apiID, Name: apiName, Revision: 1, @@ -368,7 +369,7 @@ func (j *pollApigeeStats) processMetric(logger log.FieldLogger, metData *metricD APIDetails: apiDetail, Duration: newMetricData.ResponseTime, Bytes: 0, - AppDetails: metric.AppDetails{}, + AppDetails: metricModels.AppDetails{}, } appendFunc := func(m metric.Detail) { diff --git a/traceability/pkg/apigee/pollapigeestats_test.go b/traceability/pkg/apigee/pollapigeestats_test.go index 7c43c3c..3c1bd63 100644 --- a/traceability/pkg/apigee/pollapigeestats_test.go +++ b/traceability/pkg/apigee/pollapigeestats_test.go @@ -10,6 +10,7 @@ import ( "github.com/Axway/agent-sdk/pkg/cache" "github.com/Axway/agent-sdk/pkg/transaction/metric" + metricModels "github.com/Axway/agent-sdk/pkg/transaction/models" "github.com/Axway/agents-apigee/client/pkg/apigee" "github.com/Axway/agents-apigee/client/pkg/apigee/models" "github.com/stretchr/testify/assert" @@ -37,7 +38,7 @@ func (m *mockCollector) AddMetricDetail(metricDetail metric.Detail) { m.AddMetric(metricDetail.APIDetails, metricDetail.StatusCode, metricDetail.Duration, metricDetail.Bytes, metricDetail.AppDetails.Name) } -func (m *mockCollector) AddMetric(apiDetails metric.APIDetails, statusCode string, duration, bytes int64, appName string) { +func (m *mockCollector) AddMetric(apiDetails metricModels.APIDetails, statusCode string, duration, bytes int64, appName string) { m.mutex.Lock() defer m.mutex.Unlock() apiCount := make([]int, 3)