apiVersion: theodolite.com/v1
kind: benchmark
metadata:
  name: uc1-beam-samza
spec:
  sut:
    resources:
      - configMap:
          name: "benchmark-resources-uc1-beam-samza"
          files:
          - "uc1-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-uc2-application-1"]
          timeoutSeconds: 60
  loadGenerator:
    resources:
      - configMap:
          name: "benchmark-resources-uc1-load-generator"
          files:
          - "uc1-load-generator-deployment.yaml"
          - "uc1-load-generator-service.yaml"
  resourceTypes:
    - typeName: "Instances"
      patchers:
        - type: "ReplicaPatcher"
          resource: "uc1-beam-samza-deployment.yaml"
  loadTypes:
    - typeName: "NumSensors"
      patchers:
        - type: "EnvVarPatcher"
          resource: "uc1-load-generator-deployment.yaml"
          properties:
            container: "workload-generator"
            variableName: "NUM_SENSORS"
        - type: NumSensorsLoadGeneratorReplicaPatcher
          resource: "uc1-load-generator-deployment.yaml"
          properties:
            loadGenMaxRecords: "150000"
  kafkaConfig:
    bootstrapServer: "theodolite-cp-kafka:9092"
    topics:
      - name: "input"
        numPartitions: 40
        replicationFactor: 1
      - name: ".*samza.*"
        removeOnly: true
      - name: ".*uc1-application.*"
        removeOnly: true