コード例 #1
0
func (p *ContainerMetricProcessor) Process(e *events.Envelope) []metrics.Metric {
	processedMetrics := make([]metrics.Metric, 3)
	containerMetricEvent := e.GetContainerMetric()

	processedMetrics[0] = metrics.Metric(p.ProcessContainerMetricCPU(containerMetricEvent))
	processedMetrics[1] = metrics.Metric(p.ProcessContainerMetricMemory(containerMetricEvent))
	processedMetrics[2] = metrics.Metric(p.ProcessContainerMetricDisk(containerMetricEvent))

	return processedMetrics
}
コード例 #2
0
func (p *HttpStartStopProcessor) Process(e *events.Envelope) []metrics.Metric {
	processedMetrics := make([]metrics.Metric, 4)
	httpStartStopEvent := e.GetHttpStartStop()

	processedMetrics[0] = metrics.Metric(p.ProcessHttpStartStopResponseTime(httpStartStopEvent))
	processedMetrics[1] = metrics.Metric(p.ProcessHttpStartStopStatusCodeCount(httpStartStopEvent))
	processedMetrics[2] = metrics.Metric(p.ProcessHttpStartStopHttpErrorCount(httpStartStopEvent))
	processedMetrics[3] = metrics.Metric(p.ProcessHttpStartStopHttpRequestCount(httpStartStopEvent))

	return processedMetrics
}
コード例 #3
0
func (p *HeartbeatProcessor) Process(e *events.Envelope) []metrics.Metric {
	processedMetrics := make([]metrics.Metric, 4)
	heartbeat := e.GetHeartbeat()
	origin := e.GetOrigin()

	processedMetrics[0] = metrics.Metric(p.ProcessHeartbeatCount(heartbeat, origin))
	processedMetrics[1] = metrics.Metric(p.ProcessHeartbeatEventsSentCount(heartbeat, origin))
	processedMetrics[2] = metrics.Metric(p.ProcessHeartbeatEventsReceivedCount(heartbeat, origin))
	processedMetrics[3] = metrics.Metric(p.ProcessHeartbeatEventsErrorCount(heartbeat, origin))

	return processedMetrics
}
コード例 #4
0
func (p *CounterProcessor) Process(e *events.Envelope) []metrics.Metric {
	processedMetrics := make([]metrics.Metric, 1)
	counterEvent := e.GetCounterEvent()

	processedMetrics[0] = metrics.Metric(p.ProcessCounter(counterEvent))

	return processedMetrics
}