Граф коммитов

28 Коммитов

Автор SHA1 Сообщение Дата
Sugu Sougoumarane dd1b5698c7 stats: address review comments
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-03-01 21:50:48 -08:00
Sugu Sougoumarane cb2f6aaf99 stats: drop dimension: address review comments
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-02-09 23:27:57 -08:00
Sugu Sougoumarane 468ead013f stats: dropped dimension: fix empty label bug
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-02-09 23:02:42 -08:00
Sugu Sougoumarane b5066e3f84 stats: drop dimension
This feature implements the drop dimension part of #5791.

The dropping of dimensions is not applicable to all stats vars.
We drop dimensions for counters and timings, but not gauges.
This also doesn't work for func based vars, but those are now
unused for counters and timings.

The feature doesn't actually drop the dimension. Instead, it
consolidates all the different values into a single "all"
category. This approach is more backward compatible and allows
for going back and forth, because the label itself continues
to exist in both scenarios.

Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
2020-02-09 02:18:41 -08:00
yuxiaobo 03e83d6c30 add license in /go file
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-10-21 22:30:02 +08:00
Alain Jobart 902e3d0366 Moving stats variable escaping to its own file.
That way it can be customized.

Signed-off-by: Alain Jobart <alainjobart@google.com>
2018-07-11 15:24:29 -07:00
David Weitzman b57b0647ba Replace "." with "_" in multi-counter and multi-timings label values.
This ensures that the number of labels at parse time equals the number of labels at join time.

Without this, some metrics exporters can get confused and panic().

Signed-off-by: David Weitzman <dweitzman@pinterest.com>
2018-06-11 16:11:37 -07:00
Michael Berlin a6c5e26478 stats: Remove CountersFunc type.
Instead, all code should use "CountersFuncWithMultiLabels" with a single label instead.

There was only one place in the codebase (binlog_players.go) which had to be changed.

Signed-off-by: Michael Berlin <mberlin@google.com>
2018-04-28 14:34:31 -07:00
Michael Berlin 66747a1ebb stats: Change order of "help" parameter in (Gauges|Counters)Func* types.
Now the function signatures are consistent with all other constructors.

Other changes:
- Do not repeat the type in function signatures when it's the same.
- Do not use receiver names with more than 2 letters.
- Do not use pointer receiver if you don't want to modify the object.

Signed-off-by: Michael Berlin <mberlin@google.com>
2018-04-28 12:37:43 -07:00
Michael Berlin a20b453db0 stats: Rename (Counters|Gauges)WithLabels to *WithSingleLabel.
The new name is more consistent with the *WithMultiLabels counterparts.

Signed-off-by: Michael Berlin <mberlin@google.com>
2018-04-28 11:59:40 -07:00
Maggie Zhou f2afcd25d5 Get rid of the pull_backend.go
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>
2018-04-20 16:51:46 -07:00
Maggie Zhou 0d17a264e0 Quick followup to @demmer's IRL comments that I could push some of the
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>
2018-04-20 16:51:46 -07:00
Maggie Zhou 1687f8be9a * Refactor the pull backend to use the expvar hook.
* Fix the nanoseconds => ints for histogram buckets.
* Gigantic rename of metrics:

-Int => Counter
-IntGauge => Gauge
-IntFunc => GaugeFunc
-Counters => CountersWithLabels
-MultiCounters => CountersWithMultiLabels
-MultiCounterFunc => CountersFuncWithMultiLabels
-Gauges => GaugesWithLabels
-MultiGauges=> GaugesWithMultiLabels

* Add an explicit labelName for CountersWithLabels & GaugesWithLabels

Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>
2018-04-20 16:51:46 -07:00
Maggie Zhou 6b5d7e1bdc WIP PR to add support for exporting metrics to Prometheus.
Signed-off-by: Maggie Zhou <mzhou@slack-corp.com>
2018-04-20 16:51:46 -07:00
Matt Harden 7910a61684 fix stats.Counters.String method to generate valid JSON for map keys 2017-07-22 19:46:54 -07:00
Matt Harden 6b36e84f15 stats: escape map keys containing dot (.) 2017-07-12 17:38:08 -07:00
Sugu Sougoumarane 7af23e1dde license: BSD->Apache v2.0
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.
2017-05-06 00:38:56 -07:00
Liang Guo 45fdaa44a7 Improve counters 99th latency benchmark. 2016-03-28 13:58:15 -07:00
Anthony Yeh 32d95aaf6c Add benchmarks for stats.Counters.Add(). 2016-03-22 11:49:55 -07:00
Sugu Sougoumarane 6e3f6f6777 tabletserver: precreate some stats labels
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.
2015-09-12 23:19:30 -07:00
Ryszard Szopa a73625a93a stats: rename Map* to Multi* to make multidimensionality of the counters more obvious.
Conflicts:
	go/cmd/vtgate/vtgate.go
	go/vt/tabletserver/schema_info.go
	go/vt/vtgate/scatter_conn.go
2014-07-10 19:25:46 -07:00
Alain Jobart ba52d2ce4c Adding stats.MapCounters, similar to MapTimings.
Using it in vtgate error counting.
2014-06-10 09:57:28 -07:00
David Symonds dcc88cd329 Fix dependence on map iteration order.
Go map iteration order is undefined, and the upcoming Go 1.3 release makes it more random.
2014-05-29 16:21:03 +10:00
Liang Guo d0092b04f0 Export memcache stats, table stats and query stats through stats package. 2013-09-08 22:22:52 -07:00
Sugu Sougoumarane 420b981173 switch to a more strict register scheme 2013-08-26 17:10:10 -07:00
Sugu Sougoumarane ad9c67d954 fix race condition in vars creation vs Register. 2013-08-26 16:06:31 -07:00
Alain Jobart e0debcfdb5 Fixing flaky test. 2013-08-06 12:24:51 -07:00
Sugu Sougoumarane 08edcb2456 Prep work for alternate ways to export variables, and more comments and
tests.
2013-08-05 01:23:26 -07:00