-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* integrated redis client to test * opt: aof file write raw request buffer * opt: Optimize RESP parse mem usage, use mmap to read aof file * opt: zero-copy RESP parser * adapt hset command * build docker images --------- Co-authored-by: guangzhixu <guangzhixu@deepglint.com>
- Loading branch information
1 parent
b19d4b5
commit 04969bb
Showing
37 changed files
with
1,034 additions
and
3,427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
tmp-* | ||
coverage.* | ||
rotom | ||
*.aof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM golang:1.22-alpine AS builder | ||
|
||
LABEL stage=gobuilder \ | ||
mainatiner=https://github.com/xgzlucario/rotom | ||
|
||
ENV CGO_ENABLED 0 | ||
ENV GOPROXY https://goproxy.cn,direct | ||
|
||
WORKDIR /build | ||
|
||
COPY . . | ||
|
||
RUN go build -o rotom . | ||
|
||
FROM alpine:latest | ||
|
||
ENV TZ Asia/Shanghai | ||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories | ||
RUN apk add --no-cache ca-certificates tzdata && \ | ||
update-ca-certificates | ||
|
||
RUN apk --no-cache add redis | ||
|
||
VOLUME /data | ||
WORKDIR /data | ||
|
||
COPY --from=builder /build/rotom /data/rotom | ||
COPY config.json /etc/rotom/config.json | ||
|
||
EXPOSE 6969 | ||
|
||
CMD ["./rotom", "-config", "/etc/rotom/config.json"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,21 @@ | ||
run: | ||
rm -f rotom.db | ||
go run example/*.go | ||
|
||
run-db: | ||
go run example/*.go | ||
go run . | ||
|
||
run-gc: | ||
rm -f rotom.db | ||
GODEBUG=gctrace=1 go run main.go | ||
GODEBUG=gctrace=1 go run . | ||
|
||
test-cover: | ||
go test -race -v \ | ||
-coverpkg=./... \ | ||
-coverprofile=coverage.txt -covermode=atomic | ||
go test -race -v -coverprofile=coverage.txt -covermode=atomic | ||
go tool cover -html=coverage.txt -o coverage.html | ||
make clean | ||
rm coverage.txt | ||
|
||
pprof: | ||
go tool pprof -http=:18081 "http://localhost:6060/debug/pprof/profile?seconds=60" | ||
go tool pprof -http=:18081 "http://192.168.1.6:6060/debug/pprof/profile?seconds=30" | ||
|
||
heap: | ||
go tool pprof http://localhost:6060/debug/pprof/heap | ||
|
||
run-bench: | ||
go run benchmark/*.go | ||
make clean | ||
build-docker: | ||
docker build -t rotom . | ||
|
||
clean: | ||
rm -f coverage.txt | ||
rm -rf tmp-* | ||
# rsync -av --exclude='.git' rotom/ 2:~/xgz/rotom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.