Skip to content

Instantly share code, notes, and snippets.

View Slach's full-sized avatar
💭
deep diving into kuberntes

Eugene Klimov Slach

💭
deep diving into kuberntes
View GitHub Profile
@kanekv
kanekv / .gdbinit
Created May 2, 2017 04:27
.gdbinit
# -*- ksh -*-
#
# If you use the GNU debugger gdb to debug the Python C runtime, you
# might find some of the following commands useful. Copy this to your
# ~/.gdbinit file and it'll get loaded into gdb automatically when you
# start it up. Then, at the gdb prompt you can do things like:
#
# (gdb) pyo apyobjectptr
# <module 'foobar' (built-in)>
# refcounts: 1
@adammw
adammw / libvlc.js
Created May 9, 2012 14:06
Object-orientated libVLC bindings for node.js implemented in javascript using node-ffi. Superseded by https://github.com/adammw/node-vlc-ffi
/*
* node-ffi-vlc v0.0.2
* Object-orientated libVLC bindings for node.js implemented in javascript using node-ffi
* Not for production use, use at your own risk, do with what you will.
* See libvlc docs for more info, http://www.videolan.org/developers/vlc/doc/doxygen/html/group__libvlc.html
*/
var EventEmitter = require('events').EventEmitter,
FFI = require("node-ffi");
var libVLC = new FFI.Library("libvlc", {
@jfrost
jfrost / gist:6584871
Created September 16, 2013 18:53
PostgreSQL query: completely unused indexes
-- Completely unused indexes:
SELECT relid::regclass as table, indexrelid::regclass as index
, pg_size_pretty(pg_relation_size(indexrelid))
FROM pg_stat_user_indexes
JOIN pg_index
USING (indexrelid)
WHERE idx_scan = 0
AND indisunique IS FALSE order by pg_relation_size(indexrelid);
@muxx
muxx / init.php
Last active November 1, 2019 12:28
pinba configure in Bitrix
<?php
include __DIR__ . '/pinba_configure.php';
"""
This is a simple example of WebSocket + Tornado + Redis Pub/Sub usage.
Do not forget to replace YOURSERVER by the correct value.
Keep in mind that you need the *very latest* version of your web browser.
You also need to add Jacob Kristhammar's websocket implementation to Tornado:
Grab it here:
http://gist.github.com/526746
Or clone my fork of Tornado with websocket included:
http://github.com/pelletier/tornado
Oh and the Pub/Sub protocol is only available in Redis 2.0.0:
package seriesList
import (
"fmt"
"math"
"strconv"
"github.com/go-graphite/carbonapi/expr/helper"
"github.com/go-graphite/carbonapi/expr/interfaces"
"github.com/go-graphite/carbonapi/expr/types"
@edeNFed
edeNFed / profile
Last active September 9, 2020 04:01
BCC Profile with python type bug fixed
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# profile Profile CPU usage by sampling stack traces at a timed interval.
# For Linux, uses BCC, BPF, perf_events. Embedded C.
#
# This is an efficient profiler, as stack traces are frequency counted in
# kernel context, rather than passing every stack to user space for frequency
# counting there. Only the unique stacks and counts are passed to user space
# at the end of the profile, greatly reducing the kernel<->user transfer.
@narendrans
narendrans / Dockerfile
Last active September 15, 2020 19:26
Superset with Dremio ODBC on Centos7 Docker image
FROM centos:7
RUN yum install -y python3 python3-devel python3-pip unixODBC unixODBC-devel python3-setuptools gcc gcc-c++ https://download.dremio.com/odbc-driver/dremio-odbc-LATEST.x86_64.rpm && \
pip3 install apache-superset sqlalchemy_dremio && \
export LC_ALL=en_US.UTF-8 && \
superset db upgrade && \
superset init && \
export FLASK_APP=superset && \
flask fab create-admin --username admin --firstname admin --lastname admin --email admin@admin --password admin
@danikin
danikin / tar_test.c
Last active December 18, 2020 07:28
Tarantool Quick Test
// Tarantool quick test
// Copyright, Dennis Anikin 2016
//
// Quick disclaimer:
//
// This test shows 500K-1000K transactions per second on one CPU core
// and 600K-1600K queries per second on one CPU core.
//
// Based on the $6.57 per-month-price for the AWS t2.micro instance we can afford the tremendous number of 630bln queries for just $1
//

Счётчики, метрики и трейспоинты в ClickHouse (черновик).

Мотивация

В ClickHouse разным образом реализовано некоторое количество функциональности, имеющей общие черты. Это:

  • метрики на основе инкрементальных счётчиков (ProfileEvents);
  • метрики на основе количества одновременных процессов (Metrics);
  • метрики на основе асинхронно получаемых значений (AsynchronousMetrics);
  • ограничения на сложность выполнения запроса (встроены в Settings);
  • прогресс выполнения запроса (Progress, отправляется клиенту);