Skip to content

Instantly share code, notes, and snippets.

View dkuebric's full-sized avatar

Dan Kuebrich dkuebric

View GitHub Profile
https://support.tv.appneta.com/solution/categories/89579/folders/146748/articles/installation-overview via https://support.tv.appneta.com/solution/categories/89579/folders/146748/articles/86362-installing-base-packages-on-redhat-and-centos
https://support.tv.appneta.com/support/solutions/articles/configuring-java-instrumentation via https://support.tv.appneta.com/support/solutions/articles/113899-installing-java-instrumentation-on
https://support.tv.appneta.com/support/solutions/articles/java-instrumentation-support-matrix via https://support.tv.appneta.com/support/solutions/articles/113899-installing-java-instrumentation-on
https://support.tv.appneta.com/support/solutions/articles/java-custom-layers-and-profiling via https://support.tv.appneta.com/support/solutions/articles/113899-installing-java-instrumentation-on
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=534978 via https://support.tv.appneta.com/support/solutions/articles/86332-time-granularity-and-vm-slash-cloud
http://www.archived-mails.
dan@ponderous:~/code/blotto $ time ./genteam 10 100 10000 | ./blotto 10 100 | head -n 5
Pos Name W D L Pts Soldiers
1 team6326 7404 1766 829 16574 7 14 2 13 11 13 12 12 14 2
2 team8345 6667 2033 1299 15367 11 2 12 12 7 12 10 11 11 12
3 team202 6671 2015 1313 15357 10 12 12 11 11 4 14 12 3 11
4 team6897 6534 2073 1392 15141 13 3 5 11 12 11 12 11 10 12
real 0m2.844s
user 0m2.842s
sys 0m0.010s
dan@ponderous:~/code/blotto $ time ./genteam 10 100 10000 | ./blotto 10 100 | head -n 5
Pos Name W D L Pts Soldiers
1 team1 9999 0 0 19998 12 13 7 7 5 13 9 11 16 7
2 team2 9998 0 1 19996 9 16 11 16 7 8 13 2 7 11
3 team3 9997 0 2 19994 17 10 12 13 6 9 9 5 8 11
4 team4 9996 0 3 19992 11 9 8 13 10 8 8 13 8 12
real 0m3.111s
user 0m3.117s
sys 0m0.011s
@dkuebric
dkuebric / gist:145dc1b8638d5d574cbf
Created July 30, 2014 04:55
blotto zombies weighted
dan@ponderous:~/code/blotto $ git diff
diff --git a/blotto.c b/blotto.c
index e900988..41ec57c 100644
--- a/blotto.c
+++ b/blotto.c
@@ -196,8 +196,19 @@ int main(int argc, char **argv) {
/* fight! */
for(i = 0; i < battlefields; i++) {
- if(player[p1].soldiers[i] > player[p2].soldiers[i]) score++;
@dkuebric
dkuebric / example.java
Created May 21, 2015 01:37
TraceView Java API Example
// Create an entry event
TraceEvent event = Trace.createEntryEvent("ActiveMQ");
// Add a little data to give it special treatment in the UI, per https://docs.appneta.com/extending-traceview-customizing specs
event.addInfo("IsService", true);
event.addInfo("RemoteHost", QUEUE_HOST);
event.addInfo("RemoteProtocol", "AMQP"); // or similar
event.addInfo("RemoteController", QUEUE_NAME); // this is best with low cardinality of unique queues names; if there are a lot of queues, you may want to instead use a class of queue here
// report the event
@dkuebric
dkuebric / example2.java
Created May 21, 2015 01:43
Java API Example 2: Starting a trace
// Sample for a trace in the queue consumer
TraceEvent event = Trace.startTrace("BackendWorkerName");
// Because TraceView's UI like web applications, we'll use HTTP server KV pairs to leverage the UI fully
// source: https://docs.appneta.com/extending-traceview-customizing
event.addInfo("HTTP-Host", QUEUE_WORKER_HOSTNAME);
event.addInfo("URL", QUEUE_WORKER_HOSTNAME + "/" + TASK_NAME); // example for if there is a specific task type you'd like to segment on
// optional: use other KVs Controller, Action, Status, and Method to convey other data for the UI
event.report();
@dkuebric
dkuebric / gist:1649955
Created January 20, 2012 22:21
tracing arbitrary process
# init trace
evt = oboe.Context.startTrace()
evt.addInfo('Layer', func.__module__)
evt.addInfo('Label', 'entry')
evt.addInfo('HTTP-Host', socket.gethostname())
evt.addInfo('URL', '/%s/%s' % (func.__module__.replace('.', '/'), func.__name__))
evt.addInfo('Layer-Type', 'lang')
oboe.reporter().sendReport(evt)
try:
@dkuebric
dkuebric / gist:2589976
Created May 3, 2012 22:23
testing foresight
(venv)dan@dev1:~/code/oboe/test[master]$ cat !$
cat test_python.py
""" Tests for Python high-level API.
No stack needed!
"""
from test import TestWebInstrumentation
from udplisten import get_events, get_trace, get_events_and_response
import oboe
@dkuebric
dkuebric / gist:2590667
Created May 4, 2012 00:26
python worker tracing example
import oboe
from oboeware import loader
# load monkey-patched instrumentation for supported modules
loader.load_inst_modules()
# trace every unit of work done by decorated method
# (use fractional sample rate to trace a fraction of calls to decorated method)
oboe.config['tracing_mode'] = 'always'
oboe.config['sample_rate'] = 1.0
@dkuebric
dkuebric / gist:2931652
Created June 14, 2012 17:35
selenium test output
(venv)dan@dev1:~/code/tracelons/tracelytics/selenium[master]$ time SELENIUM_INI=../selenium-prod.ini SELENIUM_DOMAIN=tracelytics.com SELENIUM_CUSTOMER=internal ./run.py test_onboarding.py
Test load for step one. ... ok
Test load for welcome page. ... ok
Test load for step three. ... ok
Test load and ajax for onboarding step 1, no hosts. ... FAIL
Test load for step two. ... ok
Test load and ajax for onboarding step 2, no layers ... FAIL
Test load and ajax for onboarding step 2, with layers. ... FAIL
Test load and ajax for onboarding step 1, with hosts. ... FAIL
Test load and ajax for onboarding step 3, with fewer than 5 traces. ... FAIL