mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2024-12-26 00:49:05 +01:00
Reduce gc target percentage
This commit is contained in:
parent
720924a7dd
commit
0b66f7c5d7
@ -9,6 +9,8 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
@ -240,6 +242,8 @@ func main() {
|
||||
log.Printf("Checkpoints loaded (%d files, that took %dms)\n", files, time.Since(startupTime).Milliseconds())
|
||||
}
|
||||
|
||||
runtime.GC()
|
||||
debug.SetGCPercent(20)
|
||||
ctx, shutdown := context.WithCancel(context.Background())
|
||||
|
||||
var wg sync.WaitGroup
|
||||
|
4
float.go
4
float.go
@ -23,7 +23,7 @@ func (f Float) MarshalJSON() ([]byte, error) {
|
||||
return nullAsBytes, nil
|
||||
}
|
||||
|
||||
return strconv.AppendFloat(make([]byte, 0, 10), float64(f), 'f', 1, 32), nil
|
||||
return strconv.AppendFloat(make([]byte, 0, 10), float64(f), 'f', -1, 64), nil
|
||||
}
|
||||
|
||||
func (f *Float) UnmarshalJSON(input []byte) error {
|
||||
@ -54,7 +54,7 @@ func (fa FloatArray) MarshalJSON() ([]byte, error) {
|
||||
if fa[i].IsNaN() {
|
||||
buf = append(buf, `null`...)
|
||||
} else {
|
||||
buf = strconv.AppendFloat(buf, float64(fa[i]), 'f', 1, 32)
|
||||
buf = strconv.AppendFloat(buf, float64(fa[i]), 'f', -1, 64)
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user