• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python counter.counter函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中supervisor.medusa.counter.counter函数的典型用法代码示例。如果您正苦于以下问题:Python counter函数的具体用法?Python counter怎么用?Python counter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了counter函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

 def __init__ (self, filesystem):
     self.filesystem = filesystem
     # count total hits
     self.hit_counter = counter()
     # count file deliveries
     self.file_counter = counter()
     # count cache hits
     self.cache_counter = counter()
开发者ID:GulsahKose,项目名称:supervisor,代码行数:8,代码来源:default_handler.py


示例2: __init__

    def __init__ (self, ip, port, resolver=None, logger_object=None):
        self.ip = ip
        self.port = port
        asyncore.dispatcher.__init__ (self)
        self.create_socket (socket.AF_INET, socket.SOCK_STREAM)

        self.handlers = []

        if not logger_object:
            logger_object = logger.file_logger (sys.stdout)

        self.set_reuse_addr()
        self.bind ((ip, port))

        # lower this to 5 if your OS complains
        self.listen (1024)

        host, port = self.socket.getsockname()
        if not ip:
            self.log_info('Computing default hostname', 'warning')
            ip = socket.gethostbyname (socket.gethostname())
        try:
            self.server_name = socket.gethostbyaddr (ip)[0]
        except socket.error:
            self.log_info('Cannot do reverse lookup', 'warning')
            self.server_name = ip       # use the IP address as the "hostname"

        self.server_port = port
        self.total_clients = counter()
        self.total_requests = counter()
        self.exceptions = counter()
        self.bytes_out = counter()
        self.bytes_in  = counter()

        if not logger_object:
            logger_object = logger.file_logger (sys.stdout)

        if resolver:
            self.logger = logger.resolving_logger (resolver, logger_object)
        else:
            self.logger = logger.unresolving_logger (logger_object)

        self.log_info (
                'Medusa (V%s) started at %s'
                '\n\tHostname: %s'
                '\n\tPort:%d'
                '\n' % (
                        VERSION_STRING,
                        time.ctime(time.time()),
                        self.server_name,
                        port,
                        )
                )
开发者ID:lmcdonough,项目名称:supervisor,代码行数:53,代码来源:http_server.py


示例3: __init__

 def __init__ (self, hostname='127.0.0.1', port=8023):
     asyncore.dispatcher.__init__(self)
     self.hostname = hostname
     self.port = port
     self.create_socket (socket.AF_INET, socket.SOCK_STREAM)
     self.set_reuse_addr()
     self.bind ((hostname, port))
     self.log_info('%s started on port %d' % (self.SERVER_IDENT, port))
     self.listen (5)
     self.closed             = 0
     self.failed_auths = 0
     self.total_sessions = counter()
     self.closed_sessions = counter()
开发者ID:lmcdonough,项目名称:supervisor,代码行数:13,代码来源:monitor.py


示例4: postbind

    def postbind(self):
        from supervisor.medusa.counter import counter
        from supervisor.medusa.http_server import VERSION_STRING

        self.listen(1024)

        self.total_clients = counter()
        self.total_requests = counter()
        self.exceptions = counter()
        self.bytes_out = counter()
        self.bytes_in  = counter()

        self.log_info (
                'Medusa (V%s) started at %s'
                '\n\tHostname: %s'
                '\n\tPort:%s'
                '\n' % (
                        VERSION_STRING,
                        time.ctime(time.time()),
                        self.server_name,
                        self.port,
                        )
                )
开发者ID:wowgeeker,项目名称:supervisor,代码行数:23,代码来源:http.py


示例5: __init__

    def __init__ (
            self,
            authorizer,
            hostname        =None,
            ip              ='',
            port            =21,
            resolver        =None,
            logger_object=logger.file_logger (sys.stdout)
            ):
        self.ip = ip
        self.port = port
        self.authorizer = authorizer

        if hostname is None:
            self.hostname = socket.gethostname()
        else:
            self.hostname = hostname

        # statistics
        self.total_sessions = counter()
        self.closed_sessions = counter()
        self.total_files_out = counter()
        self.total_files_in = counter()
        self.total_bytes_out = counter()
        self.total_bytes_in = counter()
        self.total_exceptions = counter()
        #
        asyncore.dispatcher.__init__ (self)
        self.create_socket (socket.AF_INET, socket.SOCK_STREAM)

        self.set_reuse_addr()
        self.bind ((self.ip, self.port))
        self.listen (5)

        if not logger_object:
            logger_object = sys.stdout

        if resolver:
            self.logger = logger.resolving_logger (resolver, logger_object)
        else:
            self.logger = logger.unresolving_logger (logger_object)

        self.log_info('FTP server started at %s\n\tAuthorizer:%s\n\tHostname: %s\n\tPort: %d' % (
                time.ctime(time.time()),
                repr (self.authorizer),
                self.hostname,
                self.port)
                )
开发者ID:GulsahKose,项目名称:supervisor,代码行数:48,代码来源:ftp_server.py


示例6: __init__

 def __init__ (self, filesystem):
     self.filesystem = filesystem
     self.hits = counter.counter()
     self.exceptions = counter.counter()
开发者ID:GulsahKose,项目名称:supervisor,代码行数:4,代码来源:script_handler.py


示例7: __init__

 def __init__ (self, request, file):
     self.buffer = ''
     self.request = request
     self.file = file
     self.got_header = 0
     self.bytes_out = counter.counter()
开发者ID:AhmadAabed,项目名称:supervisor-c9,代码行数:6,代码来源:thread_handler.py


示例8: __init__

 def __init__ (self, server='127.0.0.1'):
     resolver.__init__(self, server)
     self.cache = {}
     self.forward_requests = counter()
     self.reverse_requests = counter()
     self.cache_hits = counter()
开发者ID:lmcdonough,项目名称:supervisor,代码行数:6,代码来源:resolver.py


示例9: __init__

 def __init__(self, dict, handler, realm="default"):
     self.authorizer = dictionary_authorizer(dict)
     self.handler = handler
     self.realm = realm
     self.pass_count = counter.counter()
     self.fail_count = counter.counter()
开发者ID:GulsahKose,项目名称:supervisor,代码行数:6,代码来源:auth_handler.py


示例10: __init__

 def __init__ (self, pattern, redirect, regex_flag=re.IGNORECASE):
     self.pattern = pattern
     self.redirect = redirect
     self.patreg = re.compile (pattern, regex_flag)
     self.hits = counter.counter()
开发者ID:GulsahKose,项目名称:supervisor,代码行数:5,代码来源:redirecting_handler.py



注:本文中的supervisor.medusa.counter.counter函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python http_date.build_http_date函数代码示例发布时间:2022-05-27
下一篇:
Python asyncore_25.loop函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap