def render_metrics(metrics, namespace, prefix=None):
    """Renders collected metrics into 'prefix.namespace.metric x y' list.

    @param metrics: List of collected metrics.
    @type metrics: list
    @param namespace: Graphite metrics namespace.
    @type namespace: str
    @param prefix: Prefix for metrics namespace (e.g. for hostedgraphite.com).
    @type prefix: str

    @return: List of rendered metris.
    @rtype: list
    """
    full_ns = [namespace]

    if prefix:
        full_ns.insert(0, prefix)

    return ['.'.join(full_ns + [met]) for met in metrics]