Skip to content

Instantly share code, notes, and snippets.

Ciaran Gaffney gaffer-93

  • HostedGraphite
  • Dublin, Ireland
Block or report user

Report or block gaffer-93

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gaffer-93
gaffer-93 / helloworld_keepalive_deadlines.py
Last active Nov 6, 2018
gRPC's helloworld example modified to demonstrate deadlines and keepalive TCP_USER_TIMEOUT introduced in 1.16
View helloworld_keepalive_deadlines.py
import grpc
import time
import helloworld_pb2
import helloworld_pb2_grpc
def run():
channel_opts = [
(
# Interval at which grpc will send keepalive pings
'grpc.keepalive_time_ms',
@gaffer-93
gaffer-93 / grpc_lptrace.py
Created Oct 30, 2018
lptrace output tracing RPC call and subsequent blocking within _channel.py
View grpc_lptrace.py
python
_call_ (/opt/venvs/service/local/lib/python2.7/site-packages/grpc/_channel.py:489)
_blocking (/opt/venvs/service/local/lib/python2.7/site-packages/grpc/_channel.py:470)_prepare (/opt/venvs/service/local/lib/python2.7/site-packages/grpc/_channel.py:453)
_start_unary_request (/opt/venvs/service/local/lib/python2.7/site-packages/grpc/_channel.py:419)
_deadline (/opt/venvs/service/local/lib/python2.7/site-packages/grpc/_channel.py:55)
serialize (/opt/venvs/service/local/lib/python2.7/site-packages/grpc/_common.py:120)_transform (/opt/venvs/service/local/lib/python2.7/site-packages/grpc/_common.py:109)
_init_ (/opt/venvs/service/local/lib/python2.7/site-packages/grpc/_channel.py:102)
Condition (/usr/lib/python2.7/threading.py:241)
_init_ (/usr/lib/python2.7/threading.py:259)
_init_ (/usr/lib/python2.7/threading.py:58)
View gist:a6964ff3d3a21f6a2b08d46086285343
# Initial indexed count query
{
filter0(func: eq(tagkey_name, "server")) {
tagkey_value @filter(NOT regexp(tagvalue_name,/web10009.*/)){
C_0 as count(tagvalue_item)
}
sum(val(C_0))
}
filter1(func: eq(tagkey_name, "server")) {
tagkey_value @filter(regexp(tagvalue_name,/web1000.*/)){
View helo_wordl.py
def helowordl():
print "Helo Wordl!"
helowordl()
View gist:d8b9d5d392cc20cf3364b42be981f1f9
```
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
View gist:57e9bc3fe7080c15fa1bcc1705b06f24
// So I think this will work, havent tested it though
void draw()
{
size(500, 500);
// So we want 5 triangles...
int number_of_triangles = 5;
// that get 5 times bigger everytime?
int scaler = 5;
View gist:0b7587c7ed25fdeedecb87a02b69e345
// So I think this will work, havent tested it though
void draw()
{
size(500, 500);
// So we want 5 triangles...
number_of_triangles = 5;
// that get 5 times bigger everytime?
scaler = 5;
View gist:b5fa525bd2d2bb447b413c445427a7da
void draw()
{
size(500, 500);
x = 0;
y = 0;
w = 10;
h = 10;
for (int i = 5; i <= 45; i = i + 5) {
x = i;
y = y + i * 2;
You can’t perform that action at this time.