File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 1313 * See the License for the specific language governing permissions and
1414 * limitations under the License.
1515 *******************************************************************************/
16-
1716var path = require ( "path" )
17+ var main_filename = path . dirname ( require . main . filename ) ;
1818var module_dir = path . dirname ( module . filename )
1919var os = require ( "os" )
20- //var serializer = require('./lib/serializer.js');
2120var aspect = require ( './lib/aspect.js' ) ;
2221var request = require ( './lib/request.js' ) ;
2322var fs = require ( 'fs' ) ;
24-
2523var agent = require ( "./appmetrics" )
2624// Set the plugin search path
2725agent . spath ( path . join ( module_dir , "plugins" ) )
28- agent . start ( ) ;
26+ // pass in the main file name for use in identifying the app in mqtt connection
27+ agent . start ( main_filename ) ;
2928
3029var hcAPI = require ( "./appmetrics-api.js" ) ;
3130var jsonProfilingMode = false ;
Original file line number Diff line number Diff line change @@ -289,8 +289,13 @@ static bool initLoaderApi() {
289289
290290NAN_METHOD (start) {
291291
292- if (!running) {
293- running = true ;
292+ Local<String> value = info[0 ]->ToString ();
293+ if (info.Length () > 0 ) {
294+ loaderApi->setProperty (" com.ibm.diagnostics.healthcenter.mqtt.application.id" , toStdString (value).c_str ());
295+ }
296+
297+ if (!running) {
298+ running = true ;
294299
295300 loaderApi->init ();
296301
@@ -484,7 +489,6 @@ NAN_METHOD(sendControlCommand) {
484489
485490
486491NAN_METHOD (localConnect) {
487-
488492 if (!isMonitorApiValid ()) {
489493 Nan::ThrowError (" Monitoring API is not initialized" );
490494 return ;
You can’t perform that action at this time.
0 commit comments