123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- // Copyright The OpenTelemetry Authors
- // SPDX-License-Identifier: Apache-2.0
- // Package tests contains test cases. To run the tests go to tests directory and run:
- // RUN_TESTBED=1 go test -v
- package tests
- import (
- "testing"
- "github.com/open-telemetry/opentelemetry-collector-contrib/testbed/datareceivers"
- "github.com/open-telemetry/opentelemetry-collector-contrib/testbed/datasenders"
- "github.com/open-telemetry/opentelemetry-collector-contrib/testbed/testbed"
- )
- func TestLog10kDPS(t *testing.T) {
- tests := []struct {
- name string
- sender testbed.DataSender
- receiver testbed.DataReceiver
- resourceSpec testbed.ResourceSpec
- extensions map[string]string
- }{
- {
- name: "OTLP",
- sender: testbed.NewOTLPLogsDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 30,
- ExpectedMaxRAM: 120,
- },
- },
- {
- name: "OTLP-HTTP",
- sender: testbed.NewOTLPHTTPLogsDataSender(testbed.DefaultHost, testbed.GetAvailablePort(t)),
- receiver: testbed.NewOTLPHTTPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 30,
- ExpectedMaxRAM: 120,
- },
- },
- {
- name: "filelog",
- sender: datasenders.NewFileLogWriter(),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 50,
- ExpectedMaxRAM: 120,
- },
- },
- {
- name: "filelog checkpoints",
- sender: datasenders.NewFileLogWriter(),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 50,
- ExpectedMaxRAM: 120,
- },
- extensions: datasenders.NewLocalFileStorageExtension(),
- },
- {
- name: "kubernetes containers",
- sender: datasenders.NewKubernetesContainerWriter(),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 110,
- ExpectedMaxRAM: 150,
- },
- },
- {
- name: "k8s CRI-Containerd",
- sender: datasenders.NewKubernetesCRIContainerdWriter(),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 100,
- ExpectedMaxRAM: 150,
- },
- },
- {
- name: "k8s CRI-Containerd no attr ops",
- sender: datasenders.NewKubernetesCRIContainerdNoAttributesOpsWriter(),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 100,
- ExpectedMaxRAM: 150,
- },
- },
- {
- name: "CRI-Containerd",
- sender: datasenders.NewCRIContainerdWriter(),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 100,
- ExpectedMaxRAM: 150,
- },
- },
- {
- name: "syslog-tcp-batch-1",
- sender: datasenders.NewTCPUDPWriter("tcp", testbed.DefaultHost, testbed.GetAvailablePort(t), 1),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 80,
- ExpectedMaxRAM: 150,
- },
- },
- {
- name: "syslog-tcp-batch-100",
- sender: datasenders.NewTCPUDPWriter("tcp", testbed.DefaultHost, testbed.GetAvailablePort(t), 100),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 80,
- ExpectedMaxRAM: 150,
- },
- },
- {
- name: "FluentForward-SplunkHEC",
- sender: datasenders.NewFluentLogsForwarder(t, testbed.GetAvailablePort(t)),
- receiver: datareceivers.NewSplunkHECDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 60,
- ExpectedMaxRAM: 150,
- },
- },
- {
- name: "tcp-batch-1",
- sender: datasenders.NewTCPUDPWriter("tcp", testbed.DefaultHost, testbed.GetAvailablePort(t), 1),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 80,
- ExpectedMaxRAM: 150,
- },
- },
- {
- name: "tcp-batch-100",
- sender: datasenders.NewTCPUDPWriter("tcp", testbed.DefaultHost, testbed.GetAvailablePort(t), 100),
- receiver: testbed.NewOTLPDataReceiver(testbed.GetAvailablePort(t)),
- resourceSpec: testbed.ResourceSpec{
- ExpectedMaxCPU: 80,
- ExpectedMaxRAM: 150,
- },
- },
- }
- processors := map[string]string{
- "batch": `
- batch:
- `,
- }
- for _, test := range tests {
- t.Run(test.name, func(t *testing.T) {
- Scenario10kItemsPerSecond(
- t,
- test.sender,
- test.receiver,
- test.resourceSpec,
- performanceResultsSummary,
- processors,
- test.extensions,
- )
- })
- }
- }
|