コード例 #1
0
class Proxy:
    host: str = field(field='_host')
    name: str = field(field='# pxname')
    status: str = field(field='status', default='UNKNOWN')
    sessions: Session = None
    connections: Connection = None
    requests: DummyRequest = None
    responses: DummyResponse = None
    bytes: Bytes = field(callback=from_args(inbound='bin', outbound='bout'), default=None)

    @classmethod
    def from_row(cls, host, row):
        svname = row['svname']
        row['_host'] = host
        if svname == 'FRONTEND':
            proxy = Frontend
        elif svname == 'BACKEND':
            proxy = Backend
        else:
            proxy = Worker

        return proxy.from_row(row)
コード例 #2
0
class HTTPRequest(AbstractCachedHTTP, Request):
    rate: Rate = field(callback=from_args(current='req_rate', max='req_rate_max'), default=None)
    intercepted: int = field(field='intercepted', default=0)
コード例 #3
0
class AbstractCachedHTTP(AbstractHTTP):
    cache: Cache = field(callback=from_args(lookups='cache_lookups', hits='cache_hits'), default=None)
    hrsp_2xx_compressed: int = field(field='comp_rsp', default=0)
コード例 #4
0
class Connection:
    rate: Rate = field(callback=from_args(current='conn_rate', max='conn_rate_max'), default=None)
    total: int = field(field='conn_tot', default=0)
    error: int = field(field='econ', default=0)
コード例 #5
0
class RateLimitedSession(Session):
    rate: LimitedRate = field(callback=from_args(current='rate', max='rate_max', limit='rate_lim'), default=None)
コード例 #6
0
class Session:
    rate: Rate = field(callback=from_args(current='rate', max='rate_max'), default=None)
    count: LimitedCount = field(callback=from_args(current='scur', max='smax', limit='slim'), default=None)
    total: int = field(field='stot', default=0)
コード例 #7
0
class HTTPResponse(AbstractHTTP, Response):
    time: Time = field(callback=from_args(average='rtime', max='rtime_max'), default=None)
コード例 #8
0
class Response(DummyResponse):
    errors: Error = field(callback=from_args(total='eresp', client='cli_abrt', server='srv_abrt'), default=None)