Skip to content

Instantly share code, notes, and snippets.

::: [svlchi6pesm03.peak6.net][0zQiOjCySx2lc2CjKKAuxQ][svlchi6pesm03][inet[/10.2.4.180:9300]]{data=false, box_type=mgmt, master=true}
Hot threads at 2016-01-06T21:11:49.519Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:
0.0% (126.3micros out of 500ms) cpu usage by thread 'elasticsearch[svlchi6pesm03.peak6.net][transport_client_timer][T#1]{Hashed wheel timer #1}'
10/10 snapshots sharing following 5 elements
java.lang.Thread.sleep(Native Method)
org.elasticsearch.common.netty.util.HashedWheelTimer$Worker.waitForNextTick(HashedWheelTimer.java:445)
org.elasticsearch.common.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:364)
org.elasticsearch.common.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
java.lang.Thread.run(Thread.java:745)
{
"_index": "stats-2015.11.09",
"_type": "Feedster",
"_id": "AVDrFpcuL69rrYzM59Sx",
"_score": 1,
"_source": {
"@timestamp": "2015-11-09T07:12:16.011Z",
"line": "ABC_000",
"host": "somehost01",
"type": "Feedster",
@codyaray
codyaray / query.sh
Last active January 5, 2016 22:43
Example slow query
time curl "localhost:9200/stats-2016.01.05/_search?pretty" -d '{
"query": {
"filtered": {
"query": {
"query_string": {
"analyze_wildcard": false,
"query": "_type:nextgen-stats",
"lowercase_expanded_terms": false
}
},
deis config:list
=== rustic-gatepost Config
batchfire.queue.connections 2
batchfire.queue.hosts localhost
batchfire.queue.port 6379
batchfire.queue.timeout.connect 3000
batchfire.queue.type redis
cacheinvalidation.queue.connections 3
cacheinvalidation.queue.host localhost
cacheinvalidation.queue.port 6379
@codyaray
codyaray / BinaryToString.java
Created July 7, 2014 18:16
Time-Series Event Aggregation with Storm
// Copyright 2014 BrightTag, Inc. All rights reserved.
package com.brighttag.storm.utils;
import backtype.storm.tuple.Values;
import storm.trident.operation.BaseFunction;
import storm.trident.operation.TridentCollector;
import storm.trident.tuple.TridentTuple;
/**
* Converts the first tuple from a byte array into a string.
@codyaray
codyaray / StormParallelism.java
Created May 22, 2014 23:52
The Big-4 Rules of Storm Tuning
// Copyright 2014 BrightTag, Inc. All rights reserved.
package com.brighttag.storm.utils;
import static com.google.common.base.Preconditions.checkArgument;
/**
* Computes the parallelism for a particular topology and machine configuration.
*
* @author codyaray
* @since 4/21/2014
@codyaray
codyaray / MyTopology.java
Created May 15, 2014 15:31
Best practice to randomly shard data between multiple TridentStates
List<StateFactory> factories = Lists.newArrayListWithCapacity(mongoHosts.size());
for (String host : mongoHosts) {
factories.add(MongoStateFactory.opaque(host, mongoDatabase));
}
StateFactory stateFactory = new RandomShardState.Factory(factories);
@codyaray
codyaray / BinaryToString.java
Last active August 29, 2015 13:57
Storm trident function to parse metrics from JSON
// Copyright 2014 BrightTag, Inc. All rights reserved.
package com.brighttag.storm.utils;
import backtype.storm.tuple.Values;
import storm.trident.operation.BaseFunction;
import storm.trident.operation.TridentCollector;
import storm.trident.tuple.TridentTuple;
/**
* Converts the first tuple from a byte array into a string.
@codyaray
codyaray / get_cheesies_followers_count.sh
Created January 4, 2014 18:40
Periodically checks a Twitter user's follower count and displays it as a Growl notification. http://codyaray.com/2014/01/hacking-twitter-competitions-automatically-tracking-followers-count
PATH=$PATH:/usr/bin/:/usr/local/bin/:$HOME/bin
curl -s "https://api.twitter.com/1.1/users/show.json?screen_name=Cheesies_Truck" \
-H "Authorization: Bearer <token>" \
| jq ".followers_count" \
| xargs -I {} growlnotify -t "Cheesies Count is {}"
@codyaray
codyaray / CompositeX509KeyManager.java
Last active March 5, 2024 16:37
A composite KeyManager for doing SSL in Java with multiple keystores. See http://codyaray.com/2013/04/java-ssl-with-multiple-keystores
package com.mycompany.ssl;
import java.net.Socket;
import java.security.Principal;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.List;
import javax.annotation.Nullable;
import javax.net.ssl.X509KeyManager;