def __init__(self, metric_type, event_expression):
if len(event_expression.event_properties) > <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>self.metric_type = metric_type<EOL>self.event_expression = event_expression<EOL>
Calculate a Cube Metric.

        :param metric_type: The type of the metric, like 'sum' or 'min'
        :type metric_type: `str`
        :param event_expression: The EventExpression over which to calculate
        :type event_expression: `EventExpression`

        Note that the EventExpressions for Cube metrics may only have *one*
        event_property.

        >>> e = EventExpression('request')
        >>> print(MetricExpression('sum', e))
        sum(request)
        >>> e = EventExpression('request', 'elapsed_ms')
        >>> print(MetricExpression('sum', e))
        sum(request(elapsed_ms))