Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Top clients metrics collection #3132

Merged
merged 10 commits into from
Sep 9, 2024
2 changes: 1 addition & 1 deletion cmd/collectors/commonutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func InvokeRestCallWithTestFile(client *rest.Client, href string, logger *loggin
func InvokeRestCall(client *rest.Client, href string, logger *logging.Logger) ([]gjson.Result, error) {
result, err := rest.Fetch(client, href)
if err != nil {
logger.Error().Err(err).Str("href", href).Msg("Failed to fetch data")
logger.Error().Err(err).Str("href", href).Int("hrefLength", len(href)).Msg("Failed to fetch data")
return []gjson.Result{}, err
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"records": [
{
"volume": {
"uuid": "079b3c19-1356-11ef-9138-00a098d390f2",
"name": "volharvest",
"_links": {
"self": {
"href": "/api/storage/volumes/079b3c19-1356-11ef-9138-00a098d390f2"
}
}
},
"throughput": {
"read": 5272371
},
"client_ip": "10.193.113.50",
"svm": {
"uuid": "ff82ac73-d7f8-11eb-80e3-00a098d39e12",
"name": "osc",
"_links": {
"self": {
"href": "/api/svm/svms/ff82ac73-d7f8-11eb-80e3-00a098d39e12"
}
}
}
}
],
"num_records": 1,
"_links": {
"self": {
"href": "/api/storage/volumes/*/top-metrics/clients?top_metric=throughput.read&fields=client_ip,svm&volume.name=volharvest|osc_vol01|RahulTest&svm.name=osc|astra300"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"records": [
{
"volume": {
"uuid": "079b3c19-1356-11ef-9138-00a098d390f2",
"name": "volharvest",
"_links": {
"self": {
"href": "/api/storage/volumes/079b3c19-1356-11ef-9138-00a098d390f2"
}
}
},
"iops": {
"read": 241
},
"client_ip": "10.193.113.50",
"svm": {
"uuid": "ff82ac73-d7f8-11eb-80e3-00a098d39e12",
"name": "osc",
"_links": {
"self": {
"href": "/api/svm/svms/ff82ac73-d7f8-11eb-80e3-00a098d39e12"
}
}
}
}
],
"num_records": 1,
"_links": {
"self": {
"href": "/api/storage/volumes/*/top-metrics/clients?top_metric=iops.read&fields=client_ip,svm&volume.name=volharvest|osc_vol01|RahulTest&svm.name=osc|astra300"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"records": [
{
"volume": {
"uuid": "03613247-54ac-4127-a512-afb331f1c207",
"name": "osc_vol01",
"_links": {
"self": {
"href": "/api/storage/volumes/03613247-54ac-4127-a512-afb331f1c207"
}
}
},
"throughput": {
"write": 863436
},
"client_ip": "10.193.49.9",
"svm": {
"uuid": "ff82ac73-d7f8-11eb-80e3-00a098d39e12",
"name": "osc",
"_links": {
"self": {
"href": "/api/svm/svms/ff82ac73-d7f8-11eb-80e3-00a098d39e12"
}
}
}
},
{
"volume": {
"uuid": "03613247-54ac-4127-a512-afb331f1c207",
"name": "osc_vol01",
"_links": {
"self": {
"href": "/api/storage/volumes/03613247-54ac-4127-a512-afb331f1c207"
}
}
},
"throughput": {
"write": 1638
},
"client_ip": "10.193.206.81",
"svm": {
"uuid": "ff82ac73-d7f8-11eb-80e3-00a098d39e12",
"name": "osc",
"_links": {
"self": {
"href": "/api/svm/svms/ff82ac73-d7f8-11eb-80e3-00a098d39e12"
}
}
}
},
{
"volume": {
"uuid": "079b3c19-1356-11ef-9138-00a098d390f2",
"name": "volharvest",
"_links": {
"self": {
"href": "/api/storage/volumes/079b3c19-1356-11ef-9138-00a098d390f2"
}
}
},
"throughput": {
"write": 5272371
},
"client_ip": "10.193.113.50",
"svm": {
"uuid": "ff82ac73-d7f8-11eb-80e3-00a098d39e12",
"name": "osc",
"_links": {
"self": {
"href": "/api/svm/svms/ff82ac73-d7f8-11eb-80e3-00a098d39e12"
}
}
}
}
],
"num_records": 3,
"_links": {
"self": {
"href": "/api/storage/volumes/*/top-metrics/clients?top_metric=throughput.write&fields=client_ip,svm&volume.name=volharvest|osc_vol01|RahulTest&svm.name=osc|astra300"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"records": [
{
"volume": {
"uuid": "03613247-54ac-4127-a512-afb331f1c207",
"name": "osc_vol01",
"_links": {
"self": {
"href": "/api/storage/volumes/03613247-54ac-4127-a512-afb331f1c207"
}
}
},
"iops": {
"write": 6
},
"client_ip": "10.193.49.9",
"svm": {
"uuid": "ff82ac73-d7f8-11eb-80e3-00a098d39e12",
"name": "osc",
"_links": {
"self": {
"href": "/api/svm/svms/ff82ac73-d7f8-11eb-80e3-00a098d39e12"
}
}
}
},
{
"volume": {
"uuid": "03613247-54ac-4127-a512-afb331f1c207",
"name": "osc_vol01",
"_links": {
"self": {
"href": "/api/storage/volumes/03613247-54ac-4127-a512-afb331f1c207"
}
}
},
"iops": {
"write": 1
},
"client_ip": "10.193.206.81",
"svm": {
"uuid": "ff82ac73-d7f8-11eb-80e3-00a098d39e12",
"name": "osc",
"_links": {
"self": {
"href": "/api/svm/svms/ff82ac73-d7f8-11eb-80e3-00a098d39e12"
}
}
}
},
{
"volume": {
"uuid": "03613247-54ac-4127-a512-afb331f1c207",
"name": "osc_vol01",
"_links": {
"self": {
"href": "/api/storage/volumes/03613247-54ac-4127-a512-afb331f1c207"
}
}
},
"iops": {
"write": 1
},
"client_ip": "10.193.48.139",
"svm": {
"uuid": "ff82ac73-d7f8-11eb-80e3-00a098d39e12",
"name": "osc",
"_links": {
"self": {
"href": "/api/svm/svms/ff82ac73-d7f8-11eb-80e3-00a098d39e12"
}
}
}
},
{
"volume": {
"uuid": "079b3c19-1356-11ef-9138-00a098d390f2",
"name": "volharvest",
"_links": {
"self": {
"href": "/api/storage/volumes/079b3c19-1356-11ef-9138-00a098d390f2"
}
}
},
"iops": {
"write": 161
},
"client_ip": "10.193.113.50",
"svm": {
"uuid": "ff82ac73-d7f8-11eb-80e3-00a098d39e12",
"name": "osc",
"_links": {
"self": {
"href": "/api/svm/svms/ff82ac73-d7f8-11eb-80e3-00a098d39e12"
}
}
}
}
],
"num_records": 4,
"_links": {
"self": {
"href": "/api/storage/volumes/*/top-metrics/clients?top_metric=iops.write&fields=client_ip,svm&volume.name=volharvest|osc_vol01|RahulTest&svm.name=osc|astra300"
}
}
}
Loading