// NewEvent returns a new Event with initialized metric maps.
775944
func NewEvent() *Event {
	event := new(Event)
	event.TimeMetrics = make(map[string]float64)
	event.NumberMetrics = make(map[string]uint64)
	event.BoolMetrics = make(map[string]bool)
	return event
}
471962
func newEvent(data *textproto.MIMEHeader) (*AMIEvent, error) {
	if data.Get("Event") == "" {
		return nil, errNotEvent
	}
	ev := &AMIEvent{data.Get("Event"),
		strings.Split(data.Get("Privilege"), ","),
		make(map[string]string)}

	for k, v := range *data {
		if k == "Event" || k == "Privilege" {
			continue
		}
		ev.Params[k] = v[0]
	}
	return ev, nil
}
372587
func NewEvent(etype, eselector string, efx EventHandler) *Event {
	ex := Event{
		Meta: &domevents.EventMetable{EventType: etype, EventTarget: eselector},
	}

	// wireup the function to get the ev and tree.
	ex.Fx = func(ev domevents.Event) {
		if efx != nil {
			efx(ev, ex.tree)
		}
	}

	return &ex
}
402356
func NewEventer(ctx context.Context, logger hclog.Logger) *Eventer {
	e := &Eventer{
		events: make(chan *drivers.TaskEvent),
		ctx:    ctx,
		logger: logger,
	}
	go e.eventLoop()
	return e
}
482765
func NewErrorEvent(ts int64, path string, record interface{}, message string) Event {
	e := &errorEvent{
		Ts:      ts,
		Kind:    "error",
		Path:    path,
		Record:  record,
		Message: message,
	}
	return e
}
787051
func New() *Events {
	return &Events{
		events: make([]eventtypes.Message, 0, eventsLimit),
		pub:    pubsub.NewPublisher(100*time.Millisecond, bufferSize),
	}
}
1019468
func NewProtobufEvent(e *com_signalfx_metrics_protobuf.Event) (*event.Event, error) {
	dims := make(map[string]string, len(e.GetDimensions())+1)
	edims := e.GetDimensions()
	for _, dpdim := range edims {
		dims[dpdim.GetKey()] = dpdim.GetValue()
	}

	// sure wish protobuf has something eqiv of interface{} instead of only union structs...
	// <sigh>
	props := make(map[string]interface{}, len(e.GetDimensions())+1)
	for _, dpdim := range e.GetProperties() {
		pval := dpdim.GetValue()
		pkey := dpdim.GetKey()
		if pval.StrValue != nil {
			props[pkey] = pval.GetStrValue()
		} else if pval.BoolValue != nil {
			props[pkey] = pval.GetBoolValue()
		} else if pval.DoubleValue != nil {
			props[pkey] = pval.GetDoubleValue()
		} else if pval.IntValue != nil {
			props[pkey] = pval.GetIntValue()
		} else {
			return nil, errPropertyValueNotSet
		}
	}

	cat := event.ToProtoEC(e.GetCategory())
	return event.NewWithProperties(e.GetEventType(), cat, dims, props, fromTs(e.GetTimestamp())), nil
}
26171
func (s *CloudFunctionConfiguration) SetEvent(v string) *CloudFunctionConfiguration {
	s.Event = &v
	return s
}
869731
func (w *Webhook) UpdateEvent() error {
	data, err := jsoniter.Marshal(w.HookEvent)
	w.Events = string(data)
	return err
}
1086841
func (mc MongoClient) UpdateEvent(e contract.Event) error {
	var mapped models.Event
	id, err := mapped.FromContract(e, mc)
	if err != nil {
		return err
	}

	mapped.TimestampForUpdate()

	return mc.updateId(db.EventsCollection, id, mapped)
}
693750
func NewMetricsEvent(ts int64, path string, records int) Event {
	e := &metricsEvent{
		Ts:      ts,
		Kind:    "metrics",
		Path:    path,
		Records: records,
	}
	return e
}
624700
func NewEvent(name string, data interface{}) *Event {
	return &Event{Name: name, Data: data}
}
99835
func new_(e interface{}) func() Event {
	typ := reflect.TypeOf(e)
	return func() Event {
		return reflect.New(typ).Interface().(Event)
	}
}
638992
func NewBlockEvent(block *cb.Block, sourceURL string) *fab.BlockEvent {
	return &fab.BlockEvent{
		Block:     block,
		SourceURL: sourceURL,
	}
}
546004
func NewEventQueueBuffered(name string, numBufferedEvents int) *EventQueue {
	log.WithFields(logrus.Fields{
		"name":              name,
		"numBufferedEvents": numBufferedEvents,
	}).Debug("creating new EventQueue")
	return &EventQueue{
		name: name,
		// Up to numBufferedEvents can be Enqueued until Enqueueing blocks.
		events: make(chan *Event, numBufferedEvents),
		close:  make(chan struct{}),
		drain:  make(chan struct{}),
	}

}
1253891
func New(event *gami.AMIEvent) interface{} {
	if intf, ok := eventTrap[event.ID]; ok {
		return build(event, &intf)
	}
	return *event
}
390013
func NewChannelEventListener(em event.EventMachine) *ChannelEventListener {
	return &ChannelEventListener{em: em, ids: []uint64{}}
}