Convert Nanoseconds to seconds
Call Init (handler) inside servenv.OnRun()
Add unit tests.
For counter, it doesn't make sense to have a function called ResetAll
and not one called Reset so re-rename that.
Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>
Add plugins for each of the components.
Rename prombackend => prometheusbackend
Rename publishPromMetric to publishPrometheusMetric
Rename Reset() => ResetAll()
ResetCounter => Reset()
Rename various Counters => Gauges per Mike's helpful pointers.
Rename a few help strings.
Remove the comments in go/vt/worker/worker.go metrics and move them 100% into help functions.
Add a GaugeFuncWithMultiLabels
Add a CounterFunc
Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>
Fix tests to use the new metric names.
Fix tests that expected gauges and not counters. (more to come on this
thing, but these were the tests that indicated gauges early)
Fix the `Set()` implementation for GaugesWithMultiLabels.
Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>
pull_backend.go stuff into prombackend/prombackend.go's Register call
and make the pull_backend.go an interface only.
Also, fix some more types from the gigantic refactor, and run
GoLint/GoVet
Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>
This commit consists only of the changes from running the following:
```
find go -name '*.go' | xargs -n 10 -- sed -i -r -e \
's,"github.com/youtube/vitess/go/,"vitess.io/vitess/go/,'
```
Please refer to #2694 and #2670 for motivation and reasoning for
this change.
I've tried to follow best practice in inserting the copyright
headers. In other open source projects, not all files carry
the notice. For example documentation doesn't. I've followed
similar ground rules.
I did not change the php because there is a separate LICENSE
file there by Pixel Federation. We'll first need to notify
them our intent before changing anything there.
As for the presubmit check, it's going to be non-trivial
because of the number of exceptions, like file types,
directories and generated code. So, it will have to be
a separate project.
It is from this repository: https://github.com/dominikh/go-unused
As part of this change:
- adding download of the tool to bootstrap.sh.
- re-enabling a few tests that were disabled.
- removing a bunch of unused code.
and sleeping for predictable times, and be at the mercy of
the underlying hardware performance, use a faked clock
and fixed values, and don't even sleep.
Track the state of each Zookeeper connection in the "ZkCachedConn" variable instead.
Remove "ZkMetaConn" variable because "ZkCachedConn" has the same information now.
Update tabletmanager.py end-to-end test.
I'm removing states.go because it caused a deadlock in the worker.py test.
Its removal is no loss because the original intent was to detect flip-flopping with that code. However, that's no longer necessary.
The observed deadlock occurred when a) somebody polls /debug/vars while b) we create a new Zookeeper connection and publish a "ZkCachedConn" variable for it.
When the connection gets created, then the "states" object is created. The same call also calls expvar.Publish() eventually and this is where the deadlock occurs. (It's a deadlock between a mutex in the "expvar" package and a mutex in the Zookeeper connection package.)
Precreate some of the counter labels at the beginning.
This eliminates some monitoring jitters where an absent
label is not treated as zero value. We should ideally do
this to all stats counters. This is just some low hanging
fruit for now.
When a category of the timings map goes from undefined to defined,
that event will be missed by rate aggregations. For events that happen
often (like queries), missing one is fine. But many reparent events will
be the first time that tablet has become master (since the last restart)
so missing the first event skews aggregations significantly.
1. queryservice should not publish stats if either flag EnablePublishStats
is enabled or var name is empty.
2. stats.NewInt should call Publish if name is empty.
3. mysqlctl.NewMysqld publishes dba stats only if dbaName is not empty.
4. mysqlctl.NewMysqld publishes app stats only if appName is not empty.
5. QueryEngine publishes stats only if flag EnablePublishStats is enabled.
6. RowCacheInvalidator publishes stats only if flag EnablePublishStats is enabled.
The Timings stats collection only had one dimensional
keys, now adding one that supports multi-dimentional keys.
Using it in vtgate for incoming and outgoing stats collection.