cluster = require('cluster');

if (cluster.isMaster) {
  console.log('I am master');
  cluster.fork();
  cluster.fork();
} else if (cluster.isWorker) {
  console.log("I am worker "+cluster.worker.id);
}

var Countly = require('../lib/countly.js');

Countly.init({
    app_key: "{YOUR-API-KEY}",
    url: "https://cloud.count.ly/",
    debug: true
});


Countly.begin_session();

Countly.add_event({
    "key": "in_app_purchase",
    "count": 3,
    "sum": 2.97,
    "dur": 1000,
    "segmentation": {
        "app_version": "1.0",
        "country": "Turkey"
    }
});
          
Countly.user_details({
    "name": "Arturs Sosins",
    "username": "ar2rsawseen",
    "email": "test@test.com",
    "organization": "Countly",
    "phone": "+37112345678",
    //Web URL to picture
    "picture": "https://pbs.twimg.com/profile_images/1442562237/012_n_400x400.jpg", 
    "gender": "M",
    "byear": 1987, //birth year
    "custom":{
      "key1":"value1",
      "key2":"value2",
    }
});
  
Countly.track_errors();
Countly.track_view("test");

try{
    runthis();
}
catch(ex){Countly.log_error(ex)}

setTimeout(function(){
    Countly.end_session();
}, 7000);

Countly.start_event("timed");

setTimeout(function(){
    Countly.end_event({
        "key": "timed",
        "count": 1,
        "segmentation": {
            "app_version": "1.0",
            "country": "Turkey"
        }
    });
}, 3000);

if(!cluster.isMaster){
    setTimeout(function(){
        crashDaApp();
    }, 10000);
}
else{
    setTimeout(function(){
        crashDaApp();
    }, 15000);
}
cluster = require('cluster');

if (cluster.isMaster) {
  console.log('I am master');
  cluster.fork();
  cluster.fork();
} else if (cluster.isWorker) {
  console.log("I am worker "+cluster.worker.id);
}

var Countly = require('../lib/countly.js');

Countly.init({
    app_key: "{YOUR-APP-KEY}",
    url: "https://cloud.count.ly/",
    debug: true
});


Countly.begin_session();

Countly.add_event({
    "key": "in_app_purchase",
    "count": 3,
    "sum": 2.97,
    "dur": 1000,
    "segmentation": {
        "app_version": "1.0",
        "country": "Turkey"
    }
});
          
Countly.user_details({
    "name": "Arturs Sosins",
    "username": "ar2rsawseen",
    "email": "test@test.com",
    "organization": "Countly",
    "phone": "+37112345678",
    //Web URL to picture
    "picture": "https://pbs.twimg.com/profile_images/1442562237/012_n_400x400.jpg", 
    "gender": "M",
    "byear": 1987, //birth year
    "custom":{
      "key1":"value1",
      "key2":"value2",
    }
});
  
Countly.track_errors();
Countly.track_view("test");

try{
    runthis();
}
catch(ex){Countly.log_error(ex)}

setTimeout(function(){
    Countly.end_session();
}, 7000);

Countly.start_event("timed");

setTimeout(function(){
    Countly.end_event({
        "key": "timed",
        "count": 1,
        "segmentation": {
            "app_version": "1.0",
            "country": "Turkey"
        }
    });
}, 3000);

if(!cluster.isMaster){
    setTimeout(function(){
        crashDaApp();
    }, 10000);
}
else{
    setTimeout(function(){
        crashDaApp();
    }, 15000);
}
Fix placeholder app key