hunk.code_window: createServerMetrics :: EKG.Store -> IO ServerMetrics
   createServerMetrics store = do
     smWarpThreads <- EKG.createGauge "warp_threads" store
     smNumEventsFetched <- EKG.createDistribution "num_events_fetched" store
     smNumEventHTTPWorkers <- EKG.createGauge "num_event_trigger_http_workers" store
     smEventLockTime <- EKG.createDistribution "event_lock_time" store
     pure ServerMetrics { .. }
hunk.labels: keep keep keep add keep keep keep keep
hunk.after_edit:   smWebsocketConnections <- EKG.createGauge "websocket_connections" store
  
hunk.file_path: server/src-lib/Hasura/Server/Init/Config.hs
hunk.type: add
file: type: bulk
  args:
  
  - type: run_sql
    args:
      sql: |
        CREATE TABLE test1 (id serial primary key);
        CREATE TABLE test2 (id serial primary key);
  
        CREATE FUNCTION get_test1(int)
          RETURNS SETOF test1 as $$
            SELECT * FROM test1 WHERE id = $1
          $$ LANGUAGE SQL STABLE;
  
        CREATE FUNCTION get_test2(int)
          RETURNS SETOF test2 as $$
            SELECT * FROM test2 WHERE id = $1
          $$ LANGUAGE SQL STABLE;
  
  - type: track_table
    args: test1
  - type: track_table
    version: 2
    args:
      table: test2
      configuration:
        custom_root_fields:
          select: test2_select
          insert: test2_insert
        custom_column_names:
          id: test2_id
  
  - type: create_object_relationship
    args:
      table: test1
      name: test2_obj1
      using:
        manual_configuration:
          remote_table: test2
          column_mapping:
            id: id
  - type: create_object_relationship
    args:
      table: test1
      name: test2_obj2
      using:
        manual_configuration:
          remote_table: test2
          column_mapping:
            id: id
  
  - type: create_array_relationship
    args:
      table: test2
      name: test1_arr1
      using:
        manual_configuration:
          remote_table: test2
          column_mapping:
            id: id
  - type: create_array_relationship
    args:
      table: test2
      name: test1_arr2
      using:
        manual_configuration:
          remote_table: test2
          column_mapping:
            id: id
  
  - type: create_select_permission
    args:
      table: test1
      role: role1
      permission:
        columns: '*'
        filter: {}
  - type: create_select_permission
    args:
      table: test1
      role: role2
      permission:
        columns: '*'
        filter: {}
  
  - type: create_insert_permission
    args:
      table: test1
      role: role1
      permission:
        check: {}
  - type: create_insert_permission
    args:
      table: test1
      role: role2
      permission:
        check: {}
  
  - type: create_update_permission
    args:
      table: test1
      role: role1
      permission:
        columns: '*'
        filter: {}
  - type: create_update_permission
    args:
      table: test1
      role: role2
      permission:
        columns: '*'
        filter: {}
  
  - type: create_delete_permission
    args:
      table: test1
      role: role1
      permission:
        filter: {}
  - type: create_delete_permission
    args:
      table: test1
      role: role2
      permission:
        filter: {}
  
  - type: create_event_trigger
    args:
      table: test1
      name: event_trigger_1
      insert:
        columns: '*'
      update:
        columns: '*'
      webhook: http://httpbin.org/post
  - type: create_event_trigger
    args:
      table: test1
      name: event_trigger_2
      insert:
        columns: '*'
      update:
        columns: '*'
      webhook: http://httpbin.org/post
  
  - type: track_function
    args: get_test1
  - type: track_function
    args: get_test2
  
  - type: create_query_collection
    args:
      name: collection_1
      definition:
        queries:
        - name: query_1
          query: |
            query {
              test1{
                id
              }
            }
        - name: query_2
          query: |
            query {
              test2{
                id
              }
            }
  
  - type: create_query_collection
    args:
      name: collection_2
      definition:
        queries:
        - name: query_1
          query: |
            query {
              get_test1(args: {id: 1}){
                id
              }
            }
        - name: query_2
          query: |
            query {
              get_test2(args: {id: 1}){
                id
              }
            }
  
  - type: add_collection_to_allowlist
    args:
      collection: collection_1
  
  - type: add_collection_to_allowlist
    args:
      collection: collection_2
  