Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Dumps memcached data from one server and restores on another.
# Useful for copying production data to staging.
#
# Generates a ./user_ids file with the users that were copied and an ./error file for errors.
# The user_ids file can be plugged into the JMeter RTS load generator.
#
# Takes a maximum number of entries to copy. If unspecified it copies everything.
#
@rtitle
rtitle / nescala_2015_notes.txt
Last active August 29, 2015 14:14
Notes: nescala 2015
1. akka-http
akka-http 1.0 coming in Q1 2015, it's essentially spray 2.0 (uses a lot of the spray code base)
Uses the same spray scala APIs
Based on akka-io, akka-stream, akka-http-core (tcp -> http translation)
Reactive stream processing over http, backpressure
Some features are missing, like websockets
One long term goal is to use akka-http in Play instead of Netty
Netty is more proven; akka likely needs some performance tweaks.
2. Tapad microservices
@rtitle
rtitle / skytap_tomcat_upgrade
Created February 27, 2015 20:14
Skytap Tomcat upgrade
Integration
___________
On each host:
cd /usr/local/lib
wget http://artifactory.devaws.dataxu.net/artifactory/dataxu-binaries/apache-tomcat-8.0.18.tar.gz
tar -xzf apache-tomcat-8.0.18.tar.gz
chmod a+x apache-tomcat-8.0.18/bin/*.sh
rm -f apache-tomcat-8.0.18.tar.gz
cd ../bin
@rtitle
rtitle / Skytap Tomcat 7 upgrade
Created March 11, 2015 23:49
Skytap Tomcat 7 upgrade
Note: this assumes you have done this first: https://gist.github.com/rtitle/282dd241c3abbb5205f6
Integration
___________
On each host:
cd /usr/local/lib
wget http://artifactory.devaws.dataxu.net/artifactory/dataxu-binaries/apache-tomcat-7.0.59.tar.gz
tar -xzf apache-tomcat-7.0.59.tar.gz
rm -f apache-tomcat-7.0.59.tar.gz
@rtitle
rtitle / dfa_environment_defaults
Created April 10, 2015 21:08
Default values for DFA reporting environments
##
# Directory to store DFA reports
emissary.dfa.report.directory=/opt/emissary-shared/dfa_reports
##
# Whether to create new reports
emissary.dfa.report.createReports=true
##
# Name of the DFA report to create/search for.
@rtitle
rtitle / dxedge_elb_count.sh
Created May 7, 2015 16:21
dxedge_elb_count
#!/bin/bash
send() {
REGION=$1
ELB=$2
SOA=$( dig SOA $ELB | grep -A1 "AUTHORITY SECTION" | tail -1| awk '{ print $5 }' )
VALUE=$( for a in $( seq 20 ); do dig $ELB @$SOA| grep "^$ELB" | grep -o '[0-9\.]*$' ; done | sort -u | wc -l)
DATE=`date +%s`
echo "aws.elb.region.$REGION.ELBHostCount.Sum $VALUE ${DATE}" | nc localhost 2003
}
@Test
public void testAntlrPerformance() throws Exception {
initData2();
int numSegments = 100;
List<Audience> audiences = new ArrayList<>(numSegments);
List<Segment> segments = new ArrayList<>(numSegments);
Map<Tuple<String, String>, SegmentAudienceRate> segmentAudienceRateMap = new HashMap<>(numSegments);
ConcurrentMap<String, Segment> segmentMap = new ConcurrentHashMap<>(numSegments);
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for dataxu.DXRTS:rts-ad:jar:3.57.0-SNAPSHOT
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.groupId' for org.apache.flume:flume-ng-sdk:jar with value '*' does not match a valid id pattern. @ dataxu:DXRTS:3.57.0-SNAPSHOT, /home/rtitle/git/rtitle/realtime-system/pom.xml, line 885, column 22
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.artifactId' for org.apache.flume:flume-ng-sdk:jar with value '*' does not match a valid id pattern. @ dataxu:DXRTS:3.57.0-SNAPSHOT, /home/rtitle/git/rtitle/realtime-system/pom.xml, line 886, column 25
[WARNING] 'dependencyManagement.dependencies.dependency.exclusions.exclusion.groupId' for org.apache.flume:flume-ng-embedded-agent:jar with value '*' does not match a valid id pattern. @ dataxu:DXRTS:3.57.0-SNAPSHOT, /home/rtitle/git/rtitle/realtime-system/pom.xml, line 896, column 22
[WARNING] 'dependencyM
@rtitle
rtitle / retargeting_simplification.md
Last active July 21, 2016 13:22
Retargeting simplification results
@Param({"0", "1", "10", "100", "1000"})
int numIncludedAudiences;
		
@Param({"0", "1", "10", "100", "1000"})
int numExcludedAudiences;
		
@Param({"1", "5", "10"})
int segmentsPerAudience;
 
@rtitle
rtitle / rts_master_test_durations.txt
Last active October 19, 2016 01:36
RTS unit test durations in seconds
# from master build https://jenkins.devaws.dataxu.net/job/realtime-system_build/10054/
# Build #10054 dataxu/master (ad10084d) (Oct 18, 2016 10:30:29 AM)
seconds test
1857 dataxu.rt.services.caching.memcached.DxNodeLocatorTest
1215 dataxu.rt.services.context.aerospike.AerospikeContextServiceTest
358 dataxu.rt.services.budget.BudgetBankTest
317 dataxu.rt.adfilter.lucene.FlightCreativePickerLuceneTest
292 dataxu.rt.api.v2.user.trace.UserTraceServiceTest
267 dataxu.rt.services.users.profiles.AerospikeUserProfileServiceTest