# List benchmark
{{$configMapBytes := DefaultParam .CL2_LIST_CONFIG_MAP_BYTES 100000}}
{{$configMapNumber := DefaultParam .CL2_LIST_CONFIG_MAP_NUMBER 10000}}
{{$configMapGroup := DefaultParam .CL2_LIST_CONFIG_MAP_GROUP "list-configmap"}}

{{$listReplicas := DefaultParam .CL2_LIST_BENCHMARK_PODS 1}}
{{$contentType := DefaultParam .CL2_LIST_BENCHMARK_CONTENT_TYPE "json"}}

name: list-benchmark
namespace:
  number: 1
tuningSets:
- name: Sequence
  parallelismLimitedLoad:
    parallelismLimit: 10
steps:
- name: Setup namespace for list benchmark pods
  phases:
  - replicasPerNamespace: 1
    tuningSet: Sequence
    objectBundle:
    - basename: list-benchmark
      objectTemplatePath: namespace.yaml
- name: Setup permissions
  phases:
  - replicasPerNamespace: 1
    tuningSet: Sequence
    objectBundle:
    - basename: list-clusterrole
      objectTemplatePath: clusterrole.yaml
  - replicasPerNamespace: 1
    tuningSet: Sequence
    objectBundle:
    - basename: list-clusterrolebinding
      objectTemplatePath: clusterrolebinding.yaml
  - namespaceRange:
      min: 1
      max: 1
    replicasPerNamespace: 1
    tuningSet: Sequence
    objectBundle:
    - basename: list-rolebinding
      objectTemplatePath: rolebinding.yaml

- name: Create configmaps
  phases:
  - namespaceRange:
      min: 1
      max: 1
    tuningSet: Sequence
    replicasPerNamespace: {{$configMapNumber}}
    objectBundle:
    - basename: {{$configMapGroup}}
      objectTemplatePath: configmap.yaml
      templateFillMap:
        bytes: {{$configMapBytes}}
        group: {{$configMapGroup}}

- module:
    path: modules/list-benchmark.yaml
    params:
      namePrefix: "list-configmaps-"
      replicas: {{$listReplicas}}
      uri: /api/v1/configmaps?resourceVersion=0
      namespaced: false
      contentType: {{$contentType}}
- module:
    path: /modules/measurements.yaml
    params:
      action: start
- name: Wait 5 minutes
  measurements:
    - Identifier: Wait
      Method: Sleep
      Params:
        duration: 5m
- module:
    path: /modules/measurements.yaml
    params:
      action: gather
- module:
    path: modules/list-benchmark.yaml
    params:
      namePrefix: "list-configmaps-"
      replicas: 0
