Fixed ci to pass, removed pyroscope

This commit is contained in:
2025-07-30 20:06:22 +03:00
parent fb8fba2265
commit 77dc3bf32f
4 changed files with 33 additions and 29 deletions

View File

@@ -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,
// },
// })
// }

View File

@@ -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
}

View File

@@ -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")

View File

@@ -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)
}