Skip to content

Commit

Permalink
Merge pull request #1238 from tigrisdata/main
Browse files Browse the repository at this point in the history
Release Beta
  • Loading branch information
himank authored May 24, 2023
2 parents 99ea269 + 5075bca commit ac4ae91
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions server/metrics/measurement.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,15 @@ func (*Measurement) CountUnits(reqStatus *RequestStatus, tags map[string]string)
writeBytes := reqStatus.GetWriteBytes()
RequestsReadBytes.Tagged(tags).Counter("bytes").Inc(readBytes)
RequestsWriteBytes.Tagged(tags).Counter("bytes").Inc(writeBytes)
RequestsSearchWriteBytes.Tagged(tags).Counter("bytes").Inc(reqStatus.searchWriteBytes)
RequestsReadUnits.Tagged(tags).Counter("units").Inc(getUnitsFromBytes(readBytes, config.ReadUnitSize))
RequestsWriteUnits.Tagged(tags).Counter("units").Inc(getUnitsFromBytes(writeBytes, config.WriteUnitSize))
RequestsDDLDropUnits.Tagged(tags).Counter("units").Inc(reqStatus.GetDDLDropUnits())
RequestsDDLUpdateUnits.Tagged(tags).Counter("units").Inc(reqStatus.GetDDLUpdateUnits())
RequestsDDLCreateUnits.Tagged(tags).Counter("units").Inc(reqStatus.GetDDLCreateUnits())
RequestsCollectionSearchUnits.Tagged(tags).Counter("units").Inc(reqStatus.GetCollectionSearchUnits())
RequestsApiSearchUnits.Tagged(tags).Counter("units").Inc(reqStatus.GetApiSearchUnits())
RequestsSearchWriteUnits.Tagged(tags).Counter("units").Inc(getUnitsFromBytes(reqStatus.searchWriteBytes, config.SearchUnitSize))
}

func (m *Measurement) CountErrorForScope(scope tally.Scope, tags map[string]string) {
Expand Down
4 changes: 4 additions & 0 deletions server/metrics/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ var (
RequestsDDLCreateUnits tally.Scope
RequestsApiSearchUnits tally.Scope
RequestsCollectionSearchUnits tally.Scope
RequestsSearchWriteBytes tally.Scope
RequestsSearchWriteUnits tally.Scope
)

func getRequestOkTagKeys() []string {
Expand Down Expand Up @@ -98,4 +100,6 @@ func initializeRequestScopes() {
RequestsDDLCreateUnits = Requests.SubScope("ddl_create")
RequestsCollectionSearchUnits = Requests.SubScope("collection_search")
RequestsApiSearchUnits = Requests.SubScope("api_search")
RequestsSearchWriteBytes = Requests.SubScope("search_write")
RequestsSearchWriteUnits = Requests.SubScope("search_write")
}
2 changes: 1 addition & 1 deletion server/middleware/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var (
api.QuotaLimitsMetricsMethodName,
api.QuotaUsageMethodName,
api.GetInfoMethodName,

// realtime
api.ReadMessagesMethodName,

Expand Down
1 change: 1 addition & 0 deletions server/quota/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func getProjectSearchSize(ctx context.Context, tenant *metadata.Tenant, project
if ulog.E(err) {
return 0
}
log.Debug().Int64("search_byte_size", prjSearchSize.StoredBytes).Msg("Got search size")
return prjSearchSize.StoredBytes
}

Expand Down
4 changes: 2 additions & 2 deletions test/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ services:
- GOTRUE_DB_URL=http://tigris_server:8081
- GOTRUE_SITE_URL=http://tigris_gotrue:8086
- GOTRUE_JWT_ALGORITHM=RS256
- GOTRUE_JWT_RSA_PRIVATE_KEY=/home/netlify/keys/jwt.test.key
- GOTRUE_JWT_RSA_PUBLIC_KEYS=/home/netlify/keys/jwt.test.key.pub
- GOTRUE_JWT_RSA_PRIVATE_KEY=/home/tigris/keys/jwt.test.key
- GOTRUE_JWT_RSA_PUBLIC_KEYS=/home/tigris/keys/jwt.test.key.pub
- GOTRUE_DISABLE_SIGNUP=false
- GOTRUE_JWT_EXP=300
- GOTRUE_JWT_ISSUER=http://tigris_gotrue:8086
Expand Down

0 comments on commit ac4ae91

Please sign in to comment.