VOLTTRON / volttron

VOLTTRON Distributed Control System Platform
https://volttron.readthedocs.io/
Other
455 stars 216 forks source link

missing Performance section in Volttron Central web UI #1812

Closed jens18 closed 5 years ago

jens18 commented 5 years ago

Description of Issue

missing Performance section in Volttron Central UI.

The 'status/cpu' is being published by the platform.agent but not correctly processed in the Volttron Central agent: image

2018-09-28 09:53:12,670 (listeneragent-3.2 788) listener.agent INFO: Peer: 'pubsub', Sender: 'platform.agent':, Bus: u'', Topic: 'datalogger/platforms/vcp-Test_Platform_1/status/cpu', Headers: {'max_compatible_version': u'', 'min_compatible_version': '3.0'}, Message: {'percent': {'Readings': 15.2, 'Units': 'double'}, 'times_percent/guest': {'Readings': 0.0, 'Units': 'double'}, 'times_percent/guest_nice': {'Readings': 0.0, 'Units': 'double'}, 'times_percent/idle': {'Readings': 84.8, 'Units': 'double'}, 'times_percent/iowait': {'Readings': 0.8, 'Units': 'double'}, 'times_percent/irq': {'Readings': 0.0, 'Units': 'double'}, 'times_percent/nice': {'Readings': 0.0, 'Units': 'double'}, 'times_percent/softirq': {'Readings': 0.1, 'Units': 'double'}, 'times_percent/steal': {'Readings': 0.0, 'Units': 'double'}, 'times_percent/system': {'Readings': 3.3, 'Units': 'double'}, 'times_percent/user': {'Readings': 11.1, 'Units': 'double'}}

Affected Version

Release 5.1

Screenshots

volttron_performance_missing

Expected

Performance section is displayed above 'Building' and 'Agents'.

Actual

Performance section is missing in Volttron Central web UI.

Steps to Reproduce

1) setup a basic Volttron Central enable Volttron system:

$ volttron-cfg

Your VOLTTRON_HOME currently set to: /home/jens/.volttron3

Is this the volttron you are attempting to setup? [Y]: What is the external instance ipv4 address? [tcp://127.0.0.1]: What is the instance port for the vip address? [22916]: Is this instance a volttron central? [N]: y Configuring /home/jens/Projects/volttron/services/core/VolttronCentral

In order for external clients to connect to volttron central or the instance itself, the instance must bind to a tcp address. If testing this can be an internal address such as 127.0.0.1.

Please enter the external ipv4 address for this instance? [http://127.0.0.1]: What is the port for volttron central? [8080]: Enter volttron central admin user name: admin Enter volttron central admin password: Retype password: Installing volttron central Should agent autostart? [N]: y Will this instance be controlled by volttron central? [Y]: y Configuring /home/jens/Projects/volttron/services/core/VolttronCentralPlatform Enter the name of this instance. [tcp://127.0.0.1:22916]: Enter volttron central's web address [http://127.0.0.1]: What is the port for volttron central? [8080]: Should agent autostart? [N]: y Would you like to install a platform historian? [N]: y Configuring /home/jens/Projects/volttron/services/core/SQLHistorian Should agent autostart? [N]: y Would you like to install a master driver? [N]: y Configuring /home/jens/Projects/volttron/services/core/MasterDriverAgent Install a fake device on the master driver? [N]: y Should agent autostart? [N]: y Would you like to install a listener agent? [N]: y Configuring examples/ListenerAgent Should agent autostart? [N]: y Finished configuration

You can now start the volttron instance.

If you need to change the instance configuration you can edit the config file at /home/jens/.volttron3/config

2) Point browser to:

http://127.0.0.1:8080/vc/index.html

3) Login/Password: admin/admin

4) Expand platform: tcp://127.0.0.1:22916

-> You will see the 'Building' and 'Agents' section but not the 'Performance' section

Additional Details

volttron/services/core/VolttronCentral/volttroncentral/platforms.py

starting at line 331:

    self._platform_stats = {}                                                                                                                                                              

    platform_prefix = "platforms/{}/".format(self.vip_identity)                                                                                                                            

    # Setup callbacks to listen to the local bus from the vcp instance.                                                                                                                    
    #                                                                                                                                                                                      
    # Note: the platform/{}/ is prepended to the vcp_topics below for                                                                                                                      
    #   communication from the vcp in the field.                                                                                                                                           
    vcp_topics = (                                                                                                                                                                         
        # ('device_updates', self._on_device_message),                                                                                                                                     
        # ('devices/update', self._on_device_message),                                                                                                                                     
        # devices and status.                                                                                                                                                              
        # ('devices/', self._on_device_message),                                                                                                                                           
        # statistics for showing performance in the ui.                                                                                                                                    
        ('datalogger/platform/status', self._on_platform_stats),                                                                                                                           
        # iam and configure callbacks                                                                                                                                                      
        ('iam/', self._on_platform_message),                                                                                                                                               
        # iam and configure callbacks                                                                                                                                                      
        ('configure/', self._on_platform_message)                                                                                                                                          
    )                                                                                                                                                                                      

    for topic, funct in vcp_topics:                                                                                                                                                        
        self._vc.vip.pubsub.subscribe('pubsub',                                                                                                                                            
                                      platform_prefix + topic, funct)   

Is this the correct topic to subscribe to:

platforms//datalogger/platform/status

This is the topic currently being send:

datalogger/platforms/vcp-Test_Platform_1/status

Could this be the problem?

craig8 commented 5 years ago

Thanks @jens18 I will take a look at it

jens18 commented 5 years ago

Generating a graph for a 'Performance' metric (for example: times_percent / user) works with the 'Add Chart' button (upper right corner).

The 'list of available' Performance metrics on the left site (under the platform) entry is missing.

jens18 commented 5 years ago

this issue has been address by pull request #1813 (in the 'develop' branch).