Skip to content

Instantly share code, notes, and snippets.

@jaydanielian
jaydanielian / gist:340aeb48c7fb41706f4e
Created June 5, 2015 14:50
snippet of hot threads from ES
[siq-prod-es01][vko9lXe9R_q0BmKTes2dqQ][siq-es-xxxxxx][inet[/xxxxxxx:9300]]{aws_availability_zone=us-east-1e, max_local_storage_nodes=1}
98.8% (493.8ms out of 500ms) cpu usage by thread 'elasticsearch[siq-prod-es01][search][T#14]'
10/10 snapshots sharing following 35 elements
sun.nio.ch.NativeThread.current(Native Method)
sun.nio.ch.NativeThreadSet.add(NativeThreadSet.java:46)
sun.nio.ch.FileChannelImpl.readInternal(FileChannelImpl.java:695)
sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:684)
org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.readInternal(NIOFSDirectory.java:179)
org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:342)
@jaydanielian
jaydanielian / gist:e374a401560f3e3b1812
Created June 5, 2015 14:43
sample syntax of slow query from slow log
[2015-06-05 14:12:07,206][INFO ][index.search.slowlog.query] [siq-prod-es05] [011-20150521][3] took[8.5s], took_millis[8587], types[indexed_entity], stats[], search_type[QUERY_AND_FETCH], total_shards[1], source[{"size":10,"sort":[{"entity_rank":"desc"}],"query":{"constant_score":{"query":{"bool":{"should":[{"nested":{"path":"indexed_entity.terms.emails","query":{"bool":{"must":{"terms":{"eh":["2185297396a9bb84b2908d559d347470"]}}}}}},{"nested":{"path":"indexed_entity.terms.phone_numbers","query":{"bool":{"must":{"terms":{"dh":["25b7fde1e280ea367474ce8f8d7242ee"]}}}}}}],"must":{"nested":{"path":"indexed_entity.terms.names","query":{"bool":{"must":{"terms":{"ln_h":["e5d7cd196fdd8d6490e8da5f788f5c74"],"fn_h":["2b877b4b825b48a9a0950dd5bd1f264d"]}}}}}},"minimum_number_should_match":1}}}},"post_filter":{"range":{"conf_v2":{"gte":0.85},"_cache":false}}}], extra_source[]
@jaydanielian
jaydanielian / PTService.cs
Created February 13, 2014 16:08
PT API integration. Once we have the list of stories (from parsing git), we query the PT API to get the stories, then if they are in the finished state, we mark them as delivered, and apply our current build tag as a PT label to each story.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PivotalTrackerDotNet;
using PivotalTrackerDotNet.Domain;
namespace Dublabs.CircleBack.PivotalTrackGit
{
@jaydanielian
jaydanielian / gist:8977887
Created February 13, 2014 16:04
GitService.cs - used for parsing the commits between the previous tag and the current one that our jenkins build is using. We grab all the commits between these two points, and parse the commit comments
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LibGit2Sharp;
using LibGit2Sharp.Core;
using LibGit2Sharp.Handlers;
using System.Text.RegularExpressions;
@jaydanielian
jaydanielian / mono.rb
Last active December 20, 2015 02:09
latest mono download for homebrew
# http://www.mono-project.com/Compiling_Mono_on_OSX
require 'formula'
class Mono < Formula
url 'http://download.mono-project.com/sources/mono/mono-3.1.2.tar.bz2'
homepage 'http://www.mono-project.com/'
sha1 '12b13da093dbd379c60fcf99b19280a4e2482d3e'
def install