Skip to content

Commit

Permalink
Merge branch 'tsuna:master' into replace-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
xdanica authored Jun 13, 2024
2 parents 6934fc8 + faec3bd commit 6c7a53b
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go: [~1.18, ^1]
go: [~1.22, ^1]
steps:
- uses: actions/checkout@v2

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tsuna/gohbase

go 1.18
go 1.22

require (
github.com/go-zookeeper/zk v1.0.3
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
Expand Down
1 change: 1 addition & 0 deletions region/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ func (c *client) send(rpc hrpc.Call) (uint32, error) {
return id, err
}

rpcSize.WithLabelValues(c.Addr()).Observe(float64(uint32(len(b)) + cellblocksLen))
if cellblocks != nil {
bfs := append(net.Buffers{b}, cellblocks...)
_, err = bfs.WriteTo(c.conn)
Expand Down
6 changes: 3 additions & 3 deletions region/compressor.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ func resizeBufferCap(b []byte, capacity int) []byte {
return b
}

l := len(b)
b = append(b, make([]byte, capacity-l)...)
return b[:l]
b2 := make([]byte, capacity)
copy(b2, b)
return b2[:len(b)]
}

func (c *compressor) compressCellblocks(cbs net.Buffers, uncompressedLen uint32) []byte {
Expand Down
12 changes: 12 additions & 0 deletions region/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,16 @@ var (
},
[]string{"regionserver"},
)

rpcSize = promauto.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: "gohbase",
Name: "rpc_size_bytes",
Help: "Number of bytes sent per RPC call to HBase",
// >>> [1024*(4**i) for i in range(8)]
// [1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216]
Buckets: prometheus.ExponentialBuckets(1024, 4, 8),
},
[]string{"regionserver"},
)
)

0 comments on commit 6c7a53b

Please sign in to comment.