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

Enable Add-On resource usage metrics gathering in scalability tests #17770

Merged
merged 1 commit into from
Nov 27, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion hack/jenkins/e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,8 @@ case ${JOB_NAME} in
kubernetes-e2e-gce-scalability)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-scalability"}
: ${E2E_NETWORK:="e2e-scalability"}
: ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Performance\]"}
: ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Performance\] \
--gather-resource-usage=true"}
: ${KUBE_GCE_INSTANCE_PREFIX:="e2e-scalability"}
: ${PROJECT:="kubernetes-jenkins"}
# Override GCE defaults.
Expand Down
7 changes: 3 additions & 4 deletions test/e2e/density.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ var _ = Describe("Density [Skipped]", func() {
var ns string
var uuid string

framework := NewFramework("density")
framework.NamespaceDeletionTimeout = time.Hour

// Gathers data prior to framework namespace teardown
AfterEach(func() {
// Remove any remaining pods from this test if the
Expand Down Expand Up @@ -110,10 +113,6 @@ var _ = Describe("Density [Skipped]", func() {
Expect(highLatencyRequests).NotTo(BeNumerically(">", 0), "There should be no high-latency requests")
})

framework := NewFramework("density")
framework.NamespaceDeletionTimeout = time.Hour
framework.GatherKubeSystemResourceUsageData = testContext.GatherKubeSystemResourceUsageData

BeforeEach(func() {
c = framework.Client
ns = framework.Namespace.Name
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func init() {
flag.BoolVar(&testContext.VerifyServiceAccount, "e2e-verify-service-account", true, "If true tests will verify the service account before running.")
flag.BoolVar(&testContext.DeleteNamespace, "delete-namespace", true, "If true tests will delete namespace after completion. It is only designed to make debugging easier, DO NOT turn it off by default.")
flag.BoolVar(&testContext.CleanStart, "clean-start", false, "If true, purge all namespaces except default and system before running tests. This serves to cleanup test namespaces from failed/interrupted e2e runs in a long-lived cluster.")
flag.BoolVar(&testContext.GatherKubeSystemResourceUsageData, "gather-resource-usage", true, "If set to true framework will be monitoring resource usage of system add-ons in (some) e2e tests.")
flag.BoolVar(&testContext.GatherKubeSystemResourceUsageData, "gather-resource-usage", false, "If set to true framework will be monitoring resource usage of system add-ons in (some) e2e tests.")
}

func TestE2E(t *testing.T) {
Expand Down
9 changes: 3 additions & 6 deletions test/e2e/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ type Framework struct {
Client *client.Client
NamespaceDeletionTimeout time.Duration

// If set to true framework will start a goroutine monitoring resource usage of system add-ons.
// It will read the data every 30 seconds from all Nodes and print summary during afterEach.
GatherKubeSystemResourceUsageData bool
gatherer containerResourceGatherer
gatherer containerResourceGatherer
}

// NewFramework makes a new framework and sets up a BeforeEach/AfterEach for
Expand Down Expand Up @@ -81,7 +78,7 @@ func (f *Framework) beforeEach() {
Logf("Skipping waiting for service account")
}

if f.GatherKubeSystemResourceUsageData {
if testContext.GatherKubeSystemResourceUsageData {
f.gatherer.startGatheringData(c, time.Minute)
}
}
Expand Down Expand Up @@ -125,7 +122,7 @@ func (f *Framework) afterEach() {
Logf("Found DeleteNamespace=false, skipping namespace deletion!")
}

if f.GatherKubeSystemResourceUsageData {
if testContext.GatherKubeSystemResourceUsageData {
f.gatherer.stopAndPrintData([]int{50, 90, 99, 100})
}
// Paranoia-- prevent reuse!
Expand Down
34 changes: 18 additions & 16 deletions test/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,24 @@ type CloudConfig struct {
}

type TestContextType struct {
KubeConfig string
KubeContext string
CertDir string
Host string
RepoRoot string
Provider string
CloudConfig CloudConfig
KubectlPath string
OutputDir string
prefix string
MinStartupPods int
UpgradeTarget string
PrometheusPushGateway string
VerifyServiceAccount bool
DeleteNamespace bool
CleanStart bool
KubeConfig string
KubeContext string
CertDir string
Host string
RepoRoot string
Provider string
CloudConfig CloudConfig
KubectlPath string
OutputDir string
prefix string
MinStartupPods int
UpgradeTarget string
PrometheusPushGateway string
VerifyServiceAccount bool
DeleteNamespace bool
CleanStart bool
// If set to true framework will start a goroutine monitoring resource usage of system add-ons.
// It will read the data every 30 seconds from all Nodes and print summary during afterEach.
GatherKubeSystemResourceUsageData bool
}

Expand Down