This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package counter; | |
| import io.vertx.core.shareddata.LocalMap; | |
| import io.vertx.core.shareddata.SharedData; | |
| import java.util.Optional; | |
| public class CounterRepository { | |
| private SharedData data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package counter; | |
| import io.vertx.core.Handler; | |
| import io.vertx.core.eventbus.EventBus; | |
| import io.vertx.core.logging.Logger; | |
| import io.vertx.core.logging.LoggerFactory; | |
| import io.vertx.ext.bridge.BridgeEventType; | |
| import io.vertx.ext.web.handler.sockjs.BridgeEvent; | |
| import java.util.Optional; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| plugins { | |
| id 'java' | |
| id 'application' | |
| id 'com.github.johnrengelman.shadow' version '2.0.2' | |
| } | |
| repositories { | |
| mavenCentral() | |
| } | |
| group 'vertx-sockjs-counter' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package counter; | |
| import io.vertx.core.Launcher; | |
| // for easier debugging and running the app from IDE | |
| public class App { | |
| public static void main(final String[] args) { | |
| Launcher.executeCommand("run", CounterVerticle.class.getName()); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource "aws_autoscaling_policy" "myservice-asg-policy" { | |
| name = "myservice-asg-policy" | |
| policy_type = "TargetTrackingScaling" | |
| target_tracking_configuration { | |
| predefined_metric_specification { | |
| predefined_metric_type = "ASGAverageNetworkOut" | |
| } | |
| target_value = 800000000 | |
| } | |
| autoscaling_group_name = "${module.myservice.asg_name}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const SomeService = require('some/service') | |
| const AWS = require('aws-sdk') | |
| describe('someService', async function() { | |
| let someService | |
| beforeEach(async function() { | |
| someService = new SomeService() | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| RS_INDEX=$1 | |
| RS_NAME="rs"$1 | |
| mkdir $RS_NAME | |
| PORT=$((27017+$RS_INDEX)) | |
| cat <<EOF > $RS_NAME.conf | |
| systemLog: | |
| destination: file | |
| path: "var/log/mongodb/mongod.log" | |
| logAppend: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # List existing mongo process | |
| pgrep mongo | |
| # Kill existing process if has. | |
| pkill mongo | |
| # Clear old folder if has. | |
| rm -rf rs0 && rm -rf rs1 && rm -rf rs2 | |
| # Create log folder. | |
| mkdir -p ./var/log/mongodb | |
| # Create replica set 0 | |
| . rs.sh 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const data1 = { | |
| attributes: { | |
| domain: 'from.attributes.com' | |
| } | |
| } | |
| const data2 = { | |
| attributes: { | |
| unknownAttributes: { | |
| domain: 'from.unknownAttributes.com' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const data1 = { | |
| attributes: { | |
| domain: 'from.attributes.com' | |
| } | |
| } | |
| const data2 = { | |
| attributes: { | |
| unknownAttributes: { | |
| domain: 'from.unknownAttributes.com' |