-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metrics server #14
Merged
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
a2db4a6
upgrade to latest go version and dependencies, and migrate from circl…
Hsn723 4f5a1d3
use golangci-lint as a replacement to golint
Hsn723 a201f0f
add metrics server
Hsn723 4257d99
instrument usocksd with some metrics
Hsn723 b3213f3
fix typo in Status5DeniedByRuleset string
Hsn723 a3458f7
refactor: fix lint issues without modifying original behavior
Hsn723 c4c00ca
add metrics for proxy
Hsn723 ccc7fbb
remove circleci
Hsn723 7cca6ba
instrument time spent copying to/from buffers
Hsn723 706f713
instrument auth negotiation and address reading, refactor metrics
Hsn723 ce792e3
remove duplicated jobs
pddg 155e605
fix inconsistent metric name
pddg 9da58ba
do not listen when creating listner is failed
pddg 5d75409
upgrade go to 1.20.1
pddg 05787bc
use io instead of ioutil
pddg 65ab492
gofmt
pddg a13e8d9
build with -trimpath
pddg 3904468
exit by ErrorExit when serving metrics server failed
pddg e095487
metrics server now listens on ipv4/ipv6 addr
pddg 0c796be
fix metric names
pddg 03fb5bd
fix error handring on serving metrics server
pddg 866a5c2
fix metric names
pddg 4a7bdc7
fix test
pddg cb5f044
collect all connections count
pddg fbc06d1
remove reason labels
pddg e0a3f10
add type label for address read counter
pddg 89c1f9f
add LabelValue for each type
pddg dc642c2
make unknown as const
pddg 593e0de
add toml tag
pddg f097520
fix fot lint
pddg 7d3b323
fix test
pddg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
name: main | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'master' | ||
env: | ||
go-version: 1.20.1 | ||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.go-version }} | ||
- uses: golangci/golangci-lint-action@v3 | ||
build: | ||
name: Build | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.go-version }} | ||
- run: go build -trimpath ./... | ||
test: | ||
name: Test | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.go-version }} | ||
- run: NO_PROXY= go test -race -v -coverprofile cover.out ./... |
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 |
---|---|---|
|
@@ -28,6 +28,4 @@ _testmain.go | |
*.exe | ||
*.test | ||
*.prof | ||
|
||
# Ignore go.sum | ||
/go.sum | ||
*.out |
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
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
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
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
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
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
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,10 +1,43 @@ | ||
module github.com/cybozu-go/usocksd | ||
|
||
require ( | ||
github.com/BurntSushi/toml v0.3.1 | ||
github.com/cybozu-go/log v1.6.0 | ||
github.com/cybozu-go/netutil v1.2.0 | ||
github.com/cybozu-go/well v1.10.0 | ||
github.com/BurntSushi/toml v1.1.0 | ||
github.com/cybozu-go/log v1.6.1 | ||
github.com/cybozu-go/netutil v1.4.2 | ||
github.com/cybozu-go/well v1.11.0 | ||
github.com/prometheus/client_golang v1.12.2 | ||
) | ||
|
||
go 1.13 | ||
require ( | ||
github.com/beorn7/perks v1.0.1 // indirect | ||
github.com/cespare/xxhash/v2 v2.1.2 // indirect | ||
github.com/fsnotify/fsnotify v1.5.4 // indirect | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/hashicorp/hcl v1.0.0 // indirect | ||
github.com/magiconair/properties v1.8.6 // indirect | ||
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/onsi/gomega v1.19.0 // indirect | ||
github.com/pelletier/go-toml v1.9.5 // indirect | ||
github.com/pelletier/go-toml/v2 v2.0.2 // indirect | ||
github.com/prometheus/client_model v0.2.0 // indirect | ||
github.com/prometheus/common v0.32.1 // indirect | ||
github.com/prometheus/procfs v0.7.3 // indirect | ||
github.com/spf13/afero v1.8.2 // indirect | ||
github.com/spf13/cast v1.5.0 // indirect | ||
github.com/spf13/jwalterweatherman v1.1.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
github.com/spf13/viper v1.12.0 // indirect | ||
github.com/subosito/gotenv v1.4.0 // indirect | ||
github.com/vishvananda/netlink v1.1.0 // indirect | ||
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect | ||
golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect | ||
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e // indirect | ||
golang.org/x/text v0.3.7 // indirect | ||
google.golang.org/protobuf v1.28.0 // indirect | ||
gopkg.in/ini.v1 v1.66.6 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) | ||
|
||
go 1.19 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8081?
These days, I use https://github.com/stretchr/testify to write this kind of tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote it by copying and pasting, sorry :(
This is a simple struct comparison, and I believe google/go-cmp is more appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will fix this, soon.