当前位置: 首页>>代码示例>>Python>>正文


Python glances_plugin.GlancesPlugin类代码示例

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


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

示例1: test_014_sorted_stats

    def test_014_sorted_stats(self):
        """Check sorted stats method."""
        print('INFO: [TEST_015] Check sorted stats method')
        aliases = {
            "key2": "alias11",
            "key5": "alias2",
        }
        unsorted_stats = [
            {"key": "key4"},
            {"key": "key2"},
            {"key": "key5"},
            {"key": "key21"},
            {"key": "key3"},
        ]

        gp = GlancesPlugin()
        gp.get_key = lambda: "key"
        gp.has_alias = aliases.get
        gp.stats = unsorted_stats

        sorted_stats = gp.sorted_stats()
        self.assertEqual(len(sorted_stats), 5)
        self.assertEqual(sorted_stats[0]["key"], "key5")
        self.assertEqual(sorted_stats[1]["key"], "key2")
        self.assertEqual(sorted_stats[2]["key"], "key3")
        self.assertEqual(sorted_stats[3]["key"], "key4")
        self.assertEqual(sorted_stats[4]["key"], "key21")
开发者ID:ZhangHuaiFan,项目名称:glances,代码行数:27,代码来源:unitest.py

示例2: update_views

    def update_views(self):
        """Update stats views."""
        # Call the father's method
        GlancesPlugin.update_views(self)

        # Add specifics informations
        # Alert and log
        self.views['used']['decoration'] = self.get_alert_log(self.stats['used'], maximum=self.stats['total'])
开发者ID:Efreak,项目名称:glances,代码行数:8,代码来源:glances_memswap.py

示例3: __init__

    def __init__(self, args=None, config=None):
        """Init the plugin."""
        GlancesPlugin.__init__(self, args=args)

        # Set the config instance
        self.config = config

        # We want to display the stat in the curse interface
        self.display_curse = True
开发者ID:LuoZijun,项目名称:glances,代码行数:9,代码来源:glances_help.py

示例4: __init__

    def __init__(self, args=None):
        """Init the quicklook plugin."""
        GlancesPlugin.__init__(self, args=args)

        # We want to display the stat in the curse interface
        self.display_curse = True

        # Init stats
        self.reset()
开发者ID:markandrewj,项目名称:glances,代码行数:9,代码来源:glances_quicklook.py

示例5: update_views

    def update_views(self):
        """Update stats views."""
        # Call the father's method
        GlancesPlugin.update_views(self)

        # Add specifics informations
        # Optional
        for key in self.stats.keys():
            self.views[key]['optional'] = True
开发者ID:hank,项目名称:glances,代码行数:9,代码来源:glances_ip.py

示例6: __init__

    def __init__(self, args=None):
        """Init the plugin."""
        GlancesPlugin.__init__(self, args=args)

        # We want to display the stat in the curse interface
        self.display_curse = True

        # Set the message position
        self.set_align('bottom')
开发者ID:baiyunping333,项目名称:glances,代码行数:9,代码来源:glances_now.py

示例7: __init__

    def __init__(self, args=None):
        """Init the plugin."""
        GlancesPlugin.__init__(self, args=args, items_history_list=items_history_list)

        # We want to display the stat in the curse interface
        self.display_curse = True

        # Init the stats
        self.reset()
开发者ID:baiyunping333,项目名称:glances,代码行数:9,代码来源:glances_mem.py

示例8: __init__

    def __init__(self, args=None):
        """Init the plugin."""
        GlancesPlugin.__init__(self, args=args)

        # We want to display the stat in the curse interface
        self.display_curse = True

        # Trying to display proc time
        self.tag_proc_time = True
开发者ID:Efreak,项目名称:glances,代码行数:9,代码来源:glances_processlist.py

示例9: update_views

    def update_views(self):
        """Update stats views."""
        # Call the father's method
        GlancesPlugin.update_views(self)

        # Add specifics informations
        # Alert only
        for key in ['cpu', 'mem', 'swap']:
            if key in self.stats:
                self.views[key]['decoration'] = self.get_alert(self.stats[key], header=key)
开发者ID:markandrewj,项目名称:glances,代码行数:10,代码来源:glances_quicklook.py

示例10: update_views

    def update_views(self):
        """Update stats views."""
        # Call the father's method
        GlancesPlugin.update_views(self)

        # Add specifics informations
        # Alert
        for i in self.stats:
            self.views[i[self.get_key()]]['used']['decoration'] = self.get_alert(
                i['used'], maximum=i['size'], header=i['mnt_point'])
开发者ID:Exasis,项目名称:glances,代码行数:10,代码来源:glances_fs.py

示例11: __init__

    def __init__(self, args=None):
        """Init the plugin."""
        GlancesPlugin.__init__(self, args=args)

        # We dot not want to display the stat in the curse interface
        # The core number is displayed by the load plugin
        self.display_curse = False

        # Init the stat
        self.reset()
开发者ID:baiyunping333,项目名称:glances,代码行数:10,代码来源:glances_core.py

示例12: __init__

    def __init__(self, args=None):
        """Init the plugin."""
        GlancesPlugin.__init__(self, args=args)

        # We want to display the stat in the curse interface
        self.display_curse = True

        # Init stats
        self.glances_monitors = None
        self.stats = []
开发者ID:baiyunping333,项目名称:glances,代码行数:10,代码来源:glances_monitor.py

示例13: __init__

    def __init__(self, args=None):
        """Init the plugin."""
        GlancesPlugin.__init__(self, args=args)

        # We want to display the stat in the curse interface
        self.display_curse = True

        # Init stats
        self.reset()
        self.percputime_total_new = []
        self.percputime_new = []
开发者ID:LuoZijun,项目名称:glances,代码行数:11,代码来源:glances_percpu.py

示例14: __init__

    def __init__(self, args=None):
        """Init the plugin."""
        GlancesPlugin.__init__(self, args=args)

        # We want to display the stat in the curse interface
        self.display_curse = True
        # Set the message position
        # It is NOT the curse position but the Glances column/line
        # Enter -1 to right align
        self.column_curse = 1
        # Enter -1 to diplay bottom
        self.line_curse = 2
开发者ID:BeanYoung,项目名称:glances,代码行数:12,代码来源:glances_processcount.py

示例15: update_views

    def update_views(self):
        """Update stats views."""
        # Call the father's method
        GlancesPlugin.update_views(self)

        # Add specifics informations
        # Alert and log
        self.views['used']['decoration'] = self.get_alert_log(self.stats['used'], maximum=self.stats['total'])
        # Optional
        for key in ['active', 'inactive', 'buffers', 'cached']:
            if key in self.stats:
                self.views[key]['optional'] = True
开发者ID:Efreak,项目名称:glances,代码行数:12,代码来源:glances_mem.py


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