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

[O11y][System] Rally benchmark system.memory #9296

Merged
merged 3 commits into from
Mar 25, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/system/_dev/benchmark/rally/memory-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: Benchmark 20000 system.memory events ingested
data_stream:
name: memory
corpora:
generator:
total_events: 20000
template:
type: gotext
path: ./memory-benchmark/template.ndjson
config:
path: ./memory-benchmark/config.yml
fields:
path: ./memory-benchmark/fields.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
fields:
- name: timestamp
period: -60m
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why - is prefixed?

Copy link
Contributor Author

@ali786XI ali786XI Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in reference to this doc
https://github.com/elastic/elastic-integration-corpus-generator-tool/blob/main/docs/fields-configuration.md#:~:text=generator%20will%20stop.-,period,-optional%20(date
It would always generate documents before time.Now() so that the events would always be available in Last duration in Discover

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

- name: event_duration
range:
min: 0
max: 100000
- name: system_memory_used_bytes
range:
min: 8000000000
max: 9000000000
Comment on lines +10 to +11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How these ranges contribute to the benchmark? If I tune these parameters, will the result change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These ranges just provide you the liberty to set fields with realistic values. Like for example here the values are correlated with each other. If you see the system_memory_actual_used_bytes ranges compared to this they would be lesser which will be the case in real environments as well. Modifying these wouldn't change the benchmarking stats.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

- name: system_memory_cached
range:
min: 1000000000
max: 2000000000
- name: system_memory_free
range:
min: 2000000000
max: 3000000000
- name: system_memory_actual_used_bytes
range:
min: 5000000000
max: 7000000000
- name: system_memory_actual_free
range:
min: 3000000000
max: 5000000000
- name: system_memory_swap_used_bytes
range:
min: 300000000
max: 500000000
- name: system_memory_swap_free
range:
min: 3000000000
max: 4000000000
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- name: timestamp
type: date
- name: event_duration
type: long
- name: system_memory_used_bytes
type: long
- name: system_memory_free
type: long
- name: system_memory_cached
type: long
- name: system_memory_actual_used_bytes
type: long
- name: system_memory_actual_free
type: long
- name: system_memory_swap_used_bytes
type: long
- name: system_memory_swap_free
type: long
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{{- $event_duration := generate "event_duration" }}
{{- $timestamp := generate "timestamp" }}
{{- $system_memory_used_bytes := generate "system_memory_used_bytes" }}
{{- $system_memory_free := generate "system_memory_free" }}
{{- $system_memory_cached := generate "system_memory_cached" }}
{{- $system_memory_actual_used_bytes := generate "system_memory_actual_used_bytes" }}
{{- $system_memory_actual_free := generate "system_memory_actual_free" }}
{{- $system_memory_actual_sum := add $system_memory_actual_used_bytes $system_memory_actual_free }}
{{- $system_memory_swap_used_bytes := generate "system_memory_swap_used_bytes" }}
{{- $system_memory_swap_free := generate "system_memory_swap_free" }}
{{- $system_memory_swap_total := add $system_memory_swap_free $system_memory_swap_used_bytes }}
{{- $system_memory_swap_used_pct := divf $system_memory_swap_used_bytes $system_memory_swap_total }}
{{- $system_memory_total := add $system_memory_used_bytes $system_memory_free }}
{{- $system_memory_used_pct := divf $system_memory_used_bytes $system_memory_total }}
{
"@timestamp": "{{ $timestamp.Format "2006-01-02T15:04:05.000Z07:00" }}",
"agent": {
"ephemeral_id": "22ed892c-43bd-408a-9121-65e2f5b6a56e",
"id": "de42127b-4db8-4471-824e-a7b14f478663",
"name": "system-scale-123456",
"type": "metricbeat",
"version": "8.8.0"
},
"data_stream": {
"dataset": "system.memory",
"namespace": "ep",
"type": "metrics"
},
"ecs": {
"version": "8.0.0"
},
"elastic_agent": {
"id": "404fc805-04b8-420a-9fcf-12d54b89d4fd",
"snapshot": false,
"version": "8.12.1"
},
"event": {
"agent_id_status": "verified",
"dataset": "system.memory",
"duration": {{ $event_duration }},
"module": "system"
},
"host": {
"architecture": "x86_64",
"containerized": true,
"hostname": "docker-fleet-agent",
"id": "96bd755dd266474fb86bd80a98cbaad5",
"ip": "192.168.241.7",
"mac": "02-42-C0-A8-F1-07",
"name": "docker-fleet-agent",
"os": {
"codename": "focal",
"family": "debian",
"kernel": "3.10.0-1160.105.1.el7.x86_64",
"name": "Ubuntu",
"platform": "ubuntu",
"type": "linux",
"version": "20.04.6 LTS (Focal Fossa)"
}
},
"metricset": {
"name": "memory",
"period": 10000
},
"service": {
"type": "system"
},
"system": {
"memory": {
"actual": {
"free": {{ $system_memory_actual_free }},
"used": {
"bytes": {{ $system_memory_actual_used_bytes }},
"pct": {{ divf $system_memory_actual_used_bytes $system_memory_actual_sum }}
}
},
"cached": {{ $system_memory_cached }},
"free": {{ $system_memory_free }},
"swap": {
"free": {{ $system_memory_swap_free }},
"total": {{ $system_memory_swap_total }},
"used": {
"bytes": {{ $system_memory_swap_used_bytes }},
"pct": {{ $system_memory_swap_used_pct }}
}
},
"total": {{ $system_memory_total }},
"used": {
"bytes": {{ $system_memory_used_bytes }},
"pct": {{ $system_memory_used_pct }}
}
}
}
}