func NewEvent(alarm *Alarm, action *action.Action) (*Event, error) {
	evt := Event{
		ID:        bson.NewObjectId(),
		StartTime: time.Now().UTC(),
		Alarm:     alarm,
		Action:    action,
	}
	conn, err := db.Conn()
	if err != nil {
		logger().Error(err)
		return nil, err
	}
	defer conn.Close()
	return &evt, conn.Events().Insert(evt)
}
NewEvent creates a new alarm event
package alarm
import (
	"time"
	"github.com/tsuru/tsuru-autoscale/action"
	"github.com/tsuru/tsuru-autoscale/db"
	"gopkg.in/mgo.v2/bson"
)
type Event struct {
	ID         bson.ObjectId `bson:"_id"`
	StartTime  time.Time
	EndTime    time.Time `bson:",omitempty"`
	Alarm      *Alarm
	Successful bool
	Error      string `bson:",omitempty"`
	Action     *action.Action
}