apiVersion: theodolite.com/v1
kind: benchmark
metadata:
  name: uc3-beam-samza
spec:
  sut:
    resources:
      - configMap:
          name: "benchmark-resources-uc3-beam-samza"
          files:
          - "uc3-beam-samza-deployment.yaml"
          - "beam-samza-service.yaml"
          - "service-monitor.yaml"
    afterActions:
      - selector: # delete zookeeper nodes to reset zookeeper
          pod:
            matchLabels:
              app: "cp-zookeeper"
          container: "cp-zookeeper-server"
        exec:
          command: ["zookeeper-shell", "localhost:2181",
           "deleteall", "/app-theodolite-uc3-application-1"]
          timeoutSeconds: 60
  loadGenerator:
    resources:
      - configMap:
          name: "benchmark-resources-uc3-load-generator"
          files:
          - "uc3-load-generator-deployment.yaml"
          - "uc3-load-generator-service.yaml"
  resourceTypes:
    - typeName: "Instances"
      patchers:
        - type: "ReplicaPatcher"
          resource: "uc3-beam-samza-deployment.yaml"
  loadTypes:
    - typeName: "NumSensors"
      patchers:
        - type: "EnvVarPatcher"
          resource: "uc3-load-generator-deployment.yaml"
          properties:
            container: "workload-generator"
            variableName: "NUM_SENSORS"
        - type: NumSensorsLoadGeneratorReplicaPatcher
          resource: "uc3-load-generator-deployment.yaml"
          properties:
            loadGenMaxRecords: "150000"
  kafkaConfig:
    bootstrapServer: "theodolite-kafka-kafka-bootstrap:9092"
    topics:
      - name: "input"
        numPartitions: 40
        replicationFactor: 1
      - name: "output"
        numPartitions: 40
        replicationFactor: 1
      - name: ".*samza.*"
        removeOnly: true
      - name: ".*uc3-application.*"
        removeOnly: true