In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what is the metrics in the go monitoring scheme". In the daily operation, I believe that many people have doubts about the metrics in the go monitoring scheme. The editor consulted all kinds of data and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubt of "what is the metrics in the go monitoring scheme?" Next, please follow the editor to study!
Introduction
Metrics is originally a Java library that captures JVM and application-level metrics. In other words, you can get code-level data metrics, such as how many times the method has been called.
The package that goalng uses on github is https://github.com/rcrowley/go-metrics.git
Go-metrics
The influxdb scheme officially adopted by this library only provides TCP connectivity, but what I want to use is to use UDP for data transfer, which has less performance loss.
This is mainly because influxdb uses http as the API interface, and the package adopted implements a set of ways to regularly send http requests to store data.
MetricRegistry
MetricRegistry in Metrics is the central container for all metrics in the program. All new measurement tools must be registered in a MetricRegistry instance before they can be used. Try to keep this MetricRegistry instance singleton in an application.
Example:
R: = metrics.NewRegistry () / / whole system global unique c: = metrics.NewCounter () / / register a counter r.Register ("counter", c) / / this registration name globally unique metric
Metrics provides five basic types of metrics: Gauges, Counters, Histograms, Meters and Timers
Gauge
Gauge is the simplest measurement type, with only a simple return value
It is used to record the instantaneous values of some objects or things.
Similar to a constant in a program, it is a constant value.
Counter
Counter is a simple counter that can be added and decreased.
Similar to global variables in a program, you can increase and decrease to change the value.
Meter
Meter is a self-incrementing counter that is usually used to measure the rate of occurrence of a series of events. It provides the average rate, as well as the exponential smoothing average rate, as well as the rate of 1 minute, 5 minutes, and 15 minutes after sampling.
Similar to QPS, how many times per minute
Histrogram
Histrogram is used to measure the distribution of Value in stream data. Histrogram can calculate maximum / minimum values, averages, variances, quantiles (such as median, or 95th quantiles), such as 75%, 90%, 98%, 99%, within which range of data.
Similar to a bar chart
Median
A proper noun in statistics that represents a value in a sample, population, or probability distribution that divides a set of values into equal upper and lower parts.
To put it simply, it is the number in the middle of a row of data from small to large.
For example: 1, 3, 6, 9, 11. The number in the middle is 6, which is the median. 1,3,6,9,11,13 . There are six numbers, and there are two in the middle, so the median is 6 and 9.
Quartile
Quartile (Quartile), also known as quartile, refers to the statistical arrangement of all values from small to large and divided into four equal parts, at the position of three split points.
First of all, determine the position of the quartile: Q1 position = (nasty 1) × 0.25Q2 position = (nasty 1) × 0.5Q3 position = (nasty 1) × 0.75
So the quantile is the number represented by the proportional sample.
Timer
Timer is a combination of Histogram and Meter, such as counting the rate and processing time of current requests.
At this point, the study of "what is metrics in the go monitoring scheme" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.