permaryAverage Agents per Service
    Updated 2024-11-10
    -- Service Agent Analysis
    with service_agents as (
    select
    service_id,
    f.value::number as agent_id,
    array_size(agent_ids) as agent_count
    from crosschain.olas.ez_service_registrations,
    table(flatten(agent_ids)) f
    )
    select
    count(distinct agent_id) as total_agents,
    avg(agent_count) as avg_agents_per_service,
    --MIN(agent_count) as min_agents_per_service,
    --MAX(agent_count) as max_agents_per_service,
    --MEDIAN(agent_count) as median_agents_per_service,
    -- Distribution of services by agent count
    --count(case when agent_count = 1 then 1 end) as single_agent_services,
    --count(case when agent_count > 1 then 1 end) as multi_agent_services
    from service_agents;



    QueryRunArchived: QueryRun has been archived