{
  "GlobalSettings": {
    "type": "dynamic"
  },
  "vectors": [
    {
      "URL": "$BaseURL.snowflakecomputing.com/api/v2/statements",
      "URLSetting": {
        "requestType": "post",
        "requestBody": "%7B%0A%20%20%22statement%22%3A%20%22SELECT%20CURRENT_ORGANIZATION_NAME()%20AS%20org%2C%20CURRENT_REGION()%20AS%20reg%2C%20CURRENT_ACCOUNT_NAME()%20AS%20acc%2C%20WAREHOUSE_NAME%2C%20DATABASE_NAME%2C%20SCHEMA_NAME%2C%20COUNT(CASE%20WHEN%20EXECUTION_STATUS%20%3D%20%27SUCCESS%27%20THEN%201%20END)%20AS%20SUCCESSFUL_QUERIES%2C%20COUNT(CASE%20WHEN%20EXECUTION_STATUS%20%3D%20%27FAIL%27%20THEN%201%20END)%20AS%20UNSUCCESSFUL_QUERIES%2C%20AVG(EXECUTION_TIME)%20AS%20avg_execution_time%2C%20AVG(COMPILATION_TIME)%20AS%20avg_compilation_time%2C%20AVG(BYTES_SCANNED)%20AS%20avg_bytes_scanned%2C%20AVG(BYTES_WRITTEN)%20AS%20avg_bytes_written%2C%20AVG(BYTES_DELETED)%20AS%20avg_bytes_deleted%2C%20COUNT(CASE%20WHEN%20TRANSACTION_BLOCKED_TIME%20%3E%200%20THEN%201%20END)%20AS%20blocked_count%2C%20COUNT(CASE%20WHEN%20QUEUED_PROVISIONING_TIME%20%3E%200%20THEN%201%20END)%20AS%20queued_provision_count%2C%20AVG(CASE%20WHEN%20QUEUED_OVERLOAD_TIME%20%3E%200%20THEN%201%20END)%20AS%20queued_overload_count%2C%20AVG(BYTES_SPILLED_TO_LOCAL_STORAGE)%20AS%20avg_bytes_transferred_local%2C%20SUM(BYTES_SPILLED_TO_LOCAL_STORAGE)%20AS%20sum_bytes_transferred_local%2C%20AVG(BYTES_SPILLED_TO_REMOTE_STORAGE)%20AS%20avg_bytes_transferred_remote%2C%20SUM(BYTES_SPILLED_TO_REMOTE_STORAGE)%20AS%20sum_bytes_transferred_remote%20FROM%20SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY%20WHERE%20DATE_PART(%27EPOCH_MILLISECOND%27%2C%20start_time)%20%3E%3D%20%7B%24start_time%7D%20GROUP%20BY%20WAREHOUSE_NAME%2C%20DATABASE_NAME%2C%20SCHEMA_NAME%3B%22%2C%0A%20%20%22timeout%22%3A%2060%2C%0A%20%20%22warehouse%22%3A%20%22COMPUTE_WH%22%0A%7D",
        "requestHeaders": [
          "Authorization:Bearer $AuthToken",
          "Accept:application/json",
          "Content-Type:application/json",
          "X-Snowflake-Authorization-Token-Type:KEYPAIR_JWT"
        ]
      },
      "metrics": [
        {
          "mPath": "$.data[*]",
          "attribute": [
            {
              "name": "[6]",
              "index": 1,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[7]",
              "index": 2,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[8]",
              "index": 3,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[9]",
              "index": 4,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[10]",
              "index": 5,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[11]",
              "index": 6,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[12]",
              "index": 7,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[13]",
              "index": 8,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[14]",
              "index": 9,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[15]",
              "index": 10,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[16]",
              "index": 11,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[17]",
              "index": 12,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[18]",
              "index": 13,
              "operation": "none",
              "type": 1
            },
            {
              "name": "[19]",
              "index": 14,
              "operation": "none",
              "type": 1
            }
          ]
        }
      ],
      "path": [
        {
          "isPartOfHierarchy": true,
          "query": "$.data[*][0]",
          "replaceVectorKey": "Organization_Name",
          "defName": "Unknown Organization"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.data[*][1]",
          "replaceVectorKey": "Region_Name",
          "defName": "Unknown Region"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.data[*][2]",
          "replaceVectorKey": "Account_Name",
          "defName": "Unknown Account"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.data[*][3]",
          "replaceVectorKey": "Warehouse_Name",
          "defName": "Unknown Warehouse"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.data[*][4]",
          "replaceVectorKey": "Database_Name",
          "defName": "Unknown Database"
        },
        {
          "isPartOfHierarchy": true,
          "query": "$.data[*][5]",
          "replaceVectorKey": "Schema_Name",
          "defName": "Unknown Schema"
        }
      ]
    }
  ]
}
