Skip to content

Commit e0ae457

Browse files
committed
Merge branch 'headless' of https://github.com/sjanuary/appmetrics into headless
2 parents ca3fa54 + 04b3fcc commit e0ae457

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ It also adds the `node-hc` command to another directory tied to your Node.js SDK
105105

106106
<a name="config"></a>
107107
### Configuring Node Application Metrics
108-
Node Application Metrics comes with a configuration file inside the [module installation directory](#install) (`.../node_modules/appmetrics/appmetrics.properties`). This is used to configure connection options, logging and data source options.
108+
109+
Node Application Metrics can be configured in two ways, by using the configuration file described below or via a call to configure(options).
110+
111+
Node Application Metrics comes with a configuration file inside the [module installation directory](#install) (`.../node_modules/appmetrics/appmetrics.properties`). This can be used to configure connection options, logging and data source options.
109112

110113
Node Application Metrics will attempt to load `appmetrics.properties` from one of the following locations (in order):
111114

@@ -162,14 +165,26 @@ monitoring.on('cpu', function (cpu) {
162165

163166
## Health Center Eclipse IDE client
164167
### Connecting to the client
165-
Connecting to the Health Center client requires the additional installation of a MQTT broker. The Node Application Metrics agent sends data to the MQTT broker specified in the `appmetrics.properties` file. Installation and configuration documentation for the Health Center client is available from the [Health Center documentation in IBM Knowledge Center][2].
168+
Connecting to the Health Center client requires the additional installation of a MQTT broker. The Node Application Metrics agent sends data to the MQTT broker specified in the `appmetrics.properties` file or set via a call to configure(options). Installation and configuration documentation for the Health Center client is available from the [Health Center documentation in IBM Knowledge Center][2].
166169

167170
Note that both the API and the Health Center client can be used at the same time and will receive the same data. Use of the API requires a local install and application modification (see *[Modifying your application to use the local installation](#run-local)*).
168171

169172
Further information regarding the use of the Health Center client with Node Application Metrics can be found on the [appmetrics wiki][3]: [Using Node Application Metrics with the Health Center client](https://github.com/RuntimeTools/appmetrics/wiki/Using-Node-Application-Metrics-with-the-Health-Center-client).
170173

171174
<a name="api-doc"></a>
172175
## API Documentation
176+
### appmetrics.configure(options)
177+
Sets various properties on the appmetrics monitoring agent. If the agent has already been started, this function does nothing.
178+
* `options`(Object) key value pairs of properties and values to be set on the monitoring agent.
179+
180+
Property name | Property value | Effect
181+
:--------------------|:-------------------------|:-----------------------------
182+
`applicationID` | `string` | Specifies a unique identifier for the mqtt connection
183+
`mqtt` | `[off|on]` | Specifies whether the monitoring agent sends data to the mqtt broker. The default value is on
184+
`mqttHost` | `host name` | Specifies the host name of the mqtt broker
185+
`mqttPort` | `port number` | Specifies the port number of the mqtt broker
186+
`profiling` | `[off|on]` | Specifies whether method profiling data will be captured. The default value is off
187+
173188

174189
### appmetrics.start()
175190
Starts the appmetrics monitoring agent. If the agent is already running this function does nothing.

0 commit comments

Comments
 (0)