{"id":15069824,"url":"https://github.com/runtimetools/appmetrics-dash","last_synced_at":"2025-05-16T15:06:45.170Z","repository":{"id":54284523,"uuid":"41477286","full_name":"RuntimeTools/appmetrics-dash","owner":"RuntimeTools","description":"A data visualizer that uses \" Node Application Metrics\" (appmetrics) to monitor and display Node.js application data as a html web application.","archived":false,"fork":false,"pushed_at":"2021-02-26T15:45:03.000Z","size":1358,"stargazers_count":459,"open_issues_count":35,"forks_count":56,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-09T21:32:04.940Z","etag":null,"topics":["appmetrics","appmetrics-dash","dashboard","metrics-visualization","monitoring-visualization","node-application-metrics","node-js","nodejs","performance-visualization"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RuntimeTools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-27T09:17:36.000Z","updated_at":"2025-02-12T06:22:25.000Z","dependencies_parsed_at":"2022-08-13T11:00:30.330Z","dependency_job_id":null,"html_url":"https://github.com/RuntimeTools/appmetrics-dash","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuntimeTools%2Fappmetrics-dash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuntimeTools%2Fappmetrics-dash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuntimeTools%2Fappmetrics-dash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RuntimeTools%2Fappmetrics-dash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RuntimeTools","download_url":"https://codeload.github.com/RuntimeTools/appmetrics-dash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553959,"owners_count":22090417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appmetrics","appmetrics-dash","dashboard","metrics-visualization","monitoring-visualization","node-application-metrics","node-js","nodejs","performance-visualization"],"created_at":"2024-09-25T01:44:55.369Z","updated_at":"2025-05-16T15:06:45.147Z","avatar_url":"https://github.com/RuntimeTools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node Application Metrics Dashboard\n\n[![Build Status](https://travis-ci.org/RuntimeTools/appmetrics-dash.svg?branch=master)](https://travis-ci.org/RuntimeTools/appmetrics-dash)\n[![codebeat badge](https://codebeat.co/badges/52b7334d-70b0-4659-9acb-b080d6413906)](https://codebeat.co/projects/github-com-runtimetools-appmetrics-dash-master)\n[![codecov.io](https://codecov.io/github/RuntimeTools/appmetrics-dash/coverage.svg?branch=master)](https://codecov.io/github/RuntimeTools/appmetrics-dash?branch=master)\n![Apache 2](https://img.shields.io/badge/license-Apache2-blue.svg?style=flat)\n[![Homepage](https://img.shields.io/badge/homepage-Node%20Application%20Metrics-blue.svg)](https://developer.ibm.com/node/monitoring-post-mortem/application-metrics-node-js/)\n[![Module LTS Adopted'](https://img.shields.io/badge/Module%20LTS-Adopted-brightgreen.svg?style=flat)](http://github.com/CloudNativeJS/ModuleLTS)\n[![IBM Support](https://img.shields.io/badge/Support-IBM%20Runtimes-brightgreen.svg?style=flat)](http://ibm.biz/node-support)\n\n[Node Application Metrics Dashboard](https://developer.ibm.com/node/monitoring-post-mortem/application-metrics-node-js/) (appmetrics-dash) provides a very easy-to-use web based dashboard to show the performance metrics of your running Node.js application.\n\n\u003cimg src=\"public/appmetrics.gif\" alt=\"appmetrics-dash in action\"/\u003e\n\nIf you want to add the dashboard to all HTTP servers created by your application then simply add:\n\n```js\n// Before all other 'require' statements:\nrequire('appmetrics-dash').attach();\n```\nto the very top of your main JavaScript source file.\n\nAlternatively, to use preloading:\n\n```sh\n$ node --require appmetrics-dash/attach app.js\n```\n\nor use the NODE_OPTIONS environment variable:\n\n```sh\n$ export NODE_OPTIONS=\"--require appmetrics-dash/attach\"\n```\n\nIf you want to add the dashboard to one specific HTTP server then use:\n\n```js\nvar dash = require('appmetrics-dash');\n// Other 'require' statements here\n// Create HTTP server 'myHttpServer' here\ndash.monitor({server: myHttpServer});\n```\nIf you are not creating an HTTP server then use:\n\n```js\n// Before all other 'require' statements:\nrequire('appmetrics-dash').monitor();\n```\n\nor run your program with\n\n```sh\n$ node --require appmetrics-dash/monitor app.js\n```\n\nor via the NODE_OPTIONS environment variable:\n\n```sh\n$ export NODE_OPTIONS=\"--require appmetrics-dash/monitor\"\n```\n\nThis creates a new server for the dashboard on port 3001 by default. The path defaults to ```/appmetrics-dash```.\nE.g. http://localhost:3001/appmetrics-dash\n\nThe data available on the dashboard is as follows:\n* CPU Profiling (via a separate tab)\n* HTTP Incoming Requests\n* HTTP Throughput\n* Average Reponse Times (top 5)\n* CPU\n* Memory\n* Heap\n* Event Loop Times\n* Environment\n* Other Requests\n* HTTP Outbound Requests\n\nAs well as displaying data, it also provides the ability to generate both [Node Report][2] and Heap Snapshots directly from the dashboard.  The Node Report will display in a new tab in the browser whilst the Heap Snapshot will be written to disk for loading into the Chrome DevTools for analysis.  These can both be triggered from the options menu in the top left of the screen\n\nThe dashboard uses [Node Application Metrics][1] to monitor the application. \n\n## Installation\n\n```console\nnpm install appmetrics-dash\n```\n\n## Performance overhead\n\nOur testing has shown that the performance overhead in terms of processing is minimal, adding less than 0.5 % to the CPU usage of your application. The additional memory required is around 30 MB to gather information about your system and application which is then visualized in the dashboard. \n\nWe gathered this information by monitoring the sample application [Acme Air][3]. We used MongoDB as our datastore and used JMeter to drive load though the program.  We have performed this testing with Node.js version 6.10.3\n\n\n## API Documentation\n\n### attach(options)\n\n* options {Object} Options are the same as for `dash.monitor()`.\n\nAuto-attach to all `http` servers created after this call, calling `dash.monitor(options)` for every server.\n\nSimple example using attach\n```js\nvar dash = require('appmetrics-dash');\ndash.attach();\n\nvar http = require('http');\n\nconst port = 3000;\n\nconst requestHandler = (request, response) =\u003e {  \n  response.end('Hello')\n}\n\nconst server = http.createServer(requestHandler);\n\nserver.listen(port, (err) =\u003e {  \n  if (err) {\n    return console.log('An error occurred', err)\n  }\n  console.log(`Server is listening on ${port}`)\n});\n```\n\n### monitor(options)\n\n* options.url {String} Path to serve dashboard from. Optional, defaults to\n  `'/appmetrics-dash'`.\n* options.console {Object} Some messages are printed to the console using\n  `console.log()` and `console.error()`. Optional, defaults to the global\n  `console` object.\n* options.server {Object} An instance of a node `http` server to serve the\n  dashboard from. Optional, default is to create a server (see `port` and\n  `host`).\n* options.port {String|Number} Port to listen on if creating a server. Optional,\n  unused if `server` option is used.\n* options.host {String} Host to listen on if creating a server. Optional,\n  unused if `server` option is used.\n* options.appmetrics {Object} An instance of `require('appmetrics')` can be\n  injected if the application wants to use appmetrics, since it is a singleton\n  module and only one can be present in an application. Optional, defaults to\n  the appmetrics dependency of this module.\n* options.nodereport {Object} An instance of `require('node-report')` can be\n  injected if the application wants to use node-report, since it is a singleton\n  module and only one can be present in an application. Optional, defaults to\n  the node-report dependency of this module.\n  The ability to generate reports can be disabled by setting this to `null` or \n  `undefined`.\n* options.title {String} Title for the dashboard.\n* options.docs {String} URL link to accompanying documentation.\n* options.middleware {Object} Pass in middleware function to be used by server.\n\n## Contributing\n\nWe welcome contributions. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details about the contributor licence agreement and other information. If you want to do anything more involved than a bug fix or a minor enhancement then we would recommend discussing it in an issue first before doing the work to make sure that it's likely to be accepted. We're also keen to improve test coverage and may not accept new code unless there are accompanying tests.\n\n## Module Long Term Support Policy\n\nThis module adopts the [Module Long Term Support (LTS)](http://github.com/CloudNativeJS/ModuleLTS) policy, with the following End Of Life (EOL) dates:\n\n| Module Version   | Release Date | Minimum EOL | EOL With     | Status  |\n|------------------|--------------|-------------|--------------|---------|\n| V4.x.x\t         | Jun 2018     | Dec 2019    |              | Current |\n\n\n### License\nThe Node Application Metrics Dashboard is licensed using an Apache v2.0 License.\n\n\n[1]:https://developer.ibm.com/open/node-application-metrics/\n[2]:https://www.npmjs.com/package/node-report/\n[3]:https://github.com/acmeair/acmeair-nodejs/\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruntimetools%2Fappmetrics-dash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruntimetools%2Fappmetrics-dash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruntimetools%2Fappmetrics-dash/lists"}