mirror of
https://github.com/Kyren223/eko.git
synced 2026-05-03 18:24:40 +00:00
Fixed ci to pass, removed pyroscope
This commit is contained in:
@@ -29,9 +29,9 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/grafana/pyroscope-go"
|
||||
_ "github.com/grafana/pyroscope-go/godeltaprof/http/pprof"
|
||||
_ "net/http/pprof"
|
||||
// "github.com/grafana/pyroscope-go"
|
||||
// _ "github.com/grafana/pyroscope-go/godeltaprof/http/pprof"
|
||||
// _ "net/http/pprof"
|
||||
|
||||
"github.com/kyren223/eko/embeds"
|
||||
"github.com/kyren223/eko/internal/server"
|
||||
@@ -73,7 +73,7 @@ func main() {
|
||||
handleReload()
|
||||
handleShutdown(cancel)
|
||||
|
||||
startPyroscopeProfiling()
|
||||
// startPyroscopeProfiling()
|
||||
|
||||
if ok := reloadTosAndPrivacy(); !ok {
|
||||
return
|
||||
@@ -226,24 +226,24 @@ func reloadTosAndPrivacy() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func startPyroscopeProfiling() {
|
||||
pyroscope.Start(pyroscope.Config{
|
||||
ApplicationName: "eko",
|
||||
ServerAddress: "http://localhost:4040",
|
||||
Logger: pyroscope.StandardLogger, // nil to disable
|
||||
// by default all profilers are enabled,
|
||||
// but you can select the ones you want to use:
|
||||
ProfileTypes: []pyroscope.ProfileType{
|
||||
pyroscope.ProfileCPU,
|
||||
pyroscope.ProfileAllocObjects,
|
||||
pyroscope.ProfileAllocSpace,
|
||||
pyroscope.ProfileInuseObjects,
|
||||
pyroscope.ProfileInuseSpace,
|
||||
pyroscope.ProfileGoroutines,
|
||||
pyroscope.ProfileMutexCount,
|
||||
pyroscope.ProfileMutexCount,
|
||||
pyroscope.ProfileBlockCount,
|
||||
pyroscope.ProfileBlockDuration,
|
||||
},
|
||||
})
|
||||
}
|
||||
// func startPyroscopeProfiling() {
|
||||
// pyroscope.Start(pyroscope.Config{
|
||||
// ApplicationName: "eko",
|
||||
// ServerAddress: "http://localhost:4040",
|
||||
// Logger: pyroscope.StandardLogger, // nil to disable
|
||||
// // by default all profilers are enabled,
|
||||
// // but you can select the ones you want to use:
|
||||
// ProfileTypes: []pyroscope.ProfileType{
|
||||
// pyroscope.ProfileCPU,
|
||||
// pyroscope.ProfileAllocObjects,
|
||||
// pyroscope.ProfileAllocSpace,
|
||||
// pyroscope.ProfileInuseObjects,
|
||||
// pyroscope.ProfileInuseSpace,
|
||||
// pyroscope.ProfileGoroutines,
|
||||
// pyroscope.ProfileMutexCount,
|
||||
// pyroscope.ProfileMutexCount,
|
||||
// pyroscope.ProfileBlockCount,
|
||||
// pyroscope.ProfileBlockDuration,
|
||||
// },
|
||||
// })
|
||||
// }
|
||||
|
||||
@@ -1728,13 +1728,17 @@ func DeviceAnalytics(ctx context.Context, sess *session.Session, request *packet
|
||||
|
||||
sess.SetAnalytics(request)
|
||||
queries := data.New(db)
|
||||
queries.SetDeviceAnalytics(ctx, data.SetDeviceAnalyticsParams{
|
||||
_, err := queries.SetDeviceAnalytics(ctx, data.SetDeviceAnalyticsParams{
|
||||
DeviceID: request.DeviceID,
|
||||
Os: &request.OS,
|
||||
Arch: &request.Arch,
|
||||
Term: &request.Term,
|
||||
Colorterm: &request.Colorterm,
|
||||
})
|
||||
if err != nil {
|
||||
slog.ErrorContext(ctx, "database error", "error", err)
|
||||
return &ErrInternalError
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ type server struct {
|
||||
}
|
||||
}
|
||||
|
||||
// Creates a new server on the given port.
|
||||
// NewServer creates a new server on the given port.
|
||||
// Will generate a unique node ID automatically, will crash if there are no available IDs.
|
||||
func NewServer(ctx context.Context, port uint16) server {
|
||||
assert.Assert(nodeId <= snowflake.NodeMax, "maximum amount of servers reached")
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
const addr = "localhost:7223"
|
||||
|
||||
var tlsConfig = &tls.Config{
|
||||
InsecureSkipVerify: true, // skip cert verification
|
||||
InsecureSkipVerify: true, // #nosec G402 skip cert verification
|
||||
}
|
||||
|
||||
func connect(n int, label string) {
|
||||
@@ -27,7 +27,7 @@ func connect(n int, label string) {
|
||||
}
|
||||
time.Sleep(300 * time.Millisecond)
|
||||
for _, c := range conns {
|
||||
c.Close()
|
||||
_ = c.Close()
|
||||
}
|
||||
time.Sleep(200 * time.Millisecond)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user