mirror of
https://github.com/ClusterCockpit/cc-metric-store.git
synced 2024-11-10 05:07:25 +01:00
Reduce gc target percentage
This commit is contained in:
parent
720924a7dd
commit
0b66f7c5d7
@ -9,6 +9,8 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"runtime"
|
||||||
|
"runtime/debug"
|
||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
@ -240,6 +242,8 @@ func main() {
|
|||||||
log.Printf("Checkpoints loaded (%d files, that took %dms)\n", files, time.Since(startupTime).Milliseconds())
|
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())
|
ctx, shutdown := context.WithCancel(context.Background())
|
||||||
|
|
||||||
var wg sync.WaitGroup
|
var wg sync.WaitGroup
|
||||||
|
4
float.go
4
float.go
@ -23,7 +23,7 @@ func (f Float) MarshalJSON() ([]byte, error) {
|
|||||||
return nullAsBytes, nil
|
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 {
|
func (f *Float) UnmarshalJSON(input []byte) error {
|
||||||
@ -54,7 +54,7 @@ func (fa FloatArray) MarshalJSON() ([]byte, error) {
|
|||||||
if fa[i].IsNaN() {
|
if fa[i].IsNaN() {
|
||||||
buf = append(buf, `null`...)
|
buf = append(buf, `null`...)
|
||||||
} else {
|
} 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