def compute_usage_metrics(session, args, fqdn, user,
                          collection, experiment, channel):
    """Add metrics to cloudwatch

    Args:
        session (boto3.session):
        args (dict): contains [x|y|z]_[start|stop] for computing extents
        fqdn (str): fully qualified domain name of the endpoint
        user (str): name of user invoking downsample
        collection (str): name of collection
        experiment (str): name of experiment
        channel (str): name of channel
    """

    def get_cubes(axis, dim):
        extent = args['{}_stop'.format(axis)] - args['{}_start'.format(axis)]
        return -(-extent // dim) ## ceil div

    cost = (  get_cubes('x', 512)
            * get_cubes('y', 512)
            * get_cubes('z', 16)
            / 4 # number of cubes for a downsampled volume
            * 0.75 # assume the frame is only 75% filled
            * 2 # 1 for invoking a lambda
                # 1 for time it takes lambda to run
            * 1.33 # add 33% overhead for all other non-base resolution downsamples
           )

    dimensions = [
        {'Name': 'user', 'Value': user},
        {'Name': 'resource', 'Value': '{}/{}/{}'.format(collection, experiment, channel)},
        {'Name': 'stack', 'Value': fqdn},
    ]

    client = session.client('cloudwatch')
    client.put_metric_data(
        Namespace = "BOSS/Downsample",
        MetricData = [{
            'MetricName': 'InvokeCount',
            'Dimensions': dimensions,
            'Value': 1.0,
            'Unit': 'Count'
        }, {
            'MetricName': 'ComputeCost',
            'Dimensions': dimensions,
            'Value': cost,
            'Unit': 'Count'
        }]
    )