Skip to content

Instantly share code, notes, and snippets.

Avatar
🎴

UENISHI Kota kuenishi

🎴
View GitHub Profile
View git.diff
diff --git a/instrumentation/net/http/otelhttp/example/server/server.go b/instrumentation/net/http/otelhttp/example/server/server.go
index 7389c267..f128042b 100644
--- a/instrumentation/net/http/otelhttp/example/server/server.go
+++ b/instrumentation/net/http/otelhttp/example/server/server.go
@@ -19,6 +19,7 @@ import (
"io"
"log"
"net/http"
+ "sync"
View Bench.java
import java.util.function.Function;
import java.lang.Long;
class Bench {
public static void main(String[] args) {
bench("noop ", (l) -> "");
bench("Long.toHexString()", (l) -> Long.toHexString(l));
bench("byteString.... ", (l) -> sfy(l));
bench("String.format(...)", (l) -> String.format("%016X", l));
View HelloWorld.java
class HelloWorld {
public static void main(String[] args) {
bench1();
bench2();
}
static void bench1() {
long repeat = 1000000000L;
long start = java.lang.System.currentTimeMillis();
for (long i = 0; i < repeat; i++) {
View ozone-review2.md

Ozone Code Review 2

HDDS-4819: OM HA configuration

Before, for service id sid, om1 config will be like:

ozone.om.address.sid.om1=0.0.0.0
ozone.om.address.sid.om2=om2
ozone.om.address.sid.om3=om3
View ozone-mpu.md
View ozone-env.sh
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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
@kuenishi
kuenishi / zfsslower
Last active Mar 1, 2021
Modified zfsslower for rename, originally from https://github.com/iovisor/bcc
View zfsslower
#!/usr/bin/python
# @lint-avoid-python-3-compatibility-imports
#
# zfsslower Trace slow ZFS operations.
# For Linux, uses BCC, eBPF.
#
# USAGE: zfsslower [-h] [-j] [-p PID] [min_ms]
#
# This script traces common ZFS file operations: reads, writes, opens, and
# syncs. It measures the time spent in these operations, and prints details
View gist:980f8be83a970f81b1acc4e1fe47df6e
import sys
def char(i):
'''
0-9A-Z => sp(decimal)
'''
if i >= 0 and i <= 9:
return chr(ord('0')+i)
elif i < 36:
return chr(ord('A')+i-10)
View gist:994526ce4512e143eb7ae4fc3d2ffcd1
#!/usr/bin/env python3
import re
import sys
filename = sys.argv[1]
pattern = r"(https://youtu\.be/[a-zA-Z0-9_-]*)"
with open(filename, 'r') as fp:
for line in fp.readlines():
for match in re.findall(pattern, line):