'Return a generator yielding the each given metric as a tuple:
* label:    the namespace of the metric
* time:     datetime of the metric\'s creation
* kwargs:   a dictionary containing:
** level:   the log level of the metric
** user:    the user associated with the metric
(will be None if anonymous user)
** session: the session of the current user'

def _parse_metrics(self, metrics, user_id=None, session_id=None):

    metrics = (metrics or [])
    for metric in metrics:
        label = metric['namespace']
        time = self._deserialize_isoformat_date(metric['time'])
        kwargs = {'level': metric['level'], 'args': metric['args'], 'user': user_id, 'session': session_id}
        (yield (label, time, kwargs))
