Просмотр исходного кода

Fix some misspells in docs and code (#5549)

Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
JoeWrightss 6 лет назад
Родитель
Сommit
b92e9d84eb

+ 3 - 3
backends/WALKTHROUGH.md

@@ -209,7 +209,7 @@ Prometheus. In order to do this let’s keep our metrics page open for reference
 http://localhost:19999/api/v1/allmetrics?format=prometheus&help=yes  We are
 setting out to graph the data in the CPU chart so let’s search for “system.cpu”
 in the metrics page above. We come across a section of metrics with the first
-comments  `# COMMENT homogeneus chart "system.cpu", context "system.cpu", family
+comments  `# COMMENT homogeneous chart "system.cpu", context "system.cpu", family
 "cpu", units "percentage"` Followed by the metrics. This is a good start now let
 us drill down to the specific metric we would like to graph.
 
@@ -251,9 +251,9 @@ http://localhost:19999/api/v1/allmetrics?format=prometheus&help=yes&types=yes&so
 If you choose to use this method you will need to use Prometheus's set of
 functions here: https://prometheus.io/docs/querying/functions/ to obtain useful
 metrics as you are now dealing with raw counters from the system. For example
-you will have to use the `irate()` function over a counter to get that metrics
+you will have to use the `irate()` function over a counter to get that metric's
 rate per second. If your graphing needs are met by using the metrics returned by
-NetDatas internal database (not specifying any source= url parameter) then use
+NetData's internal database (not specifying any source= url parameter) then use
 that. If you find limitations then consider re-writing your queries using the
 raw data and using Prometheus functions to get the desired chart.
 

+ 2 - 2
backends/prometheus/README.md

@@ -250,7 +250,7 @@ If you search that page for `"system.cpu"` you will find all the metrics netdata
 Searching for `"system.cpu"` reveals:
 
 ```sh
-# COMMENT homogeneus chart "system.cpu", context "system.cpu", family "cpu", units "percentage"
+# COMMENT homogeneous chart "system.cpu", context "system.cpu", family "cpu", units "percentage"
 # COMMENT netdata_system_cpu_percentage_average: dimension "guest_nice", value is percentage, gauge, dt 1500066653 to 1500066662 inclusive
 netdata_system_cpu_percentage_average{chart="system.cpu",family="cpu",dimension="guest_nice"} 0.0000000 1500066662000
 # COMMENT netdata_system_cpu_percentage_average: dimension "guest", value is percentage, gauge, dt 1500066653 to 1500066662 inclusive
@@ -279,7 +279,7 @@ In `average` or `sum` data sources, all values are normalized and are reported t
 If the data source was `as collected`, the response would be:
 
 ```sh
-# COMMENT homogeneus chart "system.cpu", context "system.cpu", family "cpu", units "percentage"
+# COMMENT homogeneous chart "system.cpu", context "system.cpu", family "cpu", units "percentage"
 # COMMENT netdata_system_cpu_total: chart "system.cpu", context "system.cpu", family "cpu", dimension "guest_nice", value * 1 / 1 delta gives percentage (counter)
 netdata_system_cpu_total{chart="system.cpu",family="cpu",dimension="guest_nice"} 0 1500066716438
 # COMMENT netdata_system_cpu_total: chart "system.cpu", context "system.cpu", family "cpu", dimension "guest", value * 1 / 1 delta gives percentage (counter)

+ 4 - 4
backends/prometheus/backend_prometheus.c

@@ -305,13 +305,13 @@ static void rrd_stats_api_v1_charts_allmetrics_prometheus(RRDHOST *host, BUFFER
             rrdset_rdlock(st);
 
             int as_collected = (BACKEND_OPTIONS_DATA_SOURCE(backend_options) == BACKEND_SOURCE_DATA_AS_COLLECTED);
-            int homogeneus = 1;
+            int homogeneous = 1;
             if(as_collected) {
                 if(rrdset_flag_check(st, RRDSET_FLAG_HOMEGENEOUS_CHECK))
                     rrdset_update_heterogeneous_flag(st);
 
                 if(rrdset_flag_check(st, RRDSET_FLAG_HETEROGENEOUS))
-                    homogeneus = 0;
+                    homogeneous = 0;
             }
             else {
                 if(BACKEND_OPTIONS_DATA_SOURCE(backend_options) == BACKEND_SOURCE_DATA_AVERAGE && !(output_options & PROMETHEUS_OUTPUT_HIDEUNITS))
@@ -320,7 +320,7 @@ static void rrd_stats_api_v1_charts_allmetrics_prometheus(RRDHOST *host, BUFFER
 
             if(unlikely(output_options & PROMETHEUS_OUTPUT_HELP))
                 buffer_sprintf(wb, "\n# COMMENT %s chart \"%s\", context \"%s\", family \"%s\", units \"%s\"\n"
-                               , (homogeneus)?"homogeneus":"heterogeneous"
+                               , (homogeneous)?"homogeneous":"heterogeneous"
                                , (output_options & PROMETHEUS_OUTPUT_NAMES && st->name) ? st->name : st->id
                                , st->context
                                , st->family
@@ -348,7 +348,7 @@ static void rrd_stats_api_v1_charts_allmetrics_prometheus(RRDHOST *host, BUFFER
                             suffix = "_total";
                         }
 
-                        if(homogeneus) {
+                        if(homogeneous) {
                             // all the dimensions of the chart, has the same algorithm, multiplier and divisor
                             // we add all dimensions as labels