diff --git a/packages/system/_dev/benchmark/rally/memory-benchmark.yml b/packages/system/_dev/benchmark/rally/memory-benchmark.yml new file mode 100644 index 00000000000..436e1679ace --- /dev/null +++ b/packages/system/_dev/benchmark/rally/memory-benchmark.yml @@ -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 diff --git a/packages/system/_dev/benchmark/rally/memory-benchmark/config.yml b/packages/system/_dev/benchmark/rally/memory-benchmark/config.yml new file mode 100644 index 00000000000..c7b780eec7a --- /dev/null +++ b/packages/system/_dev/benchmark/rally/memory-benchmark/config.yml @@ -0,0 +1,35 @@ +fields: + - name: timestamp + period: -60m + - name: event_duration + range: + min: 0 + max: 100000 + - name: system_memory_used_bytes + range: + min: 8000000000 + max: 9000000000 + - 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 diff --git a/packages/system/_dev/benchmark/rally/memory-benchmark/fields.yml b/packages/system/_dev/benchmark/rally/memory-benchmark/fields.yml new file mode 100644 index 00000000000..709f320544a --- /dev/null +++ b/packages/system/_dev/benchmark/rally/memory-benchmark/fields.yml @@ -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 diff --git a/packages/system/_dev/benchmark/rally/memory-benchmark/template.ndjson b/packages/system/_dev/benchmark/rally/memory-benchmark/template.ndjson new file mode 100644 index 00000000000..3292d96d6a3 --- /dev/null +++ b/packages/system/_dev/benchmark/rally/memory-benchmark/template.ndjson @@ -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 }} + } + } + } +} \ No newline at end of file