endian 수정

This commit is contained in:
2023-11-27 23:27:53 +09:00
parent cf4b458a4b
commit e1e2f3c087
2 changed files with 10 additions and 6 deletions

View File

@ -277,14 +277,16 @@ func (hc *houstonClient) launch(meta *procmeta) error {
exporter := newExporterForPrometheus()
accessor := exporter.registMetric(hc.config.MetricNamespace, metric)
prometheus.Register(exporter)
metricValues[metric.Key] = accessor
logger.Println("metric registered :", metric)
if err := prometheus.Register(exporter); err != nil {
logger.Println("prometheus.Register error :", err)
} else {
metricValues[metric.Key] = accessor
logger.Println("metric registered :", metric)
}
}
} else {
keybytes := metricBuffer[:8]
valbits := binary.BigEndian.Uint64(metricBuffer[8:])
valbits := binary.LittleEndian.Uint64(metricBuffer[8:])
val := math.Float64frombits(valbits)
if accessor, ok := metricValues[string(keybytes)]; ok {