def record_style(context):
    """
    Return the style to be usd for the metric's current record.

    This expects a template context variable ``'metric'`` referring to the
    metric instance in question, as well as a context variable ``'record'``
    containing the current record to be used for style determination.

    This template tag calls into :class:`Metric.get_record_style
    <postgres_metrics.metrics.Metric.get_record_style>` and will---if a return
    value was specified---prefix that one with ``'pgm-'``.
    """
    metric = context["metric"]
    record = context["record"]
    style = metric.get_record_style(record)
    if style:
        return "pgm-%s" % style
    return ""