Benchmark comparison rec.go with major logger libraries.
Benchmark results are compared using benchstat.
log sample:
| # 前準備 | |
| mkdir -p /tmp/benchmark | |
| cd /tmp/benchmark | |
| # ベンチマークファイル作成 | |
| tee /tmp/benchmark/benchmark_test.go <<"EOF" | |
| package benchmark_test | |
| import ( | |
| "strconv" |
| package main | |
| import ( | |
| "log" | |
| "net/http" | |
| "github.com/gorilla/websocket" | |
| ) | |
| var upgrader = websocket.Upgrader{} // use default options |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net" | |
| "sync" | |
| "time" | |
| ) |
| sudo tcpdump -G300 -W1 -vvv -l -n -p -s 65535 -w "$(uname -n)_%Y%m%dT%H%M%S.pcap" |
| #!/bin/bash | |
| # MySQL 5.6 client libraries | |
| # https://launchpad.net/ubuntu/xenial/amd64/libmysqlclient-dev/5.6.28-1ubuntu3 | |
| # https://launchpad.net/ubuntu/xenial/amd64/mysql-client-5.6/5.6.28-1ubuntu3 | |
| # https://launchpad.net/ubuntu/xenial/amd64/mysql-client-core-5.6/5.6.28-1ubuntu3 | |
| # https://launchpad.net/ubuntu/xenial/amd64/mysql-common/5.6.28-1ubuntu3 | |
| # https://launchpad.net/ubuntu/xenial/amd64/libmysqlclient18/5.6.28-1ubuntu3 | |
| # DEPRECATED https://launchpad.net/ubuntu/xenial/amd64/libdbd-mysql-perl/4.033-1 |
| while sleep 1; do | |
| date | |
| if [ "$(date +%Y%m%dT%H%M)" = "20190314T1612" ]; then | |
| sudo tcpdump -w $(uname -n)_%Y%m%dT%H%M%S.pcap -W1 -G300 | |
| fi | |
| done |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import boto3 | |
| from boto3.session import Session | |
| boto3.set_stream_logger() | |
| session = Session(profile_name='YOUR_AWS_PROFILE_NAME') | |
| s3 = session.resource('s3') |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from boto3.session import Session | |
| session = Session(profile_name='YOUR_AWS_PROFILE_NAME') | |
| ec2 = session.client('ec2') | |
| ec2.describe_instances() |
| difff() {(R=$(printf '\e[31m');G=$(printf '\e[32m');B=$(printf '\e[36m');W=$(printf '\e[1m');N=$(printf '\e[0m');diff -u "$@"|sed $(uname -s|grep -q '^Darwin'&&printf -- -E||printf -- -r) "s/(^@@.+@@|@@.+@@$)/$B\1$N/g;s/(^\+.*)$/$G\1$N/g;s/(^\-.*)$/$R\1$N/g;s/^[^\+\-]*((\+{3}|-{3}) [^ ].*)/$W\1/g;")} |