kubernetes/test/integration/logs/benchmark
Vinay Kulkarni 76962b0fa7 In-place Pod Vertical Scaling - API changes
1. Define ContainerResizePolicy and add it to Container struct.
 2. Add ResourcesAllocated and Resources fields to ContainerStatus struct.
 3. Define ResourcesResizeStatus and add it to PodStatus struct.
 4. Add InPlacePodVerticalScaling feature gate and drop disabled fields.
 5. ResizePolicy validation & defaulting and Resources mutability for CPU/Memory.
 6. Various fixes from code review feedback (originally committed on Apr 12, 2022)
KEP: /enhancements/keps/sig-node/1287-in-place-update-pod-resources
2023-02-24 17:18:04 +00:00
..
contextual-logging logs: add micro benchmarks for argument passing 2022-05-31 08:07:37 +02:00
data Move from k8s.gcr.io to registry.k8s.io 2022-05-31 10:16:53 -04:00
benchmark_test.go k8s.io/component-base/logs: allow overriding os.Stdout and os.Stderr 2023-01-17 10:25:57 +01:00
common_test.go logs: make LoggingConfiguration an unversioned API 2022-06-17 20:22:13 +02:00
load_test.go In-place Pod Vertical Scaling - API changes 2023-02-24 17:18:04 +00:00
load.go
README.md

Benchmarking logging

Any major changes to the logging code, whether it is in Kubernetes or in klog, must be benchmarked before and after the change.

Running the benchmark

$ go test -bench=. -test.benchmem -benchmem .

Real log data

The files under data define test cases for specific aspects of formatting. To test with a log file that represents output under some kind of real load, copy the log file into data/<file name>.log and run benchmarking as described above. -bench=BenchmarkLogging/<file name without .log suffix> can be used to benchmark just the new file.

When using data/v<some number>/<file name>.log, formatting will be done at that log level. Symlinks can be created to simulating writing of the same log data at different levels.

No such real data is included in the Kubernetes repo because of their size. They can be found in the "artifacts" of this https://testgrid.kubernetes.io/sig-instrumentation-tests#kind-json-logging-master Prow job:

  • artifacts/logs/kind-control-plane/containers
  • artifacts/logs/kind-*/kubelet.log

With sufficient credentials, gsutil can be used to download everything for a job with:

gsutil -m cp -R gs://kubernetes-jenkins/logs/ci-kubernetes-kind-e2e-json-logging/<job ID> .

Analyzing log data

While loading a file, some statistics about it are collected. Those are shown when running with:

$ go test -v -bench=. -test.benchmem -benchmem .