|
1 | 1 | package client |
2 | 2 |
|
3 | | - |
4 | 3 | type ArrayPerformance struct { |
5 | | - Name string `json:"name"` |
6 | | - Id string `json:"id"` |
7 | | - BytesPerMirroredWrite float64 `json:"bytes_per_mirrored_write"` |
8 | | - BytesPerOp float64 `json:"bytes_per_op"` |
9 | | - BytesPerRead float64 `json:"bytes_per_read"` |
10 | | - BytesPerWrite float64 `json:"bytes_per_write"` |
11 | | - MirroredWriteBytesPerSec float64 `json:"mirrored_write_bytes_per_sec"` |
12 | | - MirroredWritesPerSec float64 `json:"mirrored_writes_per_sec"` |
13 | | - QosRateLimitUsecPerMirroredWriteOp float64 `json:"qos_rate_limit_usec_per_mirrored_write_op"` |
14 | | - QosRateLimitUsecPerReadOp float64 `json:"qos_rate_limit_usec_per_read_op"` |
15 | | - QosRateLimitUsecPerWriteOp float64 `json:"qos_rate_limit_usec_per_write_op"` |
16 | | - QueueUsecPerMirroredWriteOp float64 `json:"queue_usec_per_mirrored_write_op"` |
17 | | - QueueUsecPerReadOp float64 `json:"queue_usec_per_read_op"` |
18 | | - QueueUsecPerWriteOp float64 `json:"queue_usec_per_write_op"` |
19 | | - ReadBytesPerSec float64 `json:"read_bytes_per_sec"` |
20 | | - ReadsPerSec float64 `json:"reads_per_sec"` |
21 | | - SanUsecPerMirroredWriteOp float64 `json:"san_usec_per_mirrored_write_op"` |
22 | | - SanUsecPerReadOp float64 `json:"san_usec_per_read_op"` |
23 | | - SanUsecPerWriteOp float64 `json:"san_usec_per_write_op"` |
24 | | - ServiceUsecPerMirroredWriteOp float64 `json:"service_usec_per_mirrored_write_op"` |
25 | | - ServiceUsecPerReadOp float64 `json:"service_usec_per_read_op"` |
26 | | - ServiceUsecPerWriteOp float64 `json:"service_usec_per_write_op"` |
27 | | - Time int `json:"time"` |
28 | | - UsecPerMirroredWriteOp float64 `json:"usec_per_mirrored_write_op"` |
29 | | - UsecPerReadOp float64 `json:"usec_per_read_op"` |
30 | | - UsecPerWriteOp float64 `json:"usec_per_write_op"` |
31 | | - WriteBytesPerSec float64 `json:"write_bytes_per_sec"` |
32 | | - WritesPerSec float64 `json:"writes_per_sec"` |
33 | | - ServiceUsecPerReadOpCacheReduction float64 `json:"service_usec_per_read_op_cache_reduction"` |
34 | | - QueueDepth float64 `json:"queue_depth"` |
35 | | - LocalQueueUsecPerOp float64 `json:"local_queue_usec_per_op"` |
36 | | - UsecPerOtherOp float64 `json:"usec_per_other_op"` |
37 | | - OthersPerSec float64 `json:"others_per_sec"` |
| 4 | + Name string `json:"name"` |
| 5 | + Id string `json:"id"` |
| 6 | + BytesPerMirroredWrite float64 `json:"bytes_per_mirrored_write"` |
| 7 | + BytesPerOp float64 `json:"bytes_per_op"` |
| 8 | + BytesPerRead float64 `json:"bytes_per_read"` |
| 9 | + BytesPerWrite float64 `json:"bytes_per_write"` |
| 10 | + MirroredWriteBytesPerSec float64 `json:"mirrored_write_bytes_per_sec"` |
| 11 | + MirroredWritesPerSec float64 `json:"mirrored_writes_per_sec"` |
| 12 | + QosRateLimitUsecPerMirroredWriteOp float64 `json:"qos_rate_limit_usec_per_mirrored_write_op"` |
| 13 | + QosRateLimitUsecPerReadOp float64 `json:"qos_rate_limit_usec_per_read_op"` |
| 14 | + QosRateLimitUsecPerWriteOp float64 `json:"qos_rate_limit_usec_per_write_op"` |
| 15 | + QueueUsecPerMirroredWriteOp float64 `json:"queue_usec_per_mirrored_write_op"` |
| 16 | + QueueUsecPerReadOp float64 `json:"queue_usec_per_read_op"` |
| 17 | + QueueUsecPerWriteOp float64 `json:"queue_usec_per_write_op"` |
| 18 | + ReadBytesPerSec float64 `json:"read_bytes_per_sec"` |
| 19 | + ReadsPerSec float64 `json:"reads_per_sec"` |
| 20 | + SanUsecPerMirroredWriteOp float64 `json:"san_usec_per_mirrored_write_op"` |
| 21 | + SanUsecPerReadOp float64 `json:"san_usec_per_read_op"` |
| 22 | + SanUsecPerWriteOp float64 `json:"san_usec_per_write_op"` |
| 23 | + ServiceUsecPerMirroredWriteOp float64 `json:"service_usec_per_mirrored_write_op"` |
| 24 | + ServiceUsecPerReadOp float64 `json:"service_usec_per_read_op"` |
| 25 | + ServiceUsecPerWriteOp float64 `json:"service_usec_per_write_op"` |
| 26 | + Time int `json:"time"` |
| 27 | + UsecPerMirroredWriteOp float64 `json:"usec_per_mirrored_write_op"` |
| 28 | + UsecPerReadOp float64 `json:"usec_per_read_op"` |
| 29 | + UsecPerWriteOp float64 `json:"usec_per_write_op"` |
| 30 | + WriteBytesPerSec float64 `json:"write_bytes_per_sec"` |
| 31 | + WritesPerSec float64 `json:"writes_per_sec"` |
| 32 | + ServiceUsecPerReadOpCacheReduction float64 `json:"service_usec_per_read_op_cache_reduction"` |
| 33 | + QueueDepth float64 `json:"queue_depth"` |
| 34 | + LocalQueueUsecPerOp float64 `json:"local_queue_usec_per_op"` |
| 35 | + UsecPerOtherOp float64 `json:"usec_per_other_op"` |
| 36 | + OthersPerSec float64 `json:"others_per_sec"` |
38 | 37 | } |
39 | 38 |
|
40 | 39 | type ArraysPerformanceList struct { |
41 | | - ContinuationToken string `json:"continuation_token"` |
42 | | - TotalItemCount int `json:"total_item_count"` |
43 | | - MoreItemsRemaining bool `json:"more_items_remaining"` |
44 | | - Items []ArrayPerformance `json:"items"` |
| 40 | + ContinuationToken string `json:"continuation_token"` |
| 41 | + TotalItemCount int `json:"total_item_count"` |
| 42 | + MoreItemsRemaining bool `json:"more_items_remaining"` |
| 43 | + Items []ArrayPerformance `json:"items"` |
45 | 44 | } |
46 | 45 |
|
47 | 46 | func (fa *FAClient) GetArraysPerformance() *ArraysPerformanceList { |
48 | 47 | uri := "/arrays/performance" |
49 | 48 | result := new(ArraysPerformanceList) |
50 | | - res, err := fa.RestClient.R(). |
| 49 | + res, _ := fa.RestClient.R(). |
51 | 50 | SetResult(&result). |
52 | 51 | Get(uri) |
53 | | - |
54 | | - if err != nil { |
55 | | - fa.Error = err |
| 52 | + if res.StatusCode() == 401 { |
| 53 | + fa.RefreshSession() |
| 54 | + fa.RestClient.R(). |
| 55 | + SetResult(&result). |
| 56 | + Get(uri) |
56 | 57 | } |
57 | | - if res.StatusCode() == 401 { |
58 | | - fa.RefreshSession() |
59 | | - } |
60 | | - res, err = fa.RestClient.R(). |
61 | | - SetResult(&result). |
62 | | - Get(uri) |
63 | | - if err != nil { |
64 | | - fa.Error = err |
65 | | - } |
66 | | - |
67 | 58 | return result |
68 | 59 | } |
0 commit comments