'Update load stats.'

@GlancesPlugin._check_decorator
@GlancesPlugin._log_result_decorator
def update(self):

    self.reset()
    if (self.input_method == 'local'):
        try:
            load = os.getloadavg()
        except (OSError, AttributeError):
            self.stats = {}
        else:
            self.stats = {'min1': load[0], 'min5': load[1], 'min15': load[2], 'cpucore': self.nb_log_core}
    elif (self.input_method == 'snmp'):
        self.stats = self.get_stats_snmp(snmp_oid=snmp_oid)
        if (self.stats['min1'] == ''):
            self.reset()
            return self.stats
        for (k, v) in iteritems(self.stats):
            self.stats[k] = float(v)
        self.stats['cpucore'] = self.nb_log_core
    return self.stats
