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

collect memory metrics of osx #84

Merged
merged 6 commits into from May 8, 2015

Conversation

Projects
None yet
2 participants
@Songmu
Member

Songmu commented May 6, 2015

Retrieve memroy metrics from vm_stat command.
These values are almost same as Activity Monitor.

ref. https://support.apple.com/en-us/HT201464#memory

Songmu added a commit that referenced this pull request May 8, 2015

Merge pull request #84 from mackerelio/feature/mac-memory
collect memory metrics of osx

@Songmu Songmu merged commit c0d4f0a into master May 8, 2015

3 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@Songmu Songmu deleted the feature/mac-memory branch May 8, 2015

@Songmu Songmu referenced this pull request May 8, 2015

Merged

Release version 0.16.0 #88

var memoryLogger = logging.GetLogger("metrics.memory")
var statReg = regexp.MustCompile(`^(.+):\s+([0-9]+)\.$`)
var swapReg = regexp.MustCompile(`([0-9]+(?:\.[0-9]+))?M[^0-9]*([0-9]+(?:\.[0-9]+)?)M[^0-9]*([0-9]+(?:\.[0-9]+)?)M`)

This comment has been minimized.

@mechairoi

mechairoi May 8, 2015

Contributor

Swap the second ? for ) ?

f, _ := strconv.ParseFloat(matches[3], 64)
ret["memory.swap_total"] = t * 1024 * 1024
ret["memory.swap_free"] = f * 1024 * 1024
}

This comment has been minimized.

@mechairoi

mechairoi May 8, 2015

Contributor

[nit] I think it is better to Errorf also when match is failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment