Report period - how often metric is sent to librato server(defaults to 1 minute).
Chart resolution - time between two sequential points on a chart(depends on chart time range).
Reported as delta since last report.
require 'benchmark' | |
puts "You can also put forked code in a block pid: #{Process.pid}" | |
n = 100000 | |
t = Benchmark.realtime do | |
n.times do | |
Time.now.utc.strftime('%Y-%m-%dT%H:%M:%S.%6N') | |
end | |
end | |
puts "main total: #{t}, avg: #{t/n*1000}ms" |
version: '2' | |
tasks: | |
up: | |
desc: "Run docker compose and subscribe to logs" | |
deps: [down] | |
cmds: | |
- docker-compose up --build -d | |
- docker logs -f api | |
down: |
edit : main.o kbd.o command.o display.o \ | |
insert.o search.o files.o utils.o | |
cc -o edit main.o kbd.o command.o display.o \ | |
insert.o search.o files.o utils.o | |
main.o : main.c defs.h | |
cc -c main.c | |
kbd.o : kbd.c defs.h command.h | |
cc -c kbd.c | |
command.o : command.c defs.h command.h |
package dynamicqueue | |
import ( | |
"fmt" | |
"strconv" | |
"sync" | |
"testing" | |
"time" | |
) |
package dynamicqueue | |
import ( | |
"sync" | |
) | |
type DynamicQueue interface { | |
Add(item interface{}) | |
Stop() | |
} |
func NewDynamicallyBufferedChannel(in <- chan interface{}) <- chan interface{} { | |
out := make(chan interface{}) | |
var storage []interface{} | |
go func() { | |
defer close(out) | |
for { | |
if len(storage) == 0 { | |
item, ok := <-in | |
if !ok { | |
return |
#!/bin/sh | |
cp ./tools/prepare-commit-msg.sh .git/hooks/prepare-commit-msg | |
cp ./tools/pre-commit.sh .git/hooks/pre-commit | |
cp ./tools/pre-push.sh .git/hooks/pre-push | |
chmod 755 .git/hooks/prepare-commit-msg | |
chmod 755 .git/hooks/pre-commit | |
chmod 755 .git/hooks/pre-push |
#!/bin/sh | |
golangci-lint run --tests=0 ./... |
#!/bin/sh | |
go test ./... |