def _update_metrics(self, slug, game):
        metrics = MetricsSession.get_metrics(slug)
        inverse_mapping = get_inverse_mapping_table(game)

        for session in metrics:
            try:
                s = _Session(session['timestamp'])
                fileDict = {}

                for entry in session['entries']:
                    try:
                        (filename, size, mimetype, status) = \
                            (entry['file'], int(entry['size']), entry['type'], entry['status'])
                    except __HOLE__:
                        break

                    try:
                        asset_name = inverse_mapping[os.path.basename(filename)]
                    except KeyError:
                        asset_name = filename
                    _, ext = os.path.splitext(asset_name)
                    ext = ext[1:] if ext else 'unknown'

                    # Add the request to the session.
                    s.add_request(size)

                    # Add the request to the by_file metrics.
                    if filename not in fileDict:
                        fileDict[filename] = _File(asset_name, filename, size, mimetype, status)
                        s.add_file(size)

                s.humanize()

                timestamp = s.timestamp
                self._session_overviews.append((timestamp, s))

            except KeyError as e:
                LOG.error("Potentially corrupted file found. Can't extract metrics data: %s", str(e))
dataset/ETHPy150Open turbulenz/turbulenz_local/turbulenz_local/controllers/localv1/metrics.py/MetricsController._update_metrics