Skip to content

Instantly share code, notes, and snippets.

View andrewvc's full-sized avatar

Andrew Cholakian andrewvc

View GitHub Profile
@andrewvc
andrewvc / jexec.rb
Last active August 8, 2017 13:10
JRuby method invocations from java performance tests
#!/usr/bin/env ruby
require './logstash-core/build/libs/logstash-core-6.0.0-beta1.jar'
ITERATIONS = 50_000_000
class InterfaceTest
include java.lang.Runnable
def initialize
@i = 1
end
@andrewvc
andrewvc / gist:aec2ad986eceb0af9196be59e80c9b24
Created April 24, 2017 15:46
script_filter_improvements
* Batch block
* Exceptions on add_tag
define_filter :keymapper do
process do |event|
keys = event.get('[keys]')
vals = event.get('[vals]')
next unless keys && vals && !keys.empty? && !vals.empty?
keys.each.with_index do |key,i|
event.set(key, vals[i])
end
@andrewvc
andrewvc / heartbeats.js
Created March 21, 2011 06:01
simple canvas heartbeat monitor
function Heartbeat(context,width,height) {
var h = this;
h.context = context;
h.width = width;
h.height = height;
h.baseline = Math.round(h.height / 2);
h.context.moveTo(h.x, h.y);
h.context.strokeStyle = "#668CFF";
worker_processes 1;
events {
worker_connections 1024;
}
http {
#include mime.types;
default_type application/octet-stream;
2016-11-01 16:46:14
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.51-b03 mixed mode):
"pool-4-thread-18" #65 prio=5 os_prio=31 tid=0x00007fd5f58bd800 nid=0xbf03 waiting on condition [0x0000700016b07000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x0000000784a48240> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
// Generic JS boilerplate for browser-side js source files.
window.myApp = {}; // Should only appear in one source file.
(function($) {
window.myApp.myFeature = {
init: function() {
//...
},
property: "value";
@andrewvc
andrewvc / Gemfile
Created September 1, 2016 20:16
Logstash 2.4 All Plugins Gemfile with dupes removed
# This is a Logstash generated Gemfile.
# If you modify this file manually all comments and formatting will be lost.
source "https://rubygems.org"
gem "logstash-core", "2.4.0"
gem "logstash-core-event", "2.4.0"
gem "logstash-core-plugin-api", "1.60.4"
gem "file-dependencies", "0.1.6"
gem "ci_reporter_rspec", "1.0.0", :group => :development
gem "simplecov", :group => :development
./logstash_benchmarker.rb --warmup 60 --duration 120 -e "input { generator {} } output { elasticsearch {} }"

Keybase proof

I hereby claim:

  • I am andrewvc on github.
  • I am andrewvc (https://keybase.io/andrewvc) on keybase.
  • I have a public key whose fingerprint is D111 4B56 078A A1FF A5FD 7DE3 46AC D7C3 2B45 0C77

To claim this, I am signing this object: