Skip to content

Commit

Permalink
deprecate system.mem.used.all metric (#485)
Browse files Browse the repository at this point in the history
* deprecate used all metric
  • Loading branch information
aphralG authored Oct 3, 2023
1 parent 70ffa9d commit f1a7a51
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/core/metrics/metrics_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ func GetCalculationMap() map[string]string {
"system.mem.shared": "avg",
"system.mem.total": "avg",
"system.mem.used": "avg",
"system.mem.used.all": "avg",
"system.load.1": "avg",
"system.load.15": "avg",
"system.load.5": "avg",
Expand Down
3 changes: 1 addition & 2 deletions src/core/metrics/sources/mem.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ func (c *VirtualMemory) Collect(ctx context.Context, wg *sync.WaitGroup, m chan<

simpleMetrics := c.convertSamplesToSimpleMetrics(map[string]float64{
"total": float64(memstats.Total),
"used": float64(memstats.Total - memstats.Available),
"used.all": float64(memstats.Used),
"used": float64(memstats.Used),
"cached": float64(memstats.Cached),
"buffered": float64(memstats.Buffers),
"shared": float64(memstats.Shared),
Expand Down
1 change: 0 additions & 1 deletion src/core/metrics/sources/mem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func TestVirtualMemoryCollect(t *testing.T) {
"test.mem.shared",
"test.mem.total",
"test.mem.used",
"test.mem.used.all",
}

assert.Equal(t, expected, actualMetricNames)
Expand Down
4 changes: 0 additions & 4 deletions test/integration/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ func TestAPI_Metrics(t *testing.T) {
value, _ := strconv.ParseFloat(metric[1], 64)
assert.Greater(t, value, float64(0))

case strings.Contains(metric[0], "system_mem_used_all"):
value, _ := strconv.ParseFloat(metric[1], 64)
assert.Greater(t, value, float64(0))

case strings.Contains(metric[0], "container_cpu_cores"):
value, _ := strconv.ParseFloat(metric[1], 64)
assert.Greater(t, value, float64(0))
Expand Down
5 changes: 3 additions & 2 deletions test/integration/grpc/grpc_config_apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@ messageLoop:
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Send config apply message

err := commandService.SendConfigApply(nginxId, tt.nginxConfigFileName, tt.messageId)
response, err := utils.ExecuteCommand(testContainer, []string{"ps", "-ef", "|", "grep", "nginx"})
t.Logf("response: %v", response)
err = commandService.SendConfigApply(nginxId, tt.nginxConfigFileName, tt.messageId)
assert.NoError(t, err)

// Validate that the config apply is successful
Expand Down

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

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

0 comments on commit f1a7a51

Please sign in to comment.