Skip to content
This repository has been archived by the owner on Mar 4, 2022. It is now read-only.

Support for Meteor #24

Open
srbdev opened this issue Oct 14, 2016 · 3 comments
Open

Support for Meteor #24

srbdev opened this issue Oct 14, 2016 · 3 comments

Comments

@srbdev
Copy link

srbdev commented Oct 14, 2016

This is more of an idea and/or feature request, if at all possible. It would be useful to have this data while developing a Meteor application.

Thanks for the tool!

@jbonigomes
Copy link

I work with Meteor too, would be really nice to see it there

@nlhuykhang
Copy link

I was able to get this module working with Meteor. All it needs to do is to modify the Meteor's execution script:

  • The script is: /Users/username/.meteor/meteor (if you are on MacOS)
  • Replace the last line used to start node server at the bottom with these lines:
function npm_package_is_installed {
  # set to 1 initially
  local return_=1
  # set to 0 if not found
  ls node_modules | grep $1 >/dev/null 2>&1 || { local return_=0; }
  # return value
  echo "$return_"
}

NODEJS_DASHBOARD="$(which nodejs-dashboard)"
ARR=("" "run" "--settings")

if [[ $1 == "--dashboard" ]] && [[ " ${ARR[*]} " == *" $2 "* ]]; then
  if [[ ! -n "${NODEJS_DASHBOARD}" ]]; then
    echo "nodejs-dashboard is not installed globally"
    exit 1
  fi
  if [[ "$(npm_package_is_installed nodejs-dashboard)" == "0" ]]; then
    echo "Please install nodejs-dashboard to you project"
    exit 1
  fi
  shift
  exec "$NODEJS_DASHBOARD" "--" "$DEV_BUNDLE/bin/node" "-r" "nodejs-dashboard" ${TOOL_NODE_FLAGS} "$METEOR" "$@"
else
  exec "$DEV_BUNDLE/bin/node" ${TOOL_NODE_FLAGS} "$METEOR" "$@"
fi

Then you will need to add --dashboard option to meteor command to run with nodejs-dashboard. Without --dashboard, it will works normally.

meteor --dashboard
meteor --dashboard --settings settings.json
meteor --dashboard run
meteor --dashboard run --settings settings.json

Also, your Meteor project should have version 1.4., otherwise the measurement for cpu and memory may not work. This is because Meteor 1.3 and older run with Node 0.10. which seems uncompatible with this module.

@PEM--
Copy link

PEM-- commented Dec 23, 2016

@nlhuykhang That would be a pretty nice addition to Meteor. Do you intend to push a PR on their repo?

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

No branches or pull requests

5 participants