Skip to content

Commit

Permalink
remove metrics and logging changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dedelala committed Apr 23, 2024
1 parent 17cbc51 commit c3184b9
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions go/vt/vtgateproxy/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ type JSONGateResolver struct {
var (
buildCount = stats.NewCounter("JsonDiscoveryBuild", "JSON host discovery rebuilt the host list")
unchangedCount = stats.NewCounter("JsonDiscoveryUnchanged", "JSON host discovery parsed and determined no change to the file")
affinityCount = stats.NewGaugesWithSingleLabel("JsonDiscoveryHostAffinity", "Count of hosts returned from discovery by AZ affinity", "affinity")
poolTypeCount = stats.NewGaugesWithSingleLabel("JsonDiscoveryHostPoolType", "Count of hosts returned from discovery by pool type", "type")
affinityCount = stats.NewCountersWithSingleLabel("JsonDiscoveryHostAffinity", "Count of hosts returned from discovery by AZ affinity", "affinity")
poolTypeCount = stats.NewCountersWithSingleLabel("JsonDiscoveryHostPoolType", "Count of hosts returned from discovery by pool type", "type")
)

func RegisterJSONGateResolver(
Expand Down Expand Up @@ -173,11 +173,7 @@ func (b *JSONGateResolverBuilder) start() error {
fileStat = checkFileStat

contentsChanged, err := b.parse()
if err != nil {
log.Error(err)
continue
}
if !contentsChanged {
if err != nil || !contentsChanged {
unchangedCount.Add(1)
continue
}
Expand Down Expand Up @@ -325,11 +321,11 @@ func (b *JSONGateResolverBuilder) update(r *JSONGateResolver) {
}
}
if unknown != 0 {
affinityCount.Set("unknown", unknown)
affinityCount.Add("unknown", unknown)
}
affinityCount.Set("local", local)
affinityCount.Set("remote", remote)
poolTypeCount.Set(r.poolType, int64(len(targets)))
affinityCount.Add("local", local)
affinityCount.Add("remote", remote)
poolTypeCount.Add(r.poolType, int64(len(targets)))

log.V(100).Infof("updated targets for %s to %v (local %d / remote %d)", r.target.URL.String(), targets, local, remote)

Expand Down

0 comments on commit c3184b9

Please sign in to comment.