func getTotalLogMessageCount(instrumentable instrumentation.Instrumentable) uint64 {
	for _, metric := range instrumentable.Emit().Metrics {
		if metric.Name == "logMessageTotal" {
			return metric.Value.(uint64)
		}
	}
	return uint64(0)
}
func getHTTPStartStopCount(instrumentable instrumentation.Instrumentable) uint64 {
	for _, metric := range instrumentable.Emit().Metrics {
		if metric.Name == "httpStartStopReceived" {
			return metric.Value.(uint64)
		}
	}
	return uint64(0)
}
示例#3
0
func MetricValue(instrumentable instrumentation.Instrumentable, name string) interface{} {
	for _, metric := range instrumentable.Emit().Metrics {
		if metric.Name == name {
			return metric.Value
		}
	}
	return nil
}
func getLogMessageCountByAppId(instrumentable instrumentation.Instrumentable, appId string) uint64 {
	for _, metric := range instrumentable.Emit().Metrics {
		if metric.Name == "logMessageReceived" {
			if metric.Tags["appId"] == appId {
				return metric.Value.(uint64)
			}
		}
	}
	return uint64(0)
}