{% set p_pre_filter_shard_size = (pre_filter_shard_size | default(1)) %}
{% set p_bulk_idx_iterations = (bulk_indexing_iterations | default(30000)) %}
{% set p_query_iterations = (query_iterations | default(3)) %}

{
  "name": "frozen-data-generation",
  "description": "Index approximately 50GB of data into an index with with 2 primary shards. IDs are autogenerated by Elasticsearch, meaning there are no conflicts.",
  "schedule": [
    {
      "operation": "deleteindex_elasticlogs"
    },
    {
      "operation": "delete-index-template"
    },
    {
      "operation": {
        "operation-type": "create-index-template",
        "settings": {
          "index.store.type": "hybridfs"
        }
      }
    },
    {
      "name": "index-append-1000-datagen",
      "operation": {
        "name": "index-append-1000-datagen-20180102",
        "operation-type": "bulk",
        "param-source": "elasticlogs_bulk",
        "index": "elasticlogs",
        "bulk-size": 1000,
        "record_raw_event_size": {{p_record_raw_event_size}}
      },
      "iterations": {{p_bulk_idx_iterations}},
      "clients": 8
    },
    {
      "operation": {
        "operation-type": "force-merge",
        "include-in-reporting": true,
        "max-num-segments": 1,
        "request-timeout": 360000
      }
    }
  ]
},
{
  "name": "frozen-querying",
  "description": "Frozen node querying.",
  "schedule": [
    {
      "operation": {
        "operation-type": "cluster-health",
        "request-params": {
          "wait_for_status": "green"
        }
      }
    },
    {
      "name": "clear-caches",
      "operation": {
        "operation-type": "raw-request",
        "method": "POST",
        "path": "/_cache/clear"
      },
      "iterations": 1,
      "clients": 1
    },
    {
      "operation": {
        "operation-type": "fieldstats",
        "index_pattern": "elasticlogs*",
        "ignore_throttled": false
      },
      "iterations": 1,
      "clients": 1
    },
    {
      "name": "kibana-discover-ip-25%",
      "operation": {
        "operation-type": "kibana",
        "param-source": "elasticlogs_kibana",
        "debug": {{p_verbose}},
        "dashboard": "discover",
        "index_pattern": "elasticlogs*",
        "query_string": "query_string_lists/uncommon_ip_query_strings.json",
        "ignore_throttled": false,
        "window_end": "START+25%,END",
        "window_length": "25%",
        "pre_filter_shard_size": {{ p_pre_filter_shard_size }}
      },
      "iterations": {{ p_query_iterations }},
      "clients": 1
    },
    {
      "name": "kibana-content_issues-ip-25%",
      "operation": {
        "operation-type": "kibana",
        "param-source": "elasticlogs_kibana",
        "debug": {{p_verbose}},
        "dashboard": "content_issues",
        "index_pattern": "elasticlogs*",
        "query_string": "query_string_lists/uncommon_ip_query_strings.json",
        "ignore_throttled": false,
        "window_end": "START+25%,END",
        "window_length": "25%",
        "pre_filter_shard_size": {{ p_pre_filter_shard_size }}
      },
      "iterations": {{ p_query_iterations }},
      "clients": 1
    }
  ]
}
