Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor of system/memory metricset #26334

Merged
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
a8003d0
init commit
fearful-symmetry Jun 3, 2021
cc898a1
start on linux implementation
fearful-symmetry Jun 4, 2021
b243bd0
finish linux, start work on darwin
fearful-symmetry Jun 8, 2021
59fc7d4
fix build platform issues
fearful-symmetry Jun 8, 2021
f51e0bf
fix metrics on darwin
fearful-symmetry Jun 8, 2021
484d064
add openbsd
fearful-symmetry Jun 8, 2021
fa17efd
add freebsd
fearful-symmetry Jun 9, 2021
d9da0ea
add windows, aix
fearful-symmetry Jun 9, 2021
6fea17d
fix aix build
fearful-symmetry Jun 9, 2021
b89318b
finish memory
fearful-symmetry Jun 9, 2021
13fe38c
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 15, 2021
44065b3
fix up opt changes
fearful-symmetry Jun 15, 2021
cd760cb
cleanup metricset code
fearful-symmetry Jun 15, 2021
4cec2e0
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 15, 2021
4e6618c
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 15, 2021
7c93b60
fix up folder methods
fearful-symmetry Jun 16, 2021
5b28daa
fix calculations, Opt API, gomod
fearful-symmetry Jun 16, 2021
a517ecb
make notice
fearful-symmetry Jun 17, 2021
fd8cb86
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 17, 2021
dd6a0e1
go mod tidy, mage fmt
fearful-symmetry Jun 17, 2021
87aaeaa
fix up linux/memory
fearful-symmetry Jun 21, 2021
0574d52
update fields
fearful-symmetry Jun 22, 2021
4753d23
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 23, 2021
c7fb4e7
update system tests
fearful-symmetry Jun 23, 2021
6c0bc54
fix system tests, again
fearful-symmetry Jun 23, 2021
316c501
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 23, 2021
5088c94
fix extra print statements
fearful-symmetry Jun 23, 2021
7b52da1
fix if block in fillPercentages
fearful-symmetry Jun 23, 2021
28fb3c9
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 24, 2021
d5f5ea1
vix Value API
fearful-symmetry Jun 24, 2021
0c12bd9
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 28, 2021
7e57c13
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 28, 2021
5ff4463
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 28, 2021
e3e5542
Merge remote-tracking branch 'upstream/master' into system-refactor-m…
fearful-symmetry Jun 29, 2021
8212fee
fix up tests, opt
fearful-symmetry Jun 29, 2021
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
424 changes: 212 additions & 212 deletions NOTICE.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ require (
github.com/elastic/go-sysinfo v1.7.0
github.com/elastic/go-txfile v0.0.7
github.com/elastic/go-ucfg v0.8.3
github.com/elastic/go-windows v1.0.1 // indirect
github.com/elastic/go-windows v1.0.1
github.com/elastic/gosigar v0.14.1
github.com/fatih/color v1.9.0
github.com/fsnotify/fsevents v0.1.1
Expand Down
172 changes: 0 additions & 172 deletions libbeat/metric/system/memory/memory.go

This file was deleted.

96 changes: 0 additions & 96 deletions libbeat/metric/system/memory/memory_test.go

This file was deleted.

16 changes: 12 additions & 4 deletions libbeat/metric/system/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/elastic/beats/v7/libbeat/common"
"github.com/elastic/beats/v7/libbeat/common/match"
"github.com/elastic/beats/v7/libbeat/logp"
"github.com/elastic/beats/v7/libbeat/metric/system/memory"
sysinfo "github.com/elastic/go-sysinfo"
sigar "github.com/elastic/gosigar"
"github.com/elastic/gosigar/cgroup"
)
Expand Down Expand Up @@ -288,12 +288,20 @@ func GetOwnResourceUsageTimeInMillis() (int64, int64, error) {

func (procStats *Stats) getProcessEvent(process *Process) common.MapStr {

// This is a holdover until we migrate this library to metricbeat/internal
// At which point we'll use the memory code there.
var totalPhyMem uint64
baseMem, err := memory.Get()
host, err := sysinfo.Host()
if err != nil {
procStats.logger.Warnf("Getting memory details: %v", err)
procStats.logger.Warnf("Getting host details: %v", err)
} else {
totalPhyMem = baseMem.Mem.Total
memStats, err := host.Memory()
if err != nil {
procStats.logger.Warnf("Getting memory details: %v", err)
} else {
totalPhyMem = memStats.Total
}

}

proc := common.MapStr{
Expand Down
12 changes: 12 additions & 0 deletions metricbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -50409,6 +50409,18 @@ format: bytes
The total amount of free memory in bytes. This value does not include memory consumed by system caches and buffers (see system.memory.actual.free).


type: long

format: bytes

--

*`system.memory.cached`*::
+
--
Total Cached memory on system.


type: long

format: bytes
Expand Down
Loading