Skip to content

Instantly share code, notes, and snippets.

Avatar

Mitsunori Komatsu komamitsu

View GitHub Profile
View hanoi.rb
require 'pp'
def print_plates(plates, disp_interval)
max_plate = plates.map{|plate| plate.max || 0}.max
puts
max_plate.downto(0) do |i|
plates.each do |plate|
width = plate[i].to_i
full_width = [width * 2 - 1, 0].max
max_plate_full_width = max_plate * 2 - 1
View digdag-internal-memo.md
  • TaskCallbackApi (and SecretProvider) are the only interface for agents to access database.
View digdag_tasks.md
public int trySetChildrenBlockedToReadyOrShortCircuitPlannedOrCanceled(long taskId)
{
    return handle.createStatement("update tasks" +
            " set updated_at = now(), state = case" +
            " when task_type = " + TaskType.GROUPING_ONLY + " then " + TaskStateCode.PLANNED_CODE +
            " when " + bitAnd("state_flags", Integer.toString(TaskStateFlags.CANCEL_REQUESTED)) + " != 0 then " + TaskStateCode.CANCELED_CODE +
            " else " + TaskStateCode.READY_CODE +
            " end" +
            " where state = " + TaskStateCode.BLOCKED_CODE +
View build_jvmti_demo.txt
[komamitsu@potato mtrace]$ pwd
/Users/komamitsu/src/openjdk/jdk/src/share/demo/jvmti/mtrace
[komamitsu@potato mtrace]$ clang -I${JAVA_HOME}/include -I${JAVA_HOME}/include/darwin -I../agent_util -I../java_crw_demo -c ../agent_util/agent_util.c ../java_crw_demo/java_crw_demo.c *.c
[komamitsu@potato mtrace]$ clang -dynamiclib -L${JAVA_HOME} -shared -o libmtrace.so *.o
[komamitsu@potato mtrace]$
@komamitsu
komamitsu / throughput.md
Last active Jun 3, 2020
Throughput comparison between fluency and fluent-logger-java
View throughput.md

Throughput comparison

Instances

  • fluency/fluent-logger-java:
  • m3.large
  • fleuentd
  • m3.large

Result

View rust_memos.txt
- rust - Error when a trait is used as a type but not when used as a bound in a where clause - Stack Overflow http://stackoverflow.com/questions/37347695/error-when-a-trait-is-used-as-a-type-but-not-when-used-as-a-bound-in-a-where-cla
View msgpack-perf.log
# Java 7
## master
serialize(pojo) with JSON:
mean : 150.873
min : 140.398
max : 158.998
stdev: 7.883
View fluency_file_backup_size_0.txt
16:14:47.771 WARN [pool-2-thread-1] o.k.f.s.RetryableSender This sender is already closed
16:14:47.771 WARN [pool-2-thread-1] o.k.f.s.RetryableSender This sender is already closed
16:14:47.771 WARN [pool-2-thread-1] o.k.f.s.RetryableSender This sender is already closed
16:14:47.772 ERROR [pool-2-thread-1] o.k.f.f.AsyncFlusher Failed to flush
java.io.IOException: Failed to move retention buffer due to interruption
at org.komamitsu.fluency.buffer.PackedForwardBuffer.moveRetentionBufferToFlushable(PackedForwardBuffer.java:178) ~[main/:na]
at org.komamitsu.fluency.buffer.PackedForwardBuffer.moveRetentionBuffersToFlushable(PackedForwardBuffer.java:161) ~[main/:na]
at org.komamitsu.fluency.buffer.PackedForwardBuffer.flushInternal(PackedForwardBuffer.java:192) ~[main/:na]
at org.komamitsu.fluency.buffer.Buffer.flush(Buffer.java:88) ~[main/:na]
at org.komamitsu.fluency.flusher.AsyncFlusher$1.run(AsyncFlusher.java:40) ~[main/:na]
View fluency_log_failover.txt
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/bin/java -ea -Didea.launcher.port=7532 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 15 CE.app/Contents/bin" -Didea.junit.sm_runner -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA 15 CE.app/Contents/lib/idea_rt.jar:/Applications/IntelliJ IDEA 15 CE.app/Contents/plugins/junit/lib/junit-rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-doclet.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib/charsets.
View msgpack-java_in_fluency.log
Connected to the target VM, address: '127.0.0.1:55933', transport: 'socket'
01:37:47.102 DEBUG o.k.f.MockTCPServer ServerTask: accepting... this=org.komamitsu.fluency.MockTCPServer$ServerTask@213b8493, local.port=56065
01:37:47.301 DEBUG o.k.f.MockTCPServer ServerTask: accepting... this=org.komamitsu.fluency.MockTCPServer$ServerTask@398a1cf1, local.port=56066
01:37:48.031 DEBUG o.k.f.MockTCPServer ServerTask: accepted. this=org.komamitsu.fluency.MockTCPServer$ServerTask@213b8493, local.port=56065, remote.port=56131
01:37:48.034 DEBUG o.k.f.MockTCPServer ServerTask: accepting... this=org.komamitsu.fluency.MockTCPServer$ServerTask@213b8493, local.port=56065
01:37:48.034 DEBUG o.k.f.MockTCPServer AcceptTask: connected. this=org.komamitsu.fluency.MockTCPServer$ServerTask$AcceptTask@3ab81057, local=56065, remote=56131
if (remaining >= readLength): position=17, readLength=4
if (remaining >= readLength): position=28, readLength=8
if (remaining >= readLength): position=190, readLength=4
if (remaining >= readLength):