<% set host = host|default("ASEARCH") %>
<% set ctype = ctype|default("experiment, prestable, prod") %>
<% set geo = geo|default("man, sas, vla") %>

<% set benigh_recv_conn_errors = [
    "NO_ERROR",
    "PROTOCOL_ERROR_Failed_ping",
    "PROTOCOL_ERROR_Error_102_reading_from_socket",
    "INTERNAL_ERROR",
] %>
<% set recv_conn_errors = [
    "PROTOCOL_ERROR",
    "FLOW_CONTROL_ERROR",
    "SETTINGS_TIMEOUT",
    "STREAM_CLOSED",
    "FRAME_SIZE_ERROR",
    "COMPRESSION_ERROR",
    "ENHANCE_YOUR_CALM",
    "INADEQUATE_SECURITY",
    "HTTP_1_1_REQUIRED",
    "UNKNOWN",
] %>

<% set benigh_send_conn_errors = [
    "NO_ERROR",
] %>
<% set send_conn_errors = [
    "PROTOCOL_ERROR",
    "INTERNAL_ERROR",
    "FLOW_CONTROL_ERROR",
    "STREAM_CLOSED",
    "FRAME_SIZE_ERROR",
    "COMPRESSION_ERROR",
    "UNKNOWN",
] %>

<% set benigh_recv_stream_errors = [
    "NO_ERROR",
    "PROTOCOL_ERROR_after_CANCEL",
    "INTERNAL_ERROR",
    "STREAM_CLOSED",
    "REFUSED_STREAM",
    "CANCEL",
    "CONNECT_ERROR",
] %>
<% set recv_stream_errors = [
    "PROTOCOL_ERROR",
    "FLOW_CONTROL_ERROR",
    "ENHANCE_YOUR_CALM",
    "UNKNOWN",
] %>

<% set benigh_send_stream_errors = [
    "NO_ERROR",
    "INTERNAL_ERROR",
    "STREAM_CLOSED",
    "REFUSED_STREAM",
    "CONNECT_ERROR",
] %>
<% set send_stream_errors = [
    "PROTOCOL_ERROR",
    "FLOW_CONTROL_ERROR",
    "ENHANCE_YOUR_CALM",
    "UNKNOWN",
] %>
{
    "title": "<<prj>> <<geo>> <<ctype>> balancer h2 stats",
    "type": "panel",
    "charts": [
        {
            "type": "graphic",
            "title": "h1 conn stats",
            "normalize": true,
            "width": 2,
            "height": 1,
            "col": 1,
            "signals": [
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-h1_conn_*_summ"
                }
            ],
            "consts": []
        },
        {
            "type": "graphic",
            "title": "h2 conn stats",
            "normalize": true,
            "width": 2,
            "height": 1,
            "row": 2,
            "col": 1,
            "signals": [
                <% for error in benigh_recv_conn_errors %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-go_away_recv-<<error>>_summ"
                },
                <% endfor %>
                <% for error in benigh_send_conn_errors %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-go_away_send-<<error>>_summ"
                },
                <% endfor %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-h2_conn_*_summ"
                }
            ],
            "consts": []
        },
        {
            "type": "graphic",
            "title": "h2 stream stats",
            "normalize": true,
            "width": 2,
            "height": 1,
            "row": 3,
            "col": 1,
            "signals": [
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-stream_*_open_summ"
                },
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-end_stream_*_summ"
                },
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-stream_dispose_summ"
                }
            ],
            "consts": []
        },
        {
            "type": "graphic",
            "width": 2,
            "height": 1,
            "row": 1,
            "col": 3,
            "title": "connection errors",
            "normalize": true,
            "signals": [
                <% for error in recv_conn_errors %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-go_away_recv-<<error>>_summ"
                },
                <% endfor %>
                <% for error in send_conn_errors %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-go_away_send-<<error>>_summ"
                },
                <% endfor %>
            ],
            "consts": []
        },
        {
            "type": "graphic",
            "width": 2,
            "height": 1,
            "row": 2,
            "col": 3,
            "title": "stream errors",
            "normalize": true,
            "signals": [
                <% for error in recv_stream_errors %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-rst_stream_recv-<<error>>_summ"
                },
                <% endfor %>
                <% for error in send_stream_errors %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-rst_stream_send-<<error>>_summ"
                },
                <% endfor %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-header_error_*_summ"
                }
            ],
            "consts": []
        },
        {
            "type": "graphic",
            "width": 2,
            "height": 1,
            "row": 3,
            "col": 3,
            "title": "io errors",
            "normalize": false,
            "signals": [
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-send_frames_*_summ"
                },
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-recv_frame_*_summ"
                }
            ],
            "consts": []
        },
        {
            "type": "graphic",
            "title": "h2 stream cancel stats",
            "normalize": true,
            "width": 2,
            "height": 1,
            "row": 4,
            "col": 1,
            "signals": [
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-stream_conn_abort_summ"
                },
                <% for error in benigh_recv_stream_errors %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-rst_stream_recv-<<error>>_summ"
                },
                <% endfor %>
                <% for error in benigh_send_stream_errors %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-rst_stream_send-<<error>>_summ"
                },
                <% endfor %>
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http-balancer-cancelled_session_http2_summ"
                }
            ],
            "consts": []
        },
        {
            "type": "graphic",
            "width": 2,
            "height": 1,
            "row": 4,
            "col": 3,
            "title": "io errors before preface",
            "normalize": false,
            "signals": [
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-before_preface_*_summ"
                }
            ],
            "consts": []
        },
        {
            "type": "graphic",
            "title": "conn inprog",
            "normalize": true,
            "width": 2,
            "height": 1,
            "row": 5,
            "col": 1,
            "signals": [
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-h1_conn_inprog_ammv"
                },
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-h2_conn_inprog_ammv"
                }
            ],
            "consts": []
        },
        {
            "type": "graphic",
            "title": "stream inprog",
            "normalize": true,
            "width": 2,
            "height": 1,
            "row": 5,
            "col": 3,
            "signals": [
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-http2-stream_inprog_ammv"
                },
                {
                    "tag": "itype=balancer;prj=<<prj>>;ctype=<<ctype>>;geo=<<geo>>",
                    "host": "<<host>>",
                    "name": "balancer_report-report-service_total-inprog_ammv"
                }
            ],
            "consts": []
        }
    ]
}
