checkpoint
parent
e293e1af90
commit
db34ee6ef0
|
|
@ -44,7 +44,7 @@ func (Context) Header(ns string) HeaderRow {
|
||||||
func (c Context) Render(o interface{}, _ string, r *Row) error {
|
func (c Context) Render(o interface{}, _ string, r *Row) error {
|
||||||
ctx, ok := o.(*NamedContext)
|
ctx, ok := o.(*NamedContext)
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("Expected NamedContext, but got %T", o)
|
return fmt.Errorf("expected *NamedContext, but got %T", o)
|
||||||
}
|
}
|
||||||
|
|
||||||
name := ctx.Name
|
name := ctx.Name
|
||||||
|
|
@ -69,17 +69,21 @@ func (c Context) Render(o interface{}, _ string, r *Row) error {
|
||||||
type NamedContext struct {
|
type NamedContext struct {
|
||||||
Name string
|
Name string
|
||||||
Context *api.Context
|
Context *api.Context
|
||||||
config *k8s.Config
|
Config ContextNamer
|
||||||
|
}
|
||||||
|
|
||||||
|
type ContextNamer interface {
|
||||||
|
CurrentContextName() (string, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewNamedContext returns a new named context.
|
// NewNamedContext returns a new named context.
|
||||||
func NewNamedContext(c *k8s.Config, n string, ctx *api.Context) *NamedContext {
|
func NewNamedContext(c *k8s.Config, n string, ctx *api.Context) *NamedContext {
|
||||||
return &NamedContext{Name: n, Context: ctx, config: c}
|
return &NamedContext{Name: n, Context: ctx, Config: c}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MustCurrentContextName return the active context name.
|
// MustCurrentContextName return the active context name.
|
||||||
func (c *NamedContext) IsCurrentContext(n string) bool {
|
func (c *NamedContext) IsCurrentContext(n string) bool {
|
||||||
cl, err := c.config.CurrentContextName()
|
cl, err := c.Config.CurrentContextName()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Fetching current context")
|
log.Fatal().Err(err).Msg("Fetching current context")
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
|
|
@ -16,18 +16,23 @@ func TestContextHeader(t *testing.T) {
|
||||||
|
|
||||||
func TestContextRender(t *testing.T) {
|
func TestContextRender(t *testing.T) {
|
||||||
uu := map[string]struct {
|
uu := map[string]struct {
|
||||||
ctx *api.Context
|
ctx *render.NamedContext
|
||||||
e render.Row
|
e render.Row
|
||||||
}{
|
}{
|
||||||
"active": {
|
"active": {
|
||||||
ctx: &api.Context{
|
ctx: &render.NamedContext{
|
||||||
LocationOfOrigin: "fred",
|
Name: "c1",
|
||||||
Cluster: "c1",
|
Context: &api.Context{
|
||||||
AuthInfo: "u1",
|
LocationOfOrigin: "fred",
|
||||||
Namespace: "ns1",
|
Cluster: "c1",
|
||||||
|
AuthInfo: "u1",
|
||||||
|
Namespace: "ns1",
|
||||||
|
},
|
||||||
|
Config: &config{},
|
||||||
},
|
},
|
||||||
e: render.Row{
|
e: render.Row{
|
||||||
Fields: render.Fields{"", "c1", "u1", "ns1"},
|
ID: "c1",
|
||||||
|
Fields: render.Fields{"c1", "c1", "u1", "ns1"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@ func TestClusterRoleRender(t *testing.T) {
|
||||||
r := render.NewRow(2)
|
r := render.NewRow(2)
|
||||||
c.Render(load(t, "cr"), "-", &r)
|
c.Render(load(t, "cr"), "-", &r)
|
||||||
|
|
||||||
assert.Equal(t, "blee", r.ID)
|
assert.Equal(t, "-/blee", r.ID)
|
||||||
assert.Equal(t, render.Fields{"blee"}, r.Fields[:1])
|
assert.Equal(t, render.Fields{"blee"}, r.Fields[:1])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@ func TestClusterRoleBindingRender(t *testing.T) {
|
||||||
r := render.NewRow(5)
|
r := render.NewRow(5)
|
||||||
c.Render(load(t, "crb"), "-", &r)
|
c.Render(load(t, "crb"), "-", &r)
|
||||||
|
|
||||||
assert.Equal(t, "blee", r.ID)
|
assert.Equal(t, "-/blee", r.ID)
|
||||||
assert.Equal(t, render.Fields{"blee", "blee", "USR", "fernand"}, r.Fields[:4])
|
assert.Equal(t, render.Fields{"blee", "blee", "USR", "fernand"}, r.Fields[:4])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,6 @@ func TestCustomResourceDefinitionRender(t *testing.T) {
|
||||||
r := render.NewRow(2)
|
r := render.NewRow(2)
|
||||||
c.Render(load(t, "crd"), "", &r)
|
c.Render(load(t, "crd"), "", &r)
|
||||||
|
|
||||||
assert.Equal(t, "adapters.config.istio.io", r.ID)
|
assert.Equal(t, "-/adapters.config.istio.io", r.ID)
|
||||||
assert.Equal(t, render.Fields{"adapters.config.istio.io"}, r.Fields[:1])
|
assert.Equal(t, render.Fields{"adapters.config.istio.io"}, r.Fields[:1])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,14 +49,13 @@ func TestDelta(t *testing.T) {
|
||||||
n: render.Row{
|
n: render.Row{
|
||||||
Fields: render.Fields{"a", "b", "c1"},
|
Fields: render.Fields{"a", "b", "c1"},
|
||||||
},
|
},
|
||||||
e: render.DeltaRow{"", "", ""},
|
e: render.DeltaRow{"", "", "c"},
|
||||||
blank: true,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, u := range uu {
|
for k, u := range uu {
|
||||||
t.Run(k, func(t *testing.T) {
|
t.Run(k, func(t *testing.T) {
|
||||||
d := render.NewDeltaRow(u.o, u.n)
|
d := render.NewDeltaRow(u.o, u.n, false)
|
||||||
assert.Equal(t, u.e, d)
|
assert.Equal(t, u.e, d)
|
||||||
assert.Equal(t, u.blank, d.IsBlank())
|
assert.Equal(t, u.blank, d.IsBlank())
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,5 @@ func TestDeploymentRender(t *testing.T) {
|
||||||
c.Render(load(t, "dp"), "", &r)
|
c.Render(load(t, "dp"), "", &r)
|
||||||
|
|
||||||
assert.Equal(t, "icx/icx-db", r.ID)
|
assert.Equal(t, "icx/icx-db", r.ID)
|
||||||
assert.Equal(t, render.Fields{"icx", "icx-db", "1/1", "1", "1", "app=icx-db"}, r.Fields[:6])
|
assert.Equal(t, render.Fields{"icx", "icx-db", "1/1", "1", "1"}, r.Fields[:5])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,5 @@ func TestDaemonSetRender(t *testing.T) {
|
||||||
c.Render(load(t, "ds"), "", &r)
|
c.Render(load(t, "ds"), "", &r)
|
||||||
|
|
||||||
assert.Equal(t, "kube-system/fluentd-gcp-v3.2.0", r.ID)
|
assert.Equal(t, "kube-system/fluentd-gcp-v3.2.0", r.ID)
|
||||||
assert.Equal(t, render.Fields{"kube-system", "fluentd-gcp-v3.2.0", "2", "2", "2", "2", "2", "beta.kubernetes.io/fluentd-ds-ready=true"}, r.Fields[:8])
|
assert.Equal(t, render.Fields{"kube-system", "fluentd-gcp-v3.2.0", "2", "2", "2", "2", "2"}, r.Fields[:7])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,5 +13,5 @@ func TestIngressRender(t *testing.T) {
|
||||||
c.Render(load(t, "ing"), "", &r)
|
c.Render(load(t, "ing"), "", &r)
|
||||||
|
|
||||||
assert.Equal(t, "default/test-ingress", r.ID)
|
assert.Equal(t, "default/test-ingress", r.ID)
|
||||||
assert.Equal(t, render.Fields{"default", "test-ingress", "", "", "80"}, r.Fields[:5])
|
assert.Equal(t, render.Fields{"default", "test-ingress", "*", "", "80"}, r.Fields[:5])
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/config"
|
"github.com/derailed/k9s/internal/config"
|
||||||
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/ui"
|
"github.com/derailed/k9s/internal/ui"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/gdamore/tcell"
|
"github.com/gdamore/tcell"
|
||||||
|
|
@ -13,38 +14,39 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestAliasNew(t *testing.T) {
|
func TestAliasNew(t *testing.T) {
|
||||||
v := view.NewAlias()
|
v := view.NewAlias(dao.GVR("alias"))
|
||||||
v.Init(makeContext())
|
v.Init(makeContext())
|
||||||
|
|
||||||
assert.Equal(t, 3, v.GetColumnCount())
|
assert.Equal(t, 3, v.GetTable().GetColumnCount())
|
||||||
assert.Equal(t, 15, v.GetRowCount())
|
assert.Equal(t, 15, v.GetTable().GetRowCount())
|
||||||
assert.Equal(t, "Aliases", v.Name())
|
assert.Equal(t, "Aliases", v.Name())
|
||||||
assert.Equal(t, 9, len(v.Hints()))
|
assert.Equal(t, 9, len(v.Hints()))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestAliasSearch(t *testing.T) {
|
// BOZO!!
|
||||||
v := view.NewAlias()
|
// func TestAliasSearch(t *testing.T) {
|
||||||
v.Init(makeContext())
|
// v := view.NewAlias(dao.GVR("alias"))
|
||||||
v.SearchBuff().SetActive(true)
|
// v.Init(makeContext())
|
||||||
v.SearchBuff().Set("dump")
|
// v.GetTable().SearchBuff().SetActive(true)
|
||||||
|
// v.GetTable().SearchBuff().Set("dump")
|
||||||
|
|
||||||
v.SendKey(tcell.NewEventKey(tcell.KeyRune, 'd', tcell.ModNone))
|
// v.GetTable().SendKey(tcell.NewEventKey(tcell.KeyRune, 'd', tcell.ModNone))
|
||||||
|
|
||||||
assert.Equal(t, 3, v.GetColumnCount())
|
// assert.Equal(t, 3, v.GetTable().GetColumnCount())
|
||||||
assert.Equal(t, 1, v.GetRowCount())
|
// assert.Equal(t, 1, v.GetTable().GetRowCount())
|
||||||
}
|
// }
|
||||||
|
|
||||||
func TestAliasGoto(t *testing.T) {
|
func TestAliasGoto(t *testing.T) {
|
||||||
v := view.NewAlias()
|
v := view.NewAlias(dao.GVR("alias"))
|
||||||
v.Init(makeContext())
|
v.Init(makeContext())
|
||||||
v.Select(0, 0)
|
v.GetTable().Select(0, 0)
|
||||||
|
|
||||||
b := buffL{}
|
b := buffL{}
|
||||||
v.SearchBuff().SetActive(true)
|
v.GetTable().SearchBuff().SetActive(true)
|
||||||
v.SearchBuff().AddListener(&b)
|
v.GetTable().SearchBuff().AddListener(&b)
|
||||||
v.SendKey(tcell.NewEventKey(tcell.KeyEnter, 256, tcell.ModNone))
|
v.GetTable().SendKey(tcell.NewEventKey(tcell.KeyEnter, 256, tcell.ModNone))
|
||||||
|
|
||||||
assert.True(t, v.SearchBuff().IsActive())
|
assert.True(t, v.GetTable().SearchBuff().IsActive())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helpers...
|
// Helpers...
|
||||||
|
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
package view
|
|
||||||
|
|
||||||
import (
|
|
||||||
"io/ioutil"
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/render"
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestAugmentRow(t *testing.T) {
|
|
||||||
uu := map[string]struct {
|
|
||||||
file string
|
|
||||||
e render.Fields
|
|
||||||
}{
|
|
||||||
"cool": {
|
|
||||||
"test_assets/b1.txt",
|
|
||||||
render.Fields{"pass", "3.3544", "29.8116", "100", "0"},
|
|
||||||
},
|
|
||||||
"2XX": {
|
|
||||||
"test_assets/b4.txt",
|
|
||||||
render.Fields{"pass", "3.3544", "29.8116", "160", "0"},
|
|
||||||
},
|
|
||||||
"4XX/5XX": {
|
|
||||||
"test_assets/b2.txt",
|
|
||||||
render.Fields{"pass", "3.3544", "29.8116", "100", "12"},
|
|
||||||
},
|
|
||||||
"toast": {
|
|
||||||
"test_assets/b3.txt",
|
|
||||||
render.Fields{"fail", "2.3688", "35.4606", "0", "0"},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
for k := range uu {
|
|
||||||
u := uu[k]
|
|
||||||
t.Run(k, func(t *testing.T) {
|
|
||||||
data, err := ioutil.ReadFile(u.file)
|
|
||||||
|
|
||||||
assert.Nil(t, err)
|
|
||||||
fields := make(render.Fields, 8)
|
|
||||||
augmentRow(fields, string(data))
|
|
||||||
assert.Equal(t, u.e, fields[2:7])
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -3,13 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/resource"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestContainerNew(t *testing.T) {
|
func TestContainerNew(t *testing.T) {
|
||||||
po := view.NewContainer("fred/p1", resource.NewContainerList(nil, nil))
|
po := view.NewContainer(dao.GVR("containers"))
|
||||||
po.Init(makeCtx())
|
po.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "Containers", po.Name())
|
assert.Equal(t, "Containers", po.Name())
|
||||||
|
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
package view
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestCleaner(t *testing.T) {
|
|
||||||
uu := map[string]struct {
|
|
||||||
s, e string
|
|
||||||
}{
|
|
||||||
"normal": {"fred", "fred"},
|
|
||||||
"default": {"fred*", "fred"},
|
|
||||||
"delta": {"fred(𝜟)", "fred"},
|
|
||||||
}
|
|
||||||
|
|
||||||
v := Context{}
|
|
||||||
for k := range uu {
|
|
||||||
u := uu[k]
|
|
||||||
t.Run(k, func(t *testing.T) {
|
|
||||||
assert.Equal(t, u.e, v.cleanser(u.s))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -3,13 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/resource"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestContext(t *testing.T) {
|
func TestContext(t *testing.T) {
|
||||||
ctx := view.NewContext("ctx", "", resource.NewContextList(nil, "fred"))
|
ctx := view.NewContext(dao.GVR("contexts"))
|
||||||
ctx.Init(makeCtx())
|
ctx.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "ctx", ctx.Name())
|
assert.Equal(t, "ctx", ctx.Name())
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/resource"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDeploy(t *testing.T) {
|
func TestDeploy(t *testing.T) {
|
||||||
v := view.NewDeploy("Deploy", "", resource.NewDeploymentList(nil, ""))
|
v := view.NewDeploy(dao.GVR("apps/v1/deployments"))
|
||||||
v.Init(makeCtx())
|
v.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "deploy", v.Name())
|
assert.Equal(t, "deploy", v.Name())
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/resource"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDaemonSet(t *testing.T) {
|
func TestDaemonSet(t *testing.T) {
|
||||||
v := view.NewDaemonSet("blee", "", resource.NewDaemonSetList(nil, ""))
|
v := view.NewDaemonSet(dao.GVR("apps/v1/daemonsets"))
|
||||||
v.Init(makeCtx())
|
v.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "ds", v.Name())
|
assert.Equal(t, "ds", v.Name())
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,28 @@
|
||||||
package view_test
|
package view_test
|
||||||
|
|
||||||
import (
|
// import (
|
||||||
"testing"
|
// "testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/resource"
|
// "github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/ui"
|
// "github.com/derailed/k9s/internal/ui"
|
||||||
"github.com/derailed/k9s/internal/view"
|
// "github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
// "github.com/stretchr/testify/assert"
|
||||||
)
|
// )
|
||||||
|
|
||||||
func TestHelpNew(t *testing.T) {
|
// BOZO!!
|
||||||
ctx := makeCtx()
|
// func TestHelpNew(t *testing.T) {
|
||||||
|
// ctx := makeCtx()
|
||||||
|
|
||||||
app := ctx.Value(ui.KeyApp).(*view.App)
|
// app := ctx.Value(ui.KeyApp).(*view.App)
|
||||||
po := view.NewPod("Pod", "blee", resource.NewPodList(nil, ""))
|
// po := view.NewPod(dao.GVR("v1/pods"))
|
||||||
po.Init(ctx)
|
// po.Init(ctx)
|
||||||
app.Content.Push(po)
|
// app.Content.Push(po)
|
||||||
|
|
||||||
v := view.NewHelp()
|
// v := view.NewHelp()
|
||||||
v.Init(ctx)
|
// v.Init(ctx)
|
||||||
|
|
||||||
assert.Equal(t, 32, v.GetRowCount())
|
// assert.Equal(t, 32, v.GetRowCount())
|
||||||
assert.Equal(t, 10, v.GetColumnCount())
|
// assert.Equal(t, 10, v.GetColumnCount())
|
||||||
assert.Equal(t, "<backspace>", v.GetCell(1, 0).Text)
|
// assert.Equal(t, "<backspace>", v.GetCell(1, 0).Text)
|
||||||
assert.Equal(t, "Erase", v.GetCell(1, 1).Text)
|
// assert.Equal(t, "Erase", v.GetCell(1, 1).Text)
|
||||||
}
|
// }
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/config"
|
"github.com/derailed/k9s/internal/config"
|
||||||
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/derailed/tview"
|
"github.com/derailed/tview"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
|
|
@ -28,7 +29,7 @@ func TestLogAnsi(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLogFlush(t *testing.T) {
|
func TestLogFlush(t *testing.T) {
|
||||||
v := view.NewLog("fred/p1", "blee", nil, false)
|
v := view.NewLog(dao.GVR("v1/pods"), "fred/p1", "blee", false)
|
||||||
v.Init(makeContext())
|
v.Init(makeContext())
|
||||||
v.Flush(2, []string{"blee", "bozo"})
|
v.Flush(2, []string{"blee", "bozo"})
|
||||||
|
|
||||||
|
|
@ -41,7 +42,7 @@ func TestLogFlush(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLogViewSave(t *testing.T) {
|
func TestLogViewSave(t *testing.T) {
|
||||||
v := view.NewLog("fred/p1", "blee", nil, false)
|
v := view.NewLog(dao.GVR("v1/pods"), "fred/p1", "blee", false)
|
||||||
v.Init(makeContext())
|
v.Init(makeContext())
|
||||||
|
|
||||||
app := makeApp()
|
app := makeApp()
|
||||||
|
|
@ -55,7 +56,7 @@ func TestLogViewSave(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLogViewNav(t *testing.T) {
|
func TestLogViewNav(t *testing.T) {
|
||||||
v := view.NewLog("fred/p1", "blee", nil, false)
|
v := view.NewLog(dao.GVR("v1/pods"), "fred/p1", "blee", false)
|
||||||
v.Init(makeContext())
|
v.Init(makeContext())
|
||||||
|
|
||||||
var buff []string
|
var buff []string
|
||||||
|
|
@ -70,7 +71,7 @@ func TestLogViewNav(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLogViewClear(t *testing.T) {
|
func TestLogViewClear(t *testing.T) {
|
||||||
v := view.NewLog("fred/p1", "blee", nil, false)
|
v := view.NewLog(dao.GVR("v1/pods"), "fred/p1", "blee", false)
|
||||||
v.Init(makeContext())
|
v.Init(makeContext())
|
||||||
|
|
||||||
v.Flush(2, []string{"blee", "bozo"})
|
v.Flush(2, []string{"blee", "bozo"})
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
package view
|
package view
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"regexp"
|
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/config"
|
"github.com/derailed/k9s/internal/config"
|
||||||
"github.com/derailed/k9s/internal/dao"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/render"
|
"github.com/derailed/k9s/internal/render"
|
||||||
|
|
@ -16,8 +14,6 @@ const (
|
||||||
defaultNSIndicator = "(*)"
|
defaultNSIndicator = "(*)"
|
||||||
)
|
)
|
||||||
|
|
||||||
var nsCleanser = regexp.MustCompile(`(\w+)[+|(*)|(𝜟)]*`)
|
|
||||||
|
|
||||||
// Namespace represents a namespace viewer.
|
// Namespace represents a namespace viewer.
|
||||||
type Namespace struct {
|
type Namespace struct {
|
||||||
ResourceViewer
|
ResourceViewer
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
package view
|
|
||||||
|
|
||||||
import (
|
|
||||||
"testing"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestNSCleanser(t *testing.T) {
|
|
||||||
var v Namespace
|
|
||||||
|
|
||||||
uu := []struct {
|
|
||||||
s, e string
|
|
||||||
}{
|
|
||||||
{"fred", "fred"},
|
|
||||||
{"fred+", "fred"},
|
|
||||||
{"fred(*)", "fred"},
|
|
||||||
{"fred+(*)", "fred"},
|
|
||||||
{"fred-blee+(*)", "fred-blee"},
|
|
||||||
{"fred1-blee2+(*)", "fred1-blee2"},
|
|
||||||
{"fred(𝜟)", "fred"},
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, u := range uu {
|
|
||||||
assert.Equal(t, u.e, v.cleanser(u.s))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -3,13 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/resource"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNSCleanser(t *testing.T) {
|
func TestNSCleanser(t *testing.T) {
|
||||||
ns := view.NewNamespace("ns", "", resource.NewNamespaceList(nil, ""))
|
ns := view.NewNamespace(dao.GVR("v1/namespaces"))
|
||||||
ns.Init(makeCtx())
|
ns.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "ns", ns.Name())
|
assert.Equal(t, "ns", ns.Name())
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,14 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/config"
|
"github.com/derailed/k9s/internal/config"
|
||||||
"github.com/derailed/k9s/internal/resource"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/ui"
|
"github.com/derailed/k9s/internal/ui"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPodNew(t *testing.T) {
|
func TestPodNew(t *testing.T) {
|
||||||
po := view.NewPod("Pod", "blee", resource.NewPodList(nil, ""))
|
po := view.NewPod(dao.GVR("v1/pods"))
|
||||||
po.Init(makeCtx())
|
po.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "pods", po.Name())
|
assert.Equal(t, "pods", po.Name())
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ func (p *PortForward) deleteCmd(evt *tcell.EventKey) *tcell.EventKey {
|
||||||
|
|
||||||
showModal(p.App().Content.Pages, fmt.Sprintf("Delete PortForward `%s?", sel), func() {
|
showModal(p.App().Content.Pages, fmt.Sprintf("Delete PortForward `%s?", sel), func() {
|
||||||
p.App().factory.DeleteForwarder(sel)
|
p.App().factory.DeleteForwarder(sel)
|
||||||
p.App().Flash().Infof("PortForward %s(%d) deleted!", sel)
|
p.App().Flash().Infof("PortForward %s deleted!", sel)
|
||||||
p.GetTable().Refresh()
|
p.GetTable().Refresh()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPortForwardNew(t *testing.T) {
|
func TestPortForwardNew(t *testing.T) {
|
||||||
po := view.NewPortForward("", "", nil)
|
po := view.NewPortForward(dao.GVR("forwards"))
|
||||||
po.Init(makeCtx())
|
po.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "PortForwards", po.Name())
|
assert.Equal(t, "PortForwards", po.Name())
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,7 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/render"
|
"github.com/derailed/k9s/internal/render"
|
||||||
"github.com/derailed/k9s/internal/resource"
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
rbacv1 "k8s.io/api/rbac/v1"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestHasVerb(t *testing.T) {
|
func TestHasVerb(t *testing.T) {
|
||||||
|
|
@ -43,74 +41,6 @@ func TestAsVerbs(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, u := range uu {
|
for _, u := range uu {
|
||||||
assert.Equal(t, u.e, asVerbs(u.vv...))
|
assert.Equal(t, u.e, asVerbs(u.vv))
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestParseRules(t *testing.T) {
|
|
||||||
ok, nok := toVerbIcon(true), toVerbIcon(false)
|
|
||||||
_ = nok
|
|
||||||
|
|
||||||
uu := []struct {
|
|
||||||
pp []rbacv1.PolicyRule
|
|
||||||
e render.Rows
|
|
||||||
}{
|
|
||||||
{
|
|
||||||
[]rbacv1.PolicyRule{
|
|
||||||
{APIGroups: []string{"*"}, Resources: []string{"*"}, Verbs: []string{"*"}},
|
|
||||||
},
|
|
||||||
render.Rows{
|
|
||||||
render.Row{Fields: render.Fields{"*.*", "*", ok, ok, ok, ok, ok, ok, ok, ok, ""}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
[]rbacv1.PolicyRule{
|
|
||||||
{APIGroups: []string{"*"}, Resources: []string{"*"}, Verbs: []string{"get"}},
|
|
||||||
},
|
|
||||||
render.Rows{
|
|
||||||
render.Row{Fields: render.Fields{"*.*", "*", ok, nok, nok, nok, nok, nok, nok, nok, ""}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
[]rbacv1.PolicyRule{
|
|
||||||
{APIGroups: []string{""}, Resources: []string{"*"}, Verbs: []string{"list"}},
|
|
||||||
},
|
|
||||||
render.Rows{
|
|
||||||
render.Row{Fields: render.Fields{"*", "v1", nok, ok, nok, nok, nok, nok, nok, nok, ""}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
[]rbacv1.PolicyRule{
|
|
||||||
{APIGroups: []string{""}, Resources: []string{"pods"}, Verbs: []string{"list"}, ResourceNames: []string{"fred"}},
|
|
||||||
},
|
|
||||||
render.Rows{
|
|
||||||
render.Row{Fields: render.Fields{"pods", "v1", nok, ok, nok, nok, nok, nok, nok, nok, ""}},
|
|
||||||
render.Row{Fields: render.Fields{"pods/fred", "v1", nok, ok, nok, nok, nok, nok, nok, nok, ""}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
[]rbacv1.PolicyRule{
|
|
||||||
{APIGroups: []string{}, Resources: []string{}, Verbs: []string{"get"}, NonResourceURLs: []string{"/fred"}},
|
|
||||||
},
|
|
||||||
render.Rows{
|
|
||||||
render.Row{Fields: render.Fields{"/fred", resource.NAValue, ok, nok, nok, nok, nok, nok, nok, nok, ""}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
[]rbacv1.PolicyRule{
|
|
||||||
{APIGroups: []string{}, Resources: []string{}, Verbs: []string{"get"}, NonResourceURLs: []string{"fred"}},
|
|
||||||
},
|
|
||||||
render.Rows{
|
|
||||||
render.Row{Fields: render.Fields{"/fred", resource.NAValue, ok, nok, nok, nok, nok, nok, nok, nok, ""}},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
var v Rbac
|
|
||||||
for _, u := range uu {
|
|
||||||
evts := v.parseRules(u.pp)
|
|
||||||
for k, v := range u.e {
|
|
||||||
assert.Equal(t, v, evts[k].Fields)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestRbacNew(t *testing.T) {
|
func TestRbacNew(t *testing.T) {
|
||||||
v := view.NewRbac("fred", view.ClusterRole, "")
|
v := view.NewRbac(dao.GVR("rbac"))
|
||||||
v.Init(makeCtx())
|
v.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "Rbac", v.Name())
|
assert.Equal(t, "Rbac", v.Name())
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import (
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/config"
|
"github.com/derailed/k9s/internal/config"
|
||||||
"github.com/derailed/k9s/internal/dao"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/resource"
|
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
|
@ -61,8 +60,6 @@ func loadCustomViewers() MetaViewers {
|
||||||
extRes(m)
|
extRes(m)
|
||||||
netRes(m)
|
netRes(m)
|
||||||
batchRes(m)
|
batchRes(m)
|
||||||
policyRes(m)
|
|
||||||
hpaRes(m)
|
|
||||||
|
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
|
@ -205,14 +202,15 @@ func batchRes(vv MetaViewers) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func policyRes(vv MetaViewers) {
|
// BOZO!!
|
||||||
vv["policy/v1beta1/poddisruptionbudgets"] = MetaViewer{
|
// func policyRes(vv MetaViewers) {
|
||||||
listFn: resource.NewPDBList,
|
// vv["policy/v1beta1/poddisruptionbudgets"] = MetaViewer{
|
||||||
}
|
// listFn: resource.NewPDBList,
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
func hpaRes(vv MetaViewers) {
|
// func autoscalingRes(vv MetaViewers) {
|
||||||
vv["autoscaling/v1/horizontalpodautoscalers"] = MetaViewer{
|
// vv["autoscaling/v1/horizontalpodautoscalers"] = MetaViewer{
|
||||||
listFn: resource.NewHorizontalPodAutoscalerV1List,
|
// listFn: resource.NewHorizontalPodAutoscalerV1List,
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestScreenDumpNew(t *testing.T) {
|
func TestScreenDumpNew(t *testing.T) {
|
||||||
po := view.NewScreenDump("fred", "blee", nil)
|
po := view.NewScreenDump(dao.GVR("screendumps"))
|
||||||
po.Init(makeCtx())
|
po.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "Screen Dumps", po.Name())
|
assert.Equal(t, "Screen Dumps", po.Name())
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/resource"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSecretNew(t *testing.T) {
|
func TestSecretNew(t *testing.T) {
|
||||||
s := view.NewSecret("secrets", "", resource.NewSecretList(nil, ""))
|
s := view.NewSecret(dao.GVR("v1/secrets"))
|
||||||
s.Init(makeCtx())
|
s.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "secrets", s.Name())
|
assert.Equal(t, "secrets", s.Name())
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/resource"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestStatefulSetNew(t *testing.T) {
|
func TestStatefulSetNew(t *testing.T) {
|
||||||
s := view.NewStatefulSet("sts", "", resource.NewStatefulSetList(nil, ""))
|
s := view.NewStatefulSet(dao.GVR("apps/v1/statefulsets"))
|
||||||
s.Init(makeCtx())
|
s.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "sts", s.Name())
|
assert.Equal(t, "sts", s.Name())
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestSubjectNew(t *testing.T) {
|
func TestSubjectNew(t *testing.T) {
|
||||||
s := view.NewSubject("subject", "", nil)
|
s := view.NewSubject(dao.GVR("subjects"))
|
||||||
s.Init(makeCtx())
|
s.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "subject", s.Name())
|
assert.Equal(t, "subject", s.Name())
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ package view_test
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/resource"
|
"github.com/derailed/k9s/internal/dao"
|
||||||
"github.com/derailed/k9s/internal/view"
|
"github.com/derailed/k9s/internal/view"
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestServiceNew(t *testing.T) {
|
func TestServiceNew(t *testing.T) {
|
||||||
s := view.NewService("service", "", resource.NewServiceList(nil, ""))
|
s := view.NewService(dao.GVR("v1/services"))
|
||||||
s.Init(makeCtx())
|
s.Init(makeCtx())
|
||||||
|
|
||||||
assert.Equal(t, "svc", s.Name())
|
assert.Equal(t, "svc", s.Name())
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ func TestTableNew(t *testing.T) {
|
||||||
render.Header{Name: "NAMESPACE"},
|
render.Header{Name: "NAMESPACE"},
|
||||||
render.Header{Name: "NAME", Align: tview.AlignRight},
|
render.Header{Name: "NAME", Align: tview.AlignRight},
|
||||||
render.Header{Name: "FRED"},
|
render.Header{Name: "FRED"},
|
||||||
render.Header{Name: "AGE", Decorator: ageDecorator},
|
render.Header{Name: "AGE", Decorator: render.AgeDecorator},
|
||||||
},
|
},
|
||||||
RowEvents: render.RowEvents{
|
RowEvents: render.RowEvents{
|
||||||
render.RowEvent{
|
render.RowEvent{
|
||||||
|
|
@ -65,7 +65,7 @@ func TestTableViewFilter(t *testing.T) {
|
||||||
render.Header{Name: "NAMESPACE"},
|
render.Header{Name: "NAMESPACE"},
|
||||||
render.Header{Name: "NAME", Align: tview.AlignRight},
|
render.Header{Name: "NAME", Align: tview.AlignRight},
|
||||||
render.Header{Name: "FRED"},
|
render.Header{Name: "FRED"},
|
||||||
render.Header{Name: "AGE", Decorator: ageDecorator},
|
render.Header{Name: "AGE", Decorator: render.AgeDecorator},
|
||||||
},
|
},
|
||||||
RowEvents: render.RowEvents{
|
RowEvents: render.RowEvents{
|
||||||
render.RowEvent{
|
render.RowEvent{
|
||||||
|
|
@ -99,7 +99,7 @@ func TestTableViewSort(t *testing.T) {
|
||||||
render.Header{Name: "NAMESPACE"},
|
render.Header{Name: "NAMESPACE"},
|
||||||
render.Header{Name: "NAME", Align: tview.AlignRight},
|
render.Header{Name: "NAME", Align: tview.AlignRight},
|
||||||
render.Header{Name: "FRED"},
|
render.Header{Name: "FRED"},
|
||||||
render.Header{Name: "AGE", Decorator: ageDecorator},
|
render.Header{Name: "AGE", Decorator: render.AgeDecorator},
|
||||||
},
|
},
|
||||||
RowEvents: render.RowEvents{
|
RowEvents: render.RowEvents{
|
||||||
render.RowEvent{
|
render.RowEvent{
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
|
|
||||||
Summary:
|
|
||||||
Total: 3.3544 secs
|
|
||||||
Slowest: 0.1031 secs
|
|
||||||
Fastest: 0.0310 secs
|
|
||||||
Average: 0.0335 secs
|
|
||||||
Requests/sec: 29.8116
|
|
||||||
|
|
||||||
Total data: 61200 bytes
|
|
||||||
Size/request: 612 bytes
|
|
||||||
|
|
||||||
Response time histogram:
|
|
||||||
0.031 [1] |
|
|
||||||
0.038 [92] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
|
|
||||||
0.045 [6] |■■■
|
|
||||||
0.053 [0] |
|
|
||||||
0.060 [0] |
|
|
||||||
0.067 [0] |
|
|
||||||
0.074 [0] |
|
|
||||||
0.081 [0] |
|
|
||||||
0.089 [0] |
|
|
||||||
0.096 [0] |
|
|
||||||
0.103 [1] |
|
|
||||||
|
|
||||||
|
|
||||||
Latency distribution:
|
|
||||||
10% in 0.0314 secs
|
|
||||||
25% in 0.0317 secs
|
|
||||||
50% in 0.0320 secs
|
|
||||||
75% in 0.0327 secs
|
|
||||||
90% in 0.0369 secs
|
|
||||||
95% in 0.0394 secs
|
|
||||||
99% in 0.1031 secs
|
|
||||||
|
|
||||||
Details (average, fastest, slowest):
|
|
||||||
DNS+dialup: 0.0001 secs, 0.0310 secs, 0.1031 secs
|
|
||||||
DNS-lookup: 0.0000 secs, 0.0000 secs, 0.0049 secs
|
|
||||||
req write: 0.0000 secs, 0.0000 secs, 0.0001 secs
|
|
||||||
resp wait: 0.0330 secs, 0.0305 secs, 0.0973 secs
|
|
||||||
resp read: 0.0005 secs, 0.0000 secs, 0.0039 secs
|
|
||||||
|
|
||||||
Status code distribution:
|
|
||||||
[200] 100 responses
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
Summary:
|
|
||||||
Total: 3.3544 secs
|
|
||||||
Slowest: 0.1031 secs
|
|
||||||
Fastest: 0.0310 secs
|
|
||||||
Average: 0.0335 secs
|
|
||||||
Requests/sec: 29.8116
|
|
||||||
|
|
||||||
Total data: 61200 bytes
|
|
||||||
Size/request: 612 bytes
|
|
||||||
|
|
||||||
Response time histogram:
|
|
||||||
0.031 [1] |
|
|
||||||
0.038 [92] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
|
|
||||||
0.045 [6] |■■■
|
|
||||||
0.053 [0] |
|
|
||||||
0.060 [0] |
|
|
||||||
0.067 [0] |
|
|
||||||
0.074 [0] |
|
|
||||||
0.081 [0] |
|
|
||||||
0.089 [0] |
|
|
||||||
0.096 [0] |
|
|
||||||
0.103 [1] |
|
|
||||||
|
|
||||||
|
|
||||||
Latency distribution:
|
|
||||||
10% in 0.0314 secs
|
|
||||||
25% in 0.0317 secs
|
|
||||||
50% in 0.0320 secs
|
|
||||||
75% in 0.0327 secs
|
|
||||||
90% in 0.0369 secs
|
|
||||||
95% in 0.0394 secs
|
|
||||||
99% in 0.1031 secs
|
|
||||||
|
|
||||||
Details (average, fastest, slowest):
|
|
||||||
DNS+dialup: 0.0001 secs, 0.0310 secs, 0.1031 secs
|
|
||||||
DNS-lookup: 0.0000 secs, 0.0000 secs, 0.0049 secs
|
|
||||||
req write: 0.0000 secs, 0.0000 secs, 0.0001 secs
|
|
||||||
resp wait: 0.0330 secs, 0.0305 secs, 0.0973 secs
|
|
||||||
resp read: 0.0005 secs, 0.0000 secs, 0.0039 secs
|
|
||||||
|
|
||||||
Status code distribution:
|
|
||||||
[200] 100 responses
|
|
||||||
[404] 2 responses
|
|
||||||
[500] 10 responses
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
|
|
||||||
Summary:
|
|
||||||
Total: 2.3688 secs
|
|
||||||
Slowest: 0.0000 secs
|
|
||||||
Fastest: 0.0000 secs
|
|
||||||
Average: NaN secs
|
|
||||||
Requests/sec: 35.4606
|
|
||||||
|
|
||||||
|
|
||||||
Response time histogram:
|
|
||||||
|
|
||||||
|
|
||||||
Latency distribution:
|
|
||||||
|
|
||||||
Details (average, fastest, slowest):
|
|
||||||
DNS+dialup: NaN secs, 0.0000 secs, 0.0000 secs
|
|
||||||
DNS-lookup: NaN secs, 0.0000 secs, 0.0000 secs
|
|
||||||
req write: NaN secs, 0.0000 secs, 0.0000 secs
|
|
||||||
resp wait: NaN secs, 0.0000 secs, 0.0000 secs
|
|
||||||
resp read: NaN secs, 0.0000 secs, 0.0000 secs
|
|
||||||
|
|
||||||
Status code distribution:
|
|
||||||
|
|
||||||
Error distribution:
|
|
||||||
[84] Get http://localhost:8081: dial tcp [::1]:8081: connect: connection refused
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
|
|
||||||
Summary:
|
|
||||||
Total: 3.3544 secs
|
|
||||||
Slowest: 0.1031 secs
|
|
||||||
Fastest: 0.0310 secs
|
|
||||||
Average: 0.0335 secs
|
|
||||||
Requests/sec: 29.8116
|
|
||||||
|
|
||||||
Total data: 61200 bytes
|
|
||||||
Size/request: 612 bytes
|
|
||||||
|
|
||||||
Response time histogram:
|
|
||||||
0.031 [1] |
|
|
||||||
0.038 [92] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
|
|
||||||
0.045 [6] |■■■
|
|
||||||
0.053 [0] |
|
|
||||||
0.060 [0] |
|
|
||||||
0.067 [0] |
|
|
||||||
0.074 [0] |
|
|
||||||
0.081 [0] |
|
|
||||||
0.089 [0] |
|
|
||||||
0.096 [0] |
|
|
||||||
0.103 [1] |
|
|
||||||
|
|
||||||
|
|
||||||
Latency distribution:
|
|
||||||
10% in 0.0314 secs
|
|
||||||
25% in 0.0317 secs
|
|
||||||
50% in 0.0320 secs
|
|
||||||
75% in 0.0327 secs
|
|
||||||
90% in 0.0369 secs
|
|
||||||
95% in 0.0394 secs
|
|
||||||
99% in 0.1031 secs
|
|
||||||
|
|
||||||
Details (average, fastest, slowest):
|
|
||||||
DNS+dialup: 0.0001 secs, 0.0310 secs, 0.1031 secs
|
|
||||||
DNS-lookup: 0.0000 secs, 0.0000 secs, 0.0049 secs
|
|
||||||
req write: 0.0000 secs, 0.0000 secs, 0.0001 secs
|
|
||||||
resp wait: 0.0330 secs, 0.0305 secs, 0.0973 secs
|
|
||||||
resp read: 0.0005 secs, 0.0000 secs, 0.0039 secs
|
|
||||||
|
|
||||||
Status code distribution:
|
|
||||||
[200] 100 responses
|
|
||||||
[204] 50 responses
|
|
||||||
[202] 10 responses
|
|
||||||
Loading…
Reference in New Issue