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

Darwin support #3

Open
luk- opened this issue Dec 7, 2013 · 11 comments
Open

Darwin support #3

luk- opened this issue Dec 7, 2013 · 11 comments
Labels

Comments

@luk-
Copy link

luk- commented Dec 7, 2013

Is there any unsolvable reason that we can't give this support on OS X?

If not, I can prepare a patch.

@rohiniwork
Copy link
Contributor

Luk,

The module uses pthread functions to create a thread and monitor the main process.

I havent tried with OS X, go ahead and test it and let us know if that works and we can update the description.

Although, you might have to try writing a different "i_am_monitoring" file because this one uses "unix_dgram"

@luk-
Copy link
Author

luk- commented Dec 17, 2013

@rohiniwork

The only thing keeping it from building on OS X is this:

https://gist.github.com/luk-/8011914

If I modify that, it will build fine. I'm not sure how the error handling in C++ differs when building on darwin.

@davglass
Copy link

I'm pretty sure just fixing that isn't going to make it fully work. This module inspects the /proc filesystem on Linux to get at it's information. This would need to be re-written to support Darwin. (it's probably possible but not straight forward).

@rohiniwork
Copy link
Contributor

Dav is right, you will have to re write the stats info reading and parsing logic for whatever system you want to add support to.

May be think of modularizing that piece before you add more OS support.

@luk-
Copy link
Author

luk- commented Dec 17, 2013

I guess I got ahead of myself :)

On Tuesday, December 17, 2013, rohiniwork wrote:

Dav is right, you will have to re write the stats info reading and parsing
logic for whatever system you want to add support to.

May be think of modularizing that piece before you add more OS support.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-30794578
.

@qzaidi
Copy link

qzaidi commented Jan 14, 2014

We can usage getrusage instead of /proc, that will work on both linux and mac. I am willing to devote some free time to it.

@davglass
Copy link

I just happen to have a module for that already :)

https://github.com/davglass/node-getrusage

@qzaidi
Copy link

qzaidi commented Jan 15, 2014

Very interesting - I had a go at this and ended up using times() (less portable than getrusage, but more convenient), and mainly have trouble getting total cpu time on mac portably (equivalent of /proc/stat/). Currently considering mach_absolute_time() for this.

@hay-wire
Copy link

@luk- Hey! This seems cool. I wanted to run monitr on my mac. Any leads to integrate your pulls? Also why was development on this tool discontinued? Last commit seems pretty old.

@davglass
Copy link

@hay-wire - I'm not sure if anyone started looking back into this one, but we tragically lost @luk back in 2014 so he never got the chance to continue working on this.

@hay-wire
Copy link

@davglass I'm really sorry to hear that. Looks like I've a bad day today.. hearing only losses since morning.
I will just try Luk's PR and write back the findings.

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

Successfully merging a pull request may close this issue.

5 participants