def make_event(start, rule, metric, value):
    """Makes and posts a threshold event"""
    event = _event_template()
    event.state = event.STATE_START if start else event.STATE_END
    event.subid = "{rule}:{metric}".format(rule=rule.id, metric=metric)

    varmap = dict(metric=metric, alert=rule.alert,
                  ruleid=six.text_type(rule.id),
                  measured_value=six.text_type(value))
    if rule.clear:
        varmap['clear'] = six.text_type(rule.clear)
    _add_subject_details(event, metric, varmap)

    event.save()
    if varmap:
        event.varmap = varmap
    return event