Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 39 additions & 39 deletions api/proto/common/yagpcc_metrics.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions api/proto/common/yagpcc_metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ message SpillInfo {
// See https://pkg.go.dev/github.com/prometheus/procfs#ProcStat
message ProcStat {
// The process ID.
int32 pid = 1;
int64 pid = 1;

// The filename of the executable.
string comm = 2;
Expand All @@ -586,7 +586,7 @@ message ProcStat {
string state = 3;

// The PID of the parent of this process.
int32 ppid = 4;
int64 ppid = 4;

// The process group ID of the process.
int32 pgrp = 5;
Expand All @@ -606,35 +606,35 @@ message ProcStat {

// The number of minor faults the process has made which have not required
// loading a memory page from disk.
int32 min_flt = 10;
int64 min_flt = 10;

// The number of minor faults that the process's waited-for children have
// made.
int32 cmin_flt = 11;
int64 cmin_flt = 11;

// The number of major faults the process has made which have required
// loading a memory page from disk.
int32 maj_flt = 12;
int64 maj_flt = 12;

// The number of major faults that the process's waited-for children have
// made.
int32 cmaj_flt = 13;
int64 cmaj_flt = 13;

// Amount of time that this process has been scheduled in user mode,
// measured in clock ticks.
int32 utime = 14;
int64 utime = 14;

// Amount of time that this process has been scheduled in kernel mode,
// measured in clock ticks.
int32 stime = 15;
int64 stime = 15;

// Amount of time that this process's waited-for children have been
// scheduled in user mode, measured in clock ticks.
int32 cutime = 16;
int64 cutime = 16;

// Amount of time that this process's waited-for children have been
// scheduled in kernel mode, measured in clock ticks.
int32 cstime = 17;
int64 cstime = 17;

// For processes running a real-time scheduling policy, this is the negated
// scheduling priority, minus one.
Expand Down Expand Up @@ -684,18 +684,18 @@ message ProcStat {

// Guest time of the process (time spent running a virtual CPU for a guest
// operating system), measured in clock ticks.
int32 guest_time = 32;
int64 guest_time = 32;

// Guest time of the process's children, measured in clock ticks.
int32 cguest_time = 33;
int64 cguest_time = 33;
}

// ProcStatus provides status information about the process,
// read from /proc/[pid]/status.
// See https://pkg.go.dev/github.com/prometheus/procfs@v0.20.1#ProcStatus
message ProcStatus {
// The process ID.
int32 pid = 1;
int64 pid = 1;

// The process name.
string name = 2;
Expand Down
3 changes: 2 additions & 1 deletion internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,12 +382,13 @@ func Run(ctx context.Context, configFile string) error {
metrics.YagpccMetrics.ExecutingQueryLatencies.AssignQueryGetter(rqStorage.GetQueriesStartTime)
aggStorage := storage.NewConfiguredAggregatedStorage(logger, cfg)
sessionsStorage := gp.NewSessionsStorage(rqStorage)
procfsStorage := storage.NewProcfsStorage()

masterConnection := gp.NewConnection(baseApp.L(), &cfg.MasterConnection, nil)

masterSentinel := master_sentinel.NewSentinel(baseApp.L(), masterConnection)
statActivityLister := stat_activity.NewLister(baseApp.L(), masterConnection)
backgroundStorage := master.NewBackgroundStorage(logger, sessionsStorage, rqStorage, aggStorage, statActivityLister)
backgroundStorage := master.NewBackgroundStorage(logger, sessionsStorage, rqStorage, aggStorage, procfsStorage, statActivityLister)

agentApp, err := NewApp(baseApp, cfg, statActivityLister, backgroundStorage)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type Config struct {
ShortAggInterval time.Duration `config:"short_agg_interval" yaml:"short_agg_interval"`
SessionRefreshInterval time.Duration `config:"session_refresh_interval" yaml:"session_refresh_interval"`
QueriesRefreshInterval time.Duration `config:"session_refresh_interval" yaml:"queries_refresh_interval"`
ProcfsRefreshInterval time.Duration `config:"procfs_refresh_interval" yaml:"procfs_refresh_interval"`
SessionSendMetricInterval time.Duration `config:"session_send_metric_interval" yaml:"session_send_metric_interval"`
MinFreePercent uint32 `config:"min_free_percent" yaml:"min_free_percent"`
CustomSegmentList *SegmentList `config:"custom_segment_list" yaml:"custom_segment_list"`
Expand Down Expand Up @@ -116,6 +117,7 @@ func DefaultConfig() (*Config, error) {
ShortAggInterval: time.Duration(time.Minute * 10),
SessionRefreshInterval: time.Duration(time.Second * 30),
QueriesRefreshInterval: time.Duration(time.Second * 1),
ProcfsRefreshInterval: time.Duration(time.Second * 60),
SessionSendMetricInterval: time.Duration(time.Second * 60),
MinFreePercent: 10,
CustomSegmentList: nil,
Expand Down
2 changes: 1 addition & 1 deletion internal/grpc/actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func newTestActionsServer(t *testing.T) *ActionsServer {
rq := storage.NewRunningQueriesStorage()
sessStorage := gp.NewSessionsStorage(rq)
agg := storage.NewAggregatedStorage(z)
bg := master.NewBackgroundStorage(z, sessStorage, rq, agg, nil)
bg := master.NewBackgroundStorage(z, sessStorage, rq, agg, nil, nil)
return &ActionsServer{
Logger: z,
Timeout: 5 * time.Second,
Expand Down
2 changes: 1 addition & 1 deletion internal/grpc/set_get_query_info_parallel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestParallelSetGet(t *testing.T) {
rqStorage := storage.NewRunningQueriesStorage()
aggStorage := storage.NewAggregatedStorage(zLogger)
sessStorage := gp.NewSessionsStorage(rqStorage)
backgroundStorage := master.NewBackgroundStorage(zLogger, sessStorage, rqStorage, aggStorage, nil)
backgroundStorage := master.NewBackgroundStorage(zLogger, sessStorage, rqStorage, aggStorage, nil, nil)

tests := []struct {
name string
Expand Down
3 changes: 2 additions & 1 deletion internal/grpc/testutils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ func setupGRPCClientSet(t *testing.T, sessionMocker *MockStatActivityLister) (*g
rqStorage := storage.NewRunningQueriesStorage()
sessStorage := gp.NewSessionsStorage(rqStorage)
aggStorage := storage.NewAggregatedStorage(zLogger)
backgroundStorage := master.NewBackgroundStorage(zLogger, sessStorage, rqStorage, aggStorage, sessionMocker)
procfsStorage := storage.NewProcfsStorage()
backgroundStorage := master.NewBackgroundStorage(zLogger, sessStorage, rqStorage, aggStorage, procfsStorage, sessionMocker)

conn, err := gogrpc.NewClient(
"localhost",
Expand Down
Loading
Loading