Skip to content

Commit 97e9af2

Browse files
authored
Merge branch 'main' into feat/arm64-runtime-guards
2 parents 32ed031 + f88976c commit 97e9af2

File tree

44 files changed

+374
-163
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+374
-163
lines changed

packages/api/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ require (
5454
go.opentelemetry.io/otel/trace v1.41.0
5555
go.uber.org/zap v1.27.1
5656
golang.org/x/net v0.50.0
57-
golang.org/x/sync v0.19.0
57+
golang.org/x/sync v0.20.0
5858
google.golang.org/grpc v1.79.3
5959
google.golang.org/protobuf v1.36.11
6060
)
@@ -380,11 +380,11 @@ require (
380380
golang.org/x/arch v0.18.0 // indirect
381381
golang.org/x/crypto v0.48.0 // indirect
382382
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
383-
golang.org/x/image v0.25.0 // indirect
383+
golang.org/x/image v0.38.0 // indirect
384384
golang.org/x/mod v0.33.0 // indirect
385385
golang.org/x/oauth2 v0.34.0 // indirect
386386
golang.org/x/sys v0.41.0 // indirect
387-
golang.org/x/text v0.34.0 // indirect
387+
golang.org/x/text v0.35.0 // indirect
388388
golang.org/x/time v0.14.0 // indirect
389389
golang.org/x/tools v0.42.0 // indirect
390390
google.golang.org/api v0.257.0 // indirect

packages/api/go.sum

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/auth/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ require (
123123
golang.org/x/arch v0.18.0 // indirect
124124
golang.org/x/crypto v0.48.0 // indirect
125125
golang.org/x/net v0.50.0 // indirect
126-
golang.org/x/sync v0.19.0 // indirect
126+
golang.org/x/sync v0.20.0 // indirect
127127
golang.org/x/sys v0.41.0 // indirect
128-
golang.org/x/text v0.34.0 // indirect
128+
golang.org/x/text v0.35.0 // indirect
129129
google.golang.org/genproto/googleapis/api v0.0.0-20251213004720-97cd9d5aeac2 // indirect
130130
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect
131131
google.golang.org/grpc v1.79.3 // indirect

packages/auth/go.sum

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/clickhouse/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ require (
9595
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
9696
golang.org/x/mod v0.33.0 // indirect
9797
golang.org/x/net v0.50.0 // indirect
98-
golang.org/x/sync v0.19.0 // indirect
98+
golang.org/x/sync v0.20.0 // indirect
9999
golang.org/x/sys v0.41.0 // indirect
100-
golang.org/x/text v0.34.0 // indirect
100+
golang.org/x/text v0.35.0 // indirect
101101
google.golang.org/genproto/googleapis/api v0.0.0-20251213004720-97cd9d5aeac2 // indirect
102102
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect
103103
google.golang.org/grpc v1.79.3 // indirect

packages/clickhouse/go.sum

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
-- +goose Up
2+
-- +goose StatementBegin
3+
ALTER TABLE sandbox_host_stats_local
4+
ADD COLUMN IF NOT EXISTS delta_cgroup_cpu_usage_usec UInt64 DEFAULT 0 CODEC (ZSTD(1)),
5+
ADD COLUMN IF NOT EXISTS delta_cgroup_cpu_user_usec UInt64 DEFAULT 0 CODEC (ZSTD(1)),
6+
ADD COLUMN IF NOT EXISTS delta_cgroup_cpu_system_usec UInt64 DEFAULT 0 CODEC (ZSTD(1)),
7+
ADD COLUMN IF NOT EXISTS interval_us UInt64 DEFAULT 0 CODEC (ZSTD(1));
8+
-- +goose StatementEnd
9+
10+
-- +goose StatementBegin
11+
ALTER TABLE sandbox_host_stats
12+
ADD COLUMN IF NOT EXISTS delta_cgroup_cpu_usage_usec UInt64 DEFAULT 0 CODEC (ZSTD(1)),
13+
ADD COLUMN IF NOT EXISTS delta_cgroup_cpu_user_usec UInt64 DEFAULT 0 CODEC (ZSTD(1)),
14+
ADD COLUMN IF NOT EXISTS delta_cgroup_cpu_system_usec UInt64 DEFAULT 0 CODEC (ZSTD(1)),
15+
ADD COLUMN IF NOT EXISTS interval_us UInt64 DEFAULT 0 CODEC (ZSTD(1));
16+
-- +goose StatementEnd
17+
18+
-- +goose Down
19+
-- +goose StatementBegin
20+
ALTER TABLE sandbox_host_stats
21+
DROP COLUMN IF EXISTS delta_cgroup_cpu_usage_usec,
22+
DROP COLUMN IF EXISTS delta_cgroup_cpu_user_usec,
23+
DROP COLUMN IF EXISTS delta_cgroup_cpu_system_usec,
24+
DROP COLUMN IF EXISTS interval_us;
25+
-- +goose StatementEnd
26+
27+
-- +goose StatementBegin
28+
ALTER TABLE sandbox_host_stats_local
29+
DROP COLUMN IF EXISTS delta_cgroup_cpu_usage_usec,
30+
DROP COLUMN IF EXISTS delta_cgroup_cpu_user_usec,
31+
DROP COLUMN IF EXISTS delta_cgroup_cpu_system_usec,
32+
DROP COLUMN IF EXISTS interval_us;
33+
-- +goose StatementEnd

packages/clickhouse/pkg/hoststats/delivery.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ const InsertSandboxHostStatQuery = `INSERT INTO sandbox_host_stats
2828
cgroup_cpu_system_usec,
2929
cgroup_memory_usage_bytes,
3030
cgroup_memory_peak_bytes,
31+
delta_cgroup_cpu_usage_usec,
32+
delta_cgroup_cpu_user_usec,
33+
delta_cgroup_cpu_system_usec,
34+
interval_us,
3135
sandbox_type
3236
)
33-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
37+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`
3438

3539
type ClickhouseDelivery struct {
3640
batcher *batcher.Batcher[SandboxHostStat]
@@ -116,6 +120,10 @@ func (c *ClickhouseDelivery) batchInserter(ctx context.Context, stats []SandboxH
116120
stat.CgroupCPUSystemUsec,
117121
stat.CgroupMemoryUsage,
118122
stat.CgroupMemoryPeak,
123+
stat.DeltaCgroupCPUUsageUsec,
124+
stat.DeltaCgroupCPUUserUsec,
125+
stat.DeltaCgroupCPUSystemUsec,
126+
stat.IntervalUs,
119127
stat.SandboxType,
120128
)
121129
if err != nil {

packages/clickhouse/pkg/hoststats/hoststats.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,19 @@ type SandboxHostStat struct {
2020
SandboxVCPUCount int64 `ch:"sandbox_vcpu_count"` // number of virtual CPUs allocated to the sandbox
2121
SandboxMemoryMB int64 `ch:"sandbox_memory_mb"` // total memory allocated to the sandbox in megabytes
2222

23-
// Cgroup v2 accounting — cumulative CPU values, deltas calculated in queries
23+
// Cgroup v2 accounting — cumulative CPU counters
2424
CgroupCPUUsageUsec uint64 `ch:"cgroup_cpu_usage_usec"` // cumulative, microseconds
2525
CgroupCPUUserUsec uint64 `ch:"cgroup_cpu_user_usec"` // cumulative, microseconds
2626
CgroupCPUSystemUsec uint64 `ch:"cgroup_cpu_system_usec"` // cumulative, microseconds
2727
CgroupMemoryUsage uint64 `ch:"cgroup_memory_usage_bytes"` // current, bytes
2828
CgroupMemoryPeak uint64 `ch:"cgroup_memory_peak_bytes"` // lifetime peak, bytes
2929

30+
// Pre-computed deltas between consecutive samples.
31+
DeltaCgroupCPUUsageUsec uint64 `ch:"delta_cgroup_cpu_usage_usec"`
32+
DeltaCgroupCPUUserUsec uint64 `ch:"delta_cgroup_cpu_user_usec"`
33+
DeltaCgroupCPUSystemUsec uint64 `ch:"delta_cgroup_cpu_system_usec"`
34+
IntervalUs uint64 `ch:"interval_us"` // microseconds since previous sample
35+
3036
SandboxType string `ch:"sandbox_type"` // "sandbox" or "build"
3137
}
3238

packages/client-proxy/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ require (
6565
golang.org/x/exp v0.0.0-20260212183809-81e46e3db34a // indirect
6666
golang.org/x/mod v0.33.0 // indirect
6767
golang.org/x/net v0.50.0 // indirect
68-
golang.org/x/sync v0.19.0 // indirect
68+
golang.org/x/sync v0.20.0 // indirect
6969
golang.org/x/sys v0.41.0 // indirect
70-
golang.org/x/text v0.34.0 // indirect
70+
golang.org/x/text v0.35.0 // indirect
7171
google.golang.org/genproto/googleapis/api v0.0.0-20251213004720-97cd9d5aeac2 // indirect
7272
google.golang.org/genproto/googleapis/rpc v0.0.0-20260128011058-8636f8732409 // indirect
7373
google.golang.org/protobuf v1.36.11 // indirect

0 commit comments

Comments
 (0)