Exemplo n.º 1
0
func (m *EventMarshaller) incrementMessageCount(eventType events.Envelope_EventType) {
	incrementCount(m.messageCounts[eventType])
	modifiedEventName := []rune(eventType.String())
	modifiedEventName[0] = unicode.ToLower(modifiedEventName[0])
	metricName := string(modifiedEventName) + "Marshalled"
	metrics.BatchIncrementCounter("dropsondeMarshaller." + metricName)
}
Exemplo n.º 2
0
func (c *envelopeCounter) Increment(typ events.Envelope_EventType) {
	c.batcher.BatchCounter("sentEnvelopes").
		SetTag("protocol", "ws").
		SetTag("event_type", typ.String()).
		SetTag("endpoint", c.endpoint).
		Increment()
}
func (u *dropsondeUnmarshaller) incrementReceiveCount(eventType events.Envelope_EventType) {
	modifiedEventName := []rune(eventType.String())
	modifiedEventName[0] = unicode.ToLower(modifiedEventName[0])
	metricName := string(modifiedEventName) + "Received"

	metrics.BatchIncrementCounter("dropsondeUnmarshaller." + metricName)

	incrementCount(u.receiveCounts[eventType])
}
Exemplo n.º 4
0
func (u *EventUnmarshaller) incrementReceiveCount(eventType events.Envelope_EventType) {
	switch eventType {
	case events.Envelope_LogMessage:
		// LogMessage is a special case. `logMessageReceived` used to be broken out by app ID, and
		// `logMessageTotal` was the sum of all of those.
		metrics.BatchIncrementCounter("dropsondeUnmarshaller.logMessageTotal")
		incrementCount(u.receiveCounts[events.Envelope_LogMessage])
	default:
		name := eventType.String()
		modifiedEventName := []rune(name)
		modifiedEventName[0] = unicode.ToLower(modifiedEventName[0])
		metricName := string(modifiedEventName) + "Received"

		metrics.BatchIncrementCounter("dropsondeUnmarshaller." + metricName)
		incrementCount(u.receiveCounts[eventType])
	}
}
func (u *EventUnmarshaller) incrementReceiveCount(eventType events.Envelope_EventType) error {
	var err error
	switch eventType {
	case events.Envelope_LogMessage:
		// LogMessage is a special case. `logMessageReceived` used to be broken out by app ID, and
		// `logMessageTotal` was the sum of all of those.
		u.batcher.BatchIncrementCounter("dropsondeUnmarshaller.logMessageTotal")
	default:
		metricName := metricNames[eventType]
		if metricName == "" {
			metricName = "dropsondeUnmarshaller.unknownEventTypeReceived"
			err = fmt.Errorf("eventUnmarshaller: received unknown event type %#v", eventType)
		}
		u.batcher.BatchIncrementCounter(metricName)
	}

	u.batcher.BatchCounter("dropsondeUnmarshaller.receivedEnvelopes").
		SetTag("protocol", "udp").
		SetTag("event_type", eventType.String()).
		Increment()

	return err
}