Skip to content

Commit

Permalink
Index standalone benchmarks results + revert local changes
Browse files Browse the repository at this point in the history
  • Loading branch information
1pkg committed Sep 14, 2024
1 parent cbac449 commit 7bd059a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,18 @@ jobs:
if: ${{ inputs.benchmarkAgents != '' }}
run: make run-benchmark

- name: Cat APM Server logs
if: failure()
- name: Cat standalone server logs
if: ${{ inputs.runStandalone && failure() }}
run: make cat-apm-server-logs

# Results are only indexed and uploaded if the run happens on the main branch.

- name: Index benchmarks result
if: github.ref == 'refs/heads/main'
# if: github.ref == 'refs/heads/main'
run: make index-benchmark-results

- name: Download PNG
if: github.ref == 'refs/heads/main'
# if: github.ref == 'refs/heads/main'
run: >-
${{ github.workspace }}/.ci/scripts/download-png-from-kibana.sh
${{ secrets.KIBANA_BENCH_ENDPOINT }}
Expand All @@ -162,15 +162,15 @@ jobs:
$PNG_REPORT_FILE
- name: Upload PNG
if: github.ref == 'refs/heads/main'
# if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: kibana-png-report
path: ${{ env.WORKING_DIRECTORY }}/${{ env.PNG_REPORT_FILE }}
if-no-files-found: error

- name: Upload PNG to AWS S3
if: github.ref == 'refs/heads/main'
# if: github.ref == 'refs/heads/main'
id: s3-upload-png
env:
AWS_DEFAULT_REGION: us-east-1
Expand All @@ -180,7 +180,7 @@ jobs:
echo "png_report_url=https://elastic-apm-server-benchmark-reports.s3.amazonaws.com/${DEST_NAME}" >> "$GITHUB_OUTPUT"
- name: Upload benchmark result
if: github.ref == 'refs/heads/main'
# if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: benchmark-result
Expand Down
7 changes: 1 addition & 6 deletions systemtest/benchtest/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,7 @@ func (p *profiles) recordCPU() error {
if benchConfig.CPUProfile == "" {
return nil
}
// Limit the CPU profile collection to static 1 minute interval per a benchmark.
// Otherwise the profile will be too heavy and over influenced by the "longest" benchmark.
duration := time.Minute
if duration > benchConfig.Benchtime {
duration = benchConfig.Benchtime
}
duration := benchConfig.Benchtime
profile, err := fetchProfile("/debug/pprof/profile", duration)
if err != nil {
return fmt.Errorf("failed to fetch CPU profile: %w", err)
Expand Down
1 change: 0 additions & 1 deletion systemtest/cmd/moxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func handler(logger *zap.Logger, username, password string) http.Handler {
w.Header().Set("X-Elastic-Product", "Elasticsearch")
switch r.URL.Path {
case "/":
// MIS doesn't use this route, but apm-server checks for cluster_uuid
w.Write([]byte(`{
"name": "instance-0000000001",
"cluster_name": "eca3b3c3bbee4816bb92f82184e328dd",
Expand Down
10 changes: 10 additions & 0 deletions testing/benchmark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ MOXY_GOARCH ?= amd64
APM_SERVER_GOOS ?= linux
APM_SERVER_GOARCH ?= amd64

RUN_STANDALONE ?= false

TFVARS_SOURCE ?= terraform.tfvars.example

BENCHMARK_WARMUP_TIME ?= 5m
Expand Down Expand Up @@ -127,13 +129,21 @@ index-benchmark-results: _default-gobench-vars

.PHONY: _default-gobench-vars
_default-gobench-vars:
ifeq ($(RUN_STANDALONE),true)
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),apm_server_size=$(shell echo var.standalone_apm_server_instance_size | terraform console | tr -d '"'))
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),moxy_size=$(shell echo var.standalone_moxy_instance_size | terraform console | tr -d '"'))
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),build_sha=$(shell git rev-parse HEAD))
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),bench_mode=standalone)
else
# TODO(marclop) Update code below to use a foor loop, rather than copying the lines.
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),apm_server_size=$(shell echo var.apm_server_size | terraform console | tr -d '"'))
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),elasticsearch_size=$(shell echo var.elasticsearch_size | terraform console | tr -d '"'))
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),stack_version=$(shell echo var.stack_version | terraform console | tr -d '"'))
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),apm_server_zone_count=$(shell echo var.apm_server_zone_count | terraform console | tr -d '"'))
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),elasticsearch_zone_count=$(shell echo var.elasticsearch_zone_count | terraform console | tr -d '"'))
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),build_sha=$(shell curl -sL -H "Authorization: Bearer $(shell terraform output -raw apm_secret_token )" $(shell terraform output -raw apm_server_url ) | jq -r '.build_sha'))
$(eval GOBENCH_DEFAULT_TAGS = $(GOBENCH_DEFAULT_TAGS),bench_mode=cloud)
endif

.PHONY: cat-apm-server-logs
cat-apm-server-logs:
Expand Down
4 changes: 1 addition & 3 deletions testing/benchmark/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ module "tags" {
project = startswith(var.user_name, "benchci") ? "benchmarks" : var.user_name
}

provider "ec" {
apikey = "aaa"
}
provider "ec" {}

provider "aws" {
region = var.worker_region
Expand Down
3 changes: 1 addition & 2 deletions testing/benchmark/variables.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
## General configuration

variable "user_name" {
default = "test-kostya-vpc-bench-apm"
description = "Required username to use for prefixes"
type = string
}

variable "run_standalone" {
default = true
default = false
description = "If set run benchmarks against standalone APM Server conneted to moxy"
type = bool
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ locals {
"debian-10-arm64" = "136693071363" # debian
"debian-11-arm64" = "136693071363" # debian
"amzn2-ami-kernel-5.10" = "137112412989" # amazon
"amzn2-ami-hvm-*-x86_64-ebs" = "137112412989" #amazon
"amzn2-ami-hvm-*-x86_64-ebs" = "137112412989" # amazon
"al2023-ami-2023" = "137112412989" # amazon
"RHEL-7" = "309956199498" # Red Hat
"RHEL-8" = "309956199498" # Red Hat
Expand Down

0 comments on commit 7bd059a

Please sign in to comment.