Skip to content

Instantly share code, notes, and snippets.

@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.
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 / 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
}
},
{
"_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",
::: [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)
@codyaray
codyaray / sparse_fields_across_types.txt
Created January 7, 2016 19:42
Each field is unique to a type within one index. Investigating sparse doc_values blowing up disk size.
{
"_shards" : {
"total" : 8,
"successful" : 8,
"failed" : 0
},
"indices" : {
"_all" : {
"fields" : {
Topic:stats-test-1 PartitionCount:3 ReplicationFactor:1 Configs:
Topic: stats-test-1 Partition: 0 Leader: 0 Replicas: 0 Isr: 0
Topic: stats-test-1 Partition: 1 Leader: 1 Replicas: 1 Isr: 1
Topic: stats-test-1 Partition: 2 Leader: 2 Replicas: 2 Isr: 2
@codyaray
codyaray / hot_threads.txt
Created January 11, 2016 19:42
Lots of Lucene Merges
::: [svlchi6pesm03.peak6.net][0zQiOjCySx2lc2CjKKAuxQ][svlchi6pesm03][inet[/10.2.4.180:9300]]{data=false, box_type=mgmt, master=true}
Hot threads at 2016-01-11T19:40:08.163Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:
0.0% (198.7micros out of 500ms) cpu usage by thread 'elasticsearch[svlchi6pesm03.peak6.net][keep_alive]'
10/10 snapshots sharing following 3 elements
java.lang.Thread.sleep(Native Method)
org.elasticsearch.marvel.agent.exporter.ESExporter$ConnectionKeepAliveWorker.run(ESExporter.java:788)
java.lang.Thread.run(Thread.java:745)
::: [svlchi6pes02.peak6.net][7QVV3C62QeyeH9RySjm7Cg][svlchi6pes02][inet[/10.2.4.182:9300]]{box_type=slow, master=false}
@codyaray
codyaray / segments.txt
Created January 13, 2016 19:48
segment sizes 2016.01.13
$ curl http://localhost:9200/_cat/segments/stats-2016.01.13
stats-2016.01.13 0 r 10.100.0.173 _ox5 32297 44216730 0 4.9gb 20866178 true true 4.10.4 false
stats-2016.01.13 0 r 10.100.0.173 _1czz 63503 25564563 0 2.8gb 12632418 true true 4.10.4 false
stats-2016.01.13 0 r 10.100.0.173 _1p5l 79257 31925725 0 3.8gb 16160354 true true 4.10.4 false
stats-2016.01.13 0 r 10.100.0.173 _209s 93664 17198422 0 2.6gb 9621514 true true 4.10.4 false
stats-2016.01.13 0 r 10.100.0.173 _20mi 94122 1491417 0 240mb 1145082 true true 4.10.4 true
stats-2016.01.13 0 r 10.100.0.173 _26je 101786 31944530 0 4.8gb 17021746 true true 4.10.4 false
stats-2016.01.13 0 r 10.100.0.173 _26xs 102304 2062766 0 334mb 1517770 true true 4.10.4 true
stats-2016.01.13 0 r 10.100.0.173 _27rl 103377 2303260 0 373.7mb 1691938 true true 4.10.4 true
stats-2016.01.13 0 r 10.100.0.173 _2870 103932 377836 0 64.2mb 412538 true true 4.10.4 true
@codyaray
codyaray / hot_threads.txt
Created January 15, 2016 13:30
pre-market-open hot_threads
::: [svlchi6pesm03.peak6.net][0zQiOjCySx2lc2CjKKAuxQ][svlchi6pesm03][inet[/10.2.4.180:9300]]{data=false, box_type=mgmt, master=true}
Hot threads at 2016-01-15T13:21:43.134Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true:
0.0% (196.5micros out of 500ms) cpu usage by thread 'elasticsearch[svlchi6pesm03.peak6.net][keep_alive]'
10/10 snapshots sharing following 3 elements
java.lang.Thread.sleep(Native Method)
org.elasticsearch.marvel.agent.exporter.ESExporter$ConnectionKeepAliveWorker.run(ESExporter.java:788)
java.lang.Thread.run(Thread.java:745)
0.0% (91.9micros out of 500ms) cpu usage by thread 'elasticsearch[svlchi6pesm03.peak6.net][transport_client_timer][T#1]{Hashed wheel timer #1}'