func statsUpload()

in collector/collector.go [371:402]


func statsUpload(
	glr *config.RemoteConfig,
	sr metrics.Reporter,
	target string,
	remotes config.RemoteStore,
	QOSDSCP ip.DSCPValue,
	srcPort layers.TCPPort,
	r *report,
	logger *log.Logger,
) {
	remote, existsTarget := remotes[target]
	if !existsTarget {
		logger.Error("host exists in resultStore, but not in remoteStore",
			zap.String("host", target))
		return
	}

	tags := map[string]string{
		"host":            glr.HostName,
		"host_location":   glr.Location,
		"target":          remote.Hostname,
		"target_location": remote.Location,
		"dscp":            strconv.Itoa(int(QOSDSCP)),
		"source_port":     strconv.Itoa(int(srcPort)),
		"timed_out":       strconv.FormatBool((*r).timedOut),
	}

	// Both following in nanoseconds
	sr.ReportGauge("latency_2way", tags, int64((*r).latency2Way))
	sr.ReportGauge("latency_1way", tags, (*r).latency1Way.Nanoseconds())

}