'Update stats views.'

def update_views(self):

    super(Plugin, self).update_views()
    if ('containers' not in self.stats):
        return False
    for i in self.stats['containers']:
        self.views[i[self.get_key()]] = {'cpu': {}, 'mem': {}}
        if (('cpu' in i) and ('total' in i['cpu'])):
            alert = self.get_alert(i['cpu']['total'], header=(i['name'] + '_cpu'), action_key=i['name'])
            if (alert == 'DEFAULT'):
                alert = self.get_alert(i['cpu']['total'], header='cpu')
            self.views[i[self.get_key()]]['cpu']['decoration'] = alert
        if (('memory' in i) and ('usage' in i['memory'])):
            alert = self.get_alert(i['memory']['usage'], maximum=i['memory']['limit'], header=(i['name'] + '_mem'), action_key=i['name'])
            if (alert == 'DEFAULT'):
                alert = self.get_alert(i['memory']['usage'], maximum=i['memory']['limit'], header='mem')
            self.views[i[self.get_key()]]['mem']['decoration'] = alert
    return True
