Refactored, updated tests

This commit is contained in:
Peter Grlica
2022-03-21 12:59:01 +01:00
parent 2617cb8e5b
commit e4dc6dc5f5
12 changed files with 221 additions and 210 deletions
+3 -3
View File
@@ -1690,7 +1690,7 @@ endpoints:
path:
- { type: uint64, name: queueID, required: true, title: Queue ID }
- title: API Gateway routes
- title: Integration gateway routes
path: "/apigw/route"
entrypoint: apigwRoute
authentication: []
@@ -1751,7 +1751,7 @@ endpoints:
path: "/{routeID}/undelete"
parameters: { path: [ { name: routeID, type: uint64, required: true, title: "Route ID" } ] }
- title: API Gateway filters
- title: Integration gateway filters
path: "/apigw/filter"
entrypoint: apigwFilter
authentication: []
@@ -1822,7 +1822,7 @@ endpoints:
title: Proxy auth definitions
path: "/proxy_auth/def"
- title: API Gateway profiler
- title: Integration gateway profiler
path: "/apigw/profiler"
entrypoint: apigwProfiler
authentication: []
+4 -6
View File
@@ -17,7 +17,7 @@ import (
var (
sortAggFields = []string{"path", "count", "size_min", "size_max", "size_avg", "time_min", "time_max", "time_avg"}
sortRouteFields = []string{"time_start", "time_finish", "time_duration"}
sortRouteFields = []string{"time_start", "time_finish", "time_duration", "content_length", "http_status_code"}
)
const (
@@ -56,9 +56,8 @@ func (svc *apigwProfiler) Hits(ctx context.Context, filter types.ApigwProfilerFi
}
var sorting = profiler.Sort{
Hit: filter.Hit,
Path: filter.Path,
Before: filter.Before,
Hit: filter.Hit,
Path: filter.Path,
}
var (
@@ -130,8 +129,7 @@ func (svc *apigwProfiler) HitsAggregated(ctx context.Context, filter types.Apigw
var (
list = apigw.Service().Profiler().Hits(profiler.Sort{
Path: filter.Path,
Before: filter.Before,
Path: filter.Path,
})
tsum, tmin, tmax time.Duration
+1 -3
View File
@@ -207,10 +207,8 @@ type (
Enabled bool `kv:"-" json:"enabled"`
} `kv:"federation" json:"federation"`
// Federation settings
// Integration gateway settings
Apigw struct {
// This only holds the value of APIGW_PROFILER_ENABLED for now
//
ProfilerEnabled bool `kv:"-" json:"profilerEnabled"`
ProfilerGlobal bool `kv:"-" json:"profilerGlobal"`
} `kv:"apigw" json:"apigw"`