(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
-- show running queries (pre 9.2) | |
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
# http://hadoop.apache.org/zookeeper/docs/current/zookeeperAdmin.html | |
# The number of milliseconds of each tick | |
tickTime=2000 | |
# The number of ticks that the initial | |
# synchronization phase can take | |
initLimit=10 | |
# The number of ticks that can pass between | |
# sending a request and getting an acknowledgement | |
syncLimit=5 |
from elasticsearch import Elasticsearch | |
query = { | |
"query": { | |
"bool": { | |
"should": | |
[ | |
{ | |
"term": { | |
"id-topico": "" |
db.currentOp().inprog.forEach( | |
function(op) { | |
if(op.secs_running > 5) printjson(op); | |
} | |
) |
import asyncio | |
import signal | |
async def polling(): | |
print('polling...') | |
await asyncio.sleep(3) | |
asyncio.ensure_future(polling()) | |
loop = asyncio.get_event_loop() | |
loop.create_task(polling()) |
First, you have to enable profiling
> db.setProfilingLevel(1)
Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...
#!/bin/bash | |
PREFIX=registry.cloud.tsuru.io/tsuru/ | |
read command | |
for image in "$@" | |
do | |
echo "Generating $image... " | |
full_image=${PREFIX}${image} | |
id=`docker -H 127.0.0.1:4243 run -d $full_image $command` |