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

Fix memory reporting on FreeBSD #106

Merged
merged 3 commits into from
Jul 16, 2018
Merged

Fix memory reporting on FreeBSD #106

merged 3 commits into from
Jul 16, 2018

Conversation

michbsd
Copy link

@michbsd michbsd commented Jun 7, 2018

and move (self *Mem) function from sigar_linux_common to sigar_linux

@jsoriano
Copy link
Member

jsoriano commented Jun 7, 2018

@michbsd thanks for this PR, travis found some formatting errors, can you take a look? You can fix them with gofmt -w ..

sigar_freebsd.go Outdated
if err != nil {
return err
}
self.Free = uint64(val)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this value the number of pages? Free is expected to be in bytes, we should probably multiply here by pagesize.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's done later down:

self.Used = self.Total - (self.Free * pagesize)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I mean to store the size in bytes in self.Free, i.e:

self.Free = uint64(val) * pagesize

self.Free is the value that will be used at the end for the free memory metrics.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha. fixed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, it looks good now :)

@michbsd
Copy link
Author

michbsd commented Jul 16, 2018

ping - any news on this?
thanks

@jsoriano jsoriano merged commit 33b3bbd into elastic:master Jul 16, 2018
@jsoriano
Copy link
Member

@michbsd merged, sorry for the delay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants