Skip to content

Commit 67517b2

Browse files
authored
README.md example codes fix (#213)
The object list is called 'my_metric_object' not 'metrics_object_list'. This produces a syntax error if someone wants to run it.
1 parent 4954820 commit 67517b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ metric_object_list = MetricsList(metric_data) # metric_object_list will be initi
9393
# metrics downloaded using get_metric query
9494

9595
# We can see what each of the metric objects look like
96-
for item in metrics_object_list:
96+
for item in metric_object_list:
9797
print(item.metric_name, item.label_config, "\n")
9898
```
9999

100100
Each of the items in the `metric_object_list` are initialized as a `Metric` class object. Let's look at one of the metrics from the `metric_object_list` to learn more about the `Metric` class:
101101

102102
```python
103-
my_metric_object = metrics_object_list[1] # one of the metrics from the list
103+
my_metric_object = metric_object_list[1] # one of the metrics from the list
104104
print(my_metric_object)
105105
```
106106

@@ -140,7 +140,7 @@ my_label_config = {'cluster': 'my_cluster_id', 'label_2': 'label_2_value'}
140140
metric_data = prom.get_metric_range_data(metric_name='up', label_config=my_label_config)
141141

142142
metric_object_list = MetricsList(metric_data)
143-
my_metric_object = metrics_object_list[1] # one of the metrics from the list
143+
my_metric_object = metric_object_list[1] # one of the metrics from the list
144144
my_metric_object.plot()
145145
```
146146

0 commit comments

Comments
 (0)