// UpdateEvent provides a mock function with given fields: e
771329
func (_m *DBClient) UpdateEvent(e models.Event) error {
	ret := _m.Called(e)

	var r0 error
	if rf, ok := ret.Get(0).(func(models.Event) error); ok {
		r0 = rf(e)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
1013093
func SendEvent(ws *websocket.Conn, event string) error {
	js := fmt.Sprintf("sendEvent('%s');", event)
	err := ws.WriteMessage(websocket.TextMessage, []byte(js))
	if err != nil {
		return err
	}
	status.Status.SendedBytes += len(js)

	return nil
}
884273
func (srv *Instance) NewEvent(t lifecycle.Type, opts ...lifecycle.Option) error {
	opts = append(opts, lifecycle.Component(srv.eventComponent()))
	opts = append(opts, lifecycle.Identity(srv.cfg.Identity))
	opts = append(opts, lifecycle.Version(build.Version))

	e, err := lifecycle.New(t, opts...)
	if err != nil {
		return err
	}

	return srv.PublishEvent(e)
}
721627
func (c *GorymanClient) SendEvent(e *Event) error {
	epb, err := EventToProtocolBuffer(e)
	if err != nil {
		return err
	}

	message := &proto.Msg{}
	message.Events = append(message.Events, epb)

	_, err = c.sendMaybeRecv(message)
	return err
}
400617
func NewEvent(meta EventHandler) *Event {
	return &Event{
		Metadata:     meta,
		eventResults: make(chan interface{}, 1),
		cancelled:    make(chan struct{}),
		stats:        eventStatistics{},
	}
}
928096
func (s *Simulator) scheduleEvent(e event) {
	if !e.eta.After(s.Now) {
		panic("event's ETA should be in the future")
	}
	heap.Push(&s.events, 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
}
273052
func SendEvent(c Client, e *Event) (*proto.Msg, error) {
	return SendEvents(
		c, &([]Event{*e}),
	)
}
542501
func (s *Application) DelEvent(eventName string) *Application {
	events.DelEvent(eventName)
	return s
}
361953
func (c *SocketConnection) SendEvent(eventHeaders []string) error {
	if len(eventHeaders) <= 0 {
		return fmt.Errorf(ECouldNotSendEvent, len(eventHeaders))
	}

	// lock mutex to prevent event headers from conflicting
	c.mtx.Lock()
	defer c.mtx.Unlock()

	_, err := io.WriteString(c, "sendevent ")
	if err != nil {
		return err
	}

	for _, eventHeader := range eventHeaders {
		_, err := io.WriteString(c, eventHeader)
		if err != nil {
			return err
		}

		_, err = io.WriteString(c, "\r\n")
		if err != nil {
			return err
		}

	}

	_, err = io.WriteString(c, "\r\n")
	if err != nil {
		return err
	}

	return nil
}
953908
func (mr *MockServerInfoSourceMockRecorder) NewEvent(t interface{}, opts ...interface{}) *gomock.Call {
	varargs := append([]interface{}{t}, opts...)
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewEvent", reflect.TypeOf((*MockServerInfoSource)(nil).NewEvent), varargs...)
}
1260692
func (e EventListener) Event(event *core.Event) {
	value := e.Factory.GetConfigurationByKey(event.Key)
	openlogging.GetLogger().Infof("config value after change %s | %s", event.Key, value)
}
99506
func (e *Timing) Update(e2 Event) error {
	if e.Type() != e2.Type() {
		return fmt.Errorf("statsd event type conflict: %s vs %s ", e.String(), e2.String())
	}
	p := e2.Payload().(map[string]int64)
	e.Count += p["cnt"]
	e.Value += p["val"]
	e.Min = minInt64(e.Min, p["min"])
	e.Max = maxInt64(e.Max, p["max"])
	return nil
}
351677
func (eb *eventBuffer) QueueEvent(event *lpEvent) error {
	if event == nil {
		return errors.New("event was nil")
	}
	// Cull our buffer if we're at max capacity
	if eb.List.Len() >= eb.MaxBufferSize {
		oldestEvent := eb.List.Back()
		if oldestEvent != nil {
			eb.List.Remove(oldestEvent)
		}
	}
	// Add event to front of our list
	eb.List.PushFront(event)
	// Update oldestEventTime with the time of our least recent event (at back)
	// keeping track of this allows for more efficient event TTL expiration purges
	if lastElement := eb.List.Back(); lastElement != nil {
		lastEvent, ok := lastElement.Value.(*lpEvent)
		if !ok {
			return fmt.Errorf("Found non-event type in event buffer.")
		}
		eb.oldestEventTime = lastEvent.Timestamp
	}
	return nil
}
97267
func (self *events) updateEventStore(e *Event) {
	self.eventsLock.Lock()
	defer self.eventsLock.Unlock()
	if _, ok := self.eventStore[e.EventType]; !ok {
		maxAge := self.storagePolicy.DefaultMaxAge
		maxNumEvents := self.storagePolicy.DefaultMaxNumEvents
		if age, ok := self.storagePolicy.PerTypeMaxAge[e.EventType]; ok {
			maxAge = age
		}
		if numEvents, ok := self.storagePolicy.PerTypeMaxNumEvents[e.EventType]; ok {
			maxNumEvents = numEvents
		}

		self.eventStore[e.EventType] = utils.NewTimedStore(maxAge, maxNumEvents)
	}
	self.eventStore[e.EventType].Add(e.Timestamp, e)
}
81463
func (em *EventManager) NewEvent(evtype, evselector string) (EventSubs, bool) {
	eo := BuildEventID(evtype, evselector)

	if em.HasEvent(eo) {
		ed, _ := em.GetEvent(eo)
		return ed, false
	}

	emo := NewEventSub(evtype, evselector)

	em.AddEvent(emo)
	return emo, true
}
646376
func (e *Increment) Update(e2 Event) error {
	if e.Type() != e2.Type() {
		return fmt.Errorf("statsd event type conflict: %s vs %s ", e.String(), e2.String())
	}
	e.Value += e2.Payload().(int64)
	return nil
}